Clean up dpdk plugin rx/tx pcap tracing
[vpp.git] / src / plugins / dpdk / device / dpdk.h
index e1966e4..2a37947 100644 (file)
@@ -18,6 +18,8 @@
 /* $$$$ We should rename always_inline -> clib_always_inline */
 #undef always_inline
 
+#define ALLOW_EXPERIMENTAL_API
+
 #include <rte_config.h>
 
 #include <rte_common.h>
@@ -80,7 +82,10 @@ extern vlib_node_registration_t dpdk_input_node;
   _ ("net_dpaa2", DPAA2)          \
   _ ("net_virtio_user", VIRTIO_USER) \
   _ ("net_vhost", VHOST_ETHER)    \
-  _ ("net_ena", ENA)
+  _ ("net_ena", ENA)              \
+  _ ("net_failsafe", FAILSAFE)    \
+  _ ("net_liovf", LIOVF_ETHER)    \
+  _ ("net_qede", QEDE)
 
 typedef enum
 {
@@ -109,6 +114,7 @@ typedef enum
   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_UNKNOWN,
 } dpdk_port_type_t;
 
@@ -188,9 +194,12 @@ typedef struct
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
   volatile u32 **lockp;
 
-  /* Instance ID */
+  /* Instance ID to access internal device array. */
   dpdk_portid_t device_index;
 
+  /* DPDK device port number */
+  dpdk_portid_t port_id;
+
   u32 hw_if_index;
   u32 sw_if_index;
 
@@ -222,7 +231,9 @@ typedef struct
   /* flow related */
   u32 supported_flow_actions;
   dpdk_flow_entry_t *flow_entries;     /* pool */
-  dpdk_flow_lookup_entry_t *flow_lookup_entries;       /* vector */
+  dpdk_flow_lookup_entry_t *flow_lookup_entries;       /* pool */
+  u32 *parked_lookup_indexes;  /* vector */
+  u32 parked_loop_count;
   struct rte_flow_error last_flow_error;
 
   /* HQoS related */
@@ -230,7 +241,8 @@ typedef struct
   dpdk_device_hqos_per_hqos_thread_t *hqos_ht;
 
   /* af_packet or BondEthernet instance number */
-  dpdk_portid_t port_id;
+  u16 af_packet_instance_num;
+  u16 bond_instance_num;
 
   /* Bonded interface port# of a slave -
      only valid if DPDK_DEVICE_FLAG_BOND_SLAVE bit is set */
@@ -376,6 +388,13 @@ typedef struct
   vlib_buffer_t buffer_template;
 } dpdk_per_thread_data_t;
 
+typedef struct
+{
+  int pcap_enable;
+  u32 pcap_sw_if_index;
+  pcap_main_t pcap_main;
+} dpdk_pcap_t;
+
 typedef struct
 {
 
@@ -390,8 +409,10 @@ typedef struct
   /* buffer flags template, configurable to enable/disable tcp / udp cksum */
   u32 buffer_flags_template;
 
-  /* pcap tracing [only works if (CLIB_DEBUG > 0)] */
-  int tx_pcap_enable;
+  /* pcap tracing */
+  dpdk_pcap_t pcap[VLIB_N_RX_TX];
+
+  int pcap_enable;
   pcap_main_t pcap_main;
   u8 *pcap_filename;
   u32 pcap_sw_if_index;
@@ -411,9 +432,6 @@ typedef struct
   f64 link_state_poll_interval;
   f64 stat_poll_interval;
 
-  /* Sleep for this many usec after each device poll */
-  u32 poll_sleep_usec;
-
   /* convenience */
   vlib_main_t *vlib_main;
   vnet_main_t *vnet_main;