dpdk: print device flags in the 'show hardware' output
[vpp.git] / src / plugins / dpdk / device / dpdk.h
index 51ead04..d52e966 100644 (file)
@@ -39,9 +39,7 @@
 #include <rte_eth_bond.h>
 #include <rte_sched.h>
 #include <rte_net.h>
-#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 0)
 #include <rte_bus_pci.h>
-#endif
 
 #include <vnet/unix/pcap.h>
 #include <vnet/devices/devices.h>
@@ -79,7 +77,8 @@ extern vlib_node_registration_t dpdk_input_node;
   _ ("net_mlx5", MLX5)            \
   _ ("net_dpaa2", DPAA2)          \
   _ ("net_virtio_user", VIRTIO_USER) \
-  _ ("net_vhost", VHOST_ETHER)
+  _ ("net_vhost", VHOST_ETHER)    \
+  _ ("net_ena", ENA)
 
 typedef enum
 {
@@ -93,10 +92,14 @@ typedef enum
 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_BOND,
   VNET_DPDK_PORT_TYPE_ETH_SWITCH,
@@ -118,11 +121,7 @@ typedef struct
   u64 tx_tail;
 } tx_ring_hdr_t;
 
-#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0)
-typedef uint8_t dpdk_portid_t;
-#else
 typedef uint16_t dpdk_portid_t;
-#endif
 
 typedef struct
 {
@@ -153,6 +152,26 @@ typedef struct
   u32 flush_count;
 } dpdk_device_hqos_per_hqos_thread_t;
 
+#define foreach_dpdk_device_flags \
+  _( 0, ADMIN_UP, "admin-up") \
+  _( 1, PROMISC, "promisc") \
+  _( 2, PMD, "pmd") \
+  _( 3, PMD_INIT_FAIL, "pmd-init-fail") \
+  _( 4, MAYBE_MULTISEG, "maybe-multiseg") \
+  _( 5, HAVE_SUBIF, "subif") \
+  _( 6, HQOS, "hqos") \
+  _( 7, BOND_SLAVE, "bond-slave") \
+  _( 8, BOND_SLAVE_UP, "bond-slave-up") \
+  _( 9, TX_OFFLOAD, "tx-offload") \
+  _(10, INTEL_PHDR_CKSUM, "intel-phdr-cksum") \
+
+enum
+{
+#define _(a, b, c) DPDK_DEVICE_FLAG_##b = (1 << a),
+  foreach_dpdk_device_flags
+#undef _
+};
+
 typedef struct
 {
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -171,24 +190,10 @@ typedef struct
   struct rte_mbuf ***tx_vectors;       /* one per worker thread */
   struct rte_mbuf ***rx_vectors;
 
-  /* vector of traced contexts, per device */
-  u32 **d_trace_buffers;
-
   dpdk_pmd_t pmd:8;
   i8 cpu_socket;
 
   u16 flags;
-#define DPDK_DEVICE_FLAG_ADMIN_UP           (1 << 0)
-#define DPDK_DEVICE_FLAG_PROMISC            (1 << 1)
-#define DPDK_DEVICE_FLAG_PMD                (1 << 2)
-#define DPDK_DEVICE_FLAG_PMD_INIT_FAIL      (1 << 3)
-#define DPDK_DEVICE_FLAG_MAYBE_MULTISEG     (1 << 4)
-#define DPDK_DEVICE_FLAG_HAVE_SUBIF         (1 << 5)
-#define DPDK_DEVICE_FLAG_HQOS               (1 << 6)
-#define DPDK_DEVICE_FLAG_BOND_SLAVE         (1 << 7)
-#define DPDK_DEVICE_FLAG_BOND_SLAVE_UP      (1 << 8)
-#define DPDK_DEVICE_FLAG_TX_OFFLOAD         (1 << 9)
-#define DPDK_DEVICE_FLAG_INTEL_PHDR_CKSUM   (1 << 10)
 
   u16 nb_tx_desc;
     CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
@@ -361,9 +366,6 @@ typedef struct
   /* buffer flags template, configurable to enable/disable tcp / udp cksum */
   u32 buffer_flags_template;
 
-  /* vlib buffer free list, must be same size as an rte_mbuf */
-  u32 vlib_buffer_free_list_index;
-
   /* pcap tracing [only works if (CLIB_DEBUG > 0)] */
   int tx_pcap_enable;
   pcap_main_t pcap_main;