dpdk: Decoupling the meaning of xd->device_index in dpdk_plugin
[vpp.git] / src / plugins / dpdk / device / dpdk.h
index eed1126..b447e71 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>
@@ -81,7 +83,8 @@ extern vlib_node_registration_t dpdk_input_node;
   _ ("net_virtio_user", VIRTIO_USER) \
   _ ("net_vhost", VHOST_ETHER)    \
   _ ("net_ena", ENA)              \
-  _ ("net_failsafe", FAILSAFE)
+  _ ("net_failsafe", FAILSAFE)    \
+  _ ("net_liovf", LIOVF_ETHER)
 
 typedef enum
 {
@@ -190,9 +193,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;
 
@@ -232,7 +238,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 */
@@ -378,6 +385,15 @@ typedef struct
   vlib_buffer_t buffer_template;
 } dpdk_per_thread_data_t;
 
+typedef struct
+{
+  int pcap_enable;
+  pcap_main_t pcap_main;
+  u8 *pcap_filename;
+  u32 pcap_sw_if_index;
+  u32 pcap_pkts_to_capture;
+} dpdk_pcap_t;
+
 typedef struct
 {
 
@@ -392,8 +408,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;