summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/dpdk.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-01-09 13:13:13 +0100
committerFlorin Coras <florin.coras@gmail.com>2022-01-09 20:32:54 +0000
commit71635fda0dcbbb21ec3eb7af9618eb51513b8ab8 (patch)
tree3dd1d270896117200896ee856ed7813464119e2f /src/plugins/dpdk/device/dpdk.h
parent9d33cfc0bc1928f0b4c8aa95c170cf91ee8011a0 (diff)
dpdk: port type code cleanup
Type: improvement Change-Id: I4ead18dee249a27b4dbb8bbf53b6238d91042890 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/dpdk.h')
-rw-r--r--src/plugins/dpdk/device/dpdk.h45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index ff2bf6f9c50..4981d250ea6 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -90,26 +90,32 @@ typedef enum
VNET_DPDK_PMD_UNKNOWN, /* must be last */
} dpdk_pmd_t;
+#define forach_dpdk_port_type \
+ _ (ETH_1G, "GigabitEthernet") \
+ _ (ETH_2_5G, "Two_FiveGigabitEthernet") \
+ _ (ETH_5G, "FiveGigabitEthernet") \
+ _ (ETH_10G, "TenGigabitEthernet") \
+ _ (ETH_20G, "TwentyGigabitEthernet") \
+ _ (ETH_25G, "TwentyFiveGigabitEthernet") \
+ _ (ETH_40G, "FortyGigabitEthernet") \
+ _ (ETH_50G, "FiftyGigabitEthernet") \
+ _ (ETH_56G, "FiftySixGigabitEthernet") \
+ _ (ETH_100G, "HundredGigabitEthernet") \
+ _ (ETH_200G, "TwoHundredGigabitEthernet") \
+ _ (ETH_SWITCH, "EthernetSwitch") \
+ _ (ETH_VF, "VirtualFunctionEthernet") \
+ _ (AF_PACKET, "af_packet") \
+ _ (VIRTIO_USER, "VirtioUser") \
+ _ (VHOST_ETHER, "VhostEthernet") \
+ _ (FAILSAFE, "FailsafeEthernet") \
+ _ (NETVSC, "NetVSC")
+
typedef enum
{
- VNET_DPDK_PORT_TYPE_ETH_1G,
- VNET_DPDK_PORT_TYPE_ETH_2_5G,
- VNET_DPDK_PORT_TYPE_ETH_5G,
- VNET_DPDK_PORT_TYPE_ETH_10G,
- VNET_DPDK_PORT_TYPE_ETH_20G,
- VNET_DPDK_PORT_TYPE_ETH_25G,
- VNET_DPDK_PORT_TYPE_ETH_40G,
- VNET_DPDK_PORT_TYPE_ETH_50G,
- VNET_DPDK_PORT_TYPE_ETH_56G,
- VNET_DPDK_PORT_TYPE_ETH_100G,
- VNET_DPDK_PORT_TYPE_ETH_SWITCH,
- VNET_DPDK_PORT_TYPE_AF_PACKET,
- VNET_DPDK_PORT_TYPE_ETH_VF,
- VNET_DPDK_PORT_TYPE_VIRTIO_USER,
- VNET_DPDK_PORT_TYPE_VHOST_ETHER,
- VNET_DPDK_PORT_TYPE_FAILSAFE,
- VNET_DPDK_PORT_TYPE_NETVSC,
- VNET_DPDK_PORT_TYPE_UNKNOWN,
+ VNET_DPDK_PORT_TYPE_UNKNOWN = 0,
+#define _(n, s) VNET_DPDK_PORT_TYPE_##n,
+ forach_dpdk_port_type
+#undef _
} dpdk_port_type_t;
typedef uint16_t dpdk_portid_t;
@@ -225,9 +231,6 @@ typedef struct
u32 parked_loop_count;
struct rte_flow_error last_flow_error;
- /* af_packet instance number */
- u16 af_packet_instance_num;
-
struct rte_eth_link link;
f64 time_last_link_update;