]>
Commit | Line | Data |
---|---|---|
36c3b296 AK |
1 | /* |
2 | * Zebra dataplane plugin for DPDK based hw offload | |
3 | * | |
4 | * Copyright (C) 2021 Nvidia | |
5 | * Anuradha Karuppiah | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License along | |
18 | * with this program; see the file COPYING; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | */ | |
21 | ||
22 | #ifndef _ZEBRA_DPLANE_DPDK_PRIVATE_H | |
23 | #define _ZEBRA_DPLANE_DPDK_PRIVATE_H | |
24 | ||
25 | #include <zebra.h> | |
26 | ||
67f5a232 AK |
27 | #include <rte_ethdev.h> |
28 | ||
36c3b296 AK |
29 | #include "zebra_dplane_dpdk.h" |
30 | ||
7f0416b3 AK |
31 | /* match on eth, sip, dip, udp */ |
32 | #define ZD_PBR_PATTERN_MAX 6 | |
33 | /* dec_ttl, set_smac, set_dmac, * phy_port, count | |
34 | */ | |
35 | #define ZD_PBR_ACTION_MAX 6 | |
36 | ||
37 | #define ZD_ETH_TYPE_IP 0x800 | |
36c3b296 | 38 | |
a66d6246 AK |
39 | struct zd_dpdk_port { |
40 | uint16_t port_id; /* dpdk port_id */ | |
41 | struct rte_eth_dev_info dev_info; /* PCI info + driver name */ | |
42 | uint32_t flags; | |
43 | #define ZD_DPDK_PORT_FLAG_PROBED (1 << 0) | |
44 | #define ZD_DPDK_PORT_FLAG_INITED (1 << 1) | |
45 | }; | |
46 | ||
36c3b296 AK |
47 | struct zd_dpdk_stat { |
48 | _Atomic uint32_t ignored_updates; | |
49 | ||
50 | _Atomic uint32_t rule_adds; | |
51 | _Atomic uint32_t rule_dels; | |
52 | }; | |
53 | ||
54 | struct zd_dpdk_ctx { | |
55 | /* Stats */ | |
56 | struct zd_dpdk_stat stats; | |
a66d6246 | 57 | struct zd_dpdk_port *dpdk_ports; |
36c3b296 AK |
58 | int dpdk_logtype; |
59 | }; | |
60 | ||
61 | #endif |