Add custom mac address option to vhost interfaces.
[vpp.git] / vnet / vnet / devices / dpdk / dpdk.h
index fd984e4..3e287a9 100644 (file)
@@ -75,6 +75,7 @@ typedef enum {
 } dpdk_device_type_t;
 
 #define foreach_dpdk_pmd          \
+  _ ("rte_nicvf_pmd", THUNDERX)          \
   _ ("rte_em_pmd", E1000EM)       \
   _ ("rte_igb_pmd", IGB)          \
   _ ("rte_igbvf_pmd", IGBVF)      \
@@ -87,7 +88,8 @@ typedef enum {
   _ ("rte_enic_pmd", ENIC)        \
   _ ("rte_vmxnet3_pmd", VMXNET3)  \
   _ ("AF_PACKET PMD", AF_PACKET)  \
-  _ ("rte_pmd_fm10k", FM10K)
+  _ ("rte_pmd_fm10k", FM10K)      \
+  _ ("rte_cxgbe_pmd", CXGBE)
 
 typedef enum {
   VNET_DPDK_PMD_NONE,
@@ -135,6 +137,9 @@ typedef struct {
   int callfd;
   int kickfd;
   int errfd;
+#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
+  int enabled;
+#endif
   u32 callfd_idx;
   u32 n_since_last_int;
   f64 int_deadline;
@@ -152,7 +157,11 @@ typedef struct {
 
   u64 feature_mask;
   u32 num_vrings;
+#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
+  dpdk_vu_vring vrings[VHOST_MAX_QUEUE_PAIRS * 2];
+#else
   dpdk_vu_vring vrings[2];
+#endif
   u64 region_addr[VHOST_MEMORY_MAX_NREGIONS];
   u32 region_fd[VHOST_MEMORY_MAX_NREGIONS];
 } dpdk_vu_intf_t;
@@ -173,7 +182,7 @@ typedef struct {
 
 typedef struct {
   CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
-  volatile u32 *lockp;
+  volatile u32 **lockp;
 
   /* Instance ID */
   u32 device_index;
@@ -292,6 +301,9 @@ typedef struct {
   /* per-thread recycle lists */
   u32 ** recycle;
 
+  /* buffer flags template, configurable to enable/disable tcp / udp cksum */
+  u32 buffer_flags_template;
+
   /* flow control callback. If 0 then flow control is disabled */
   dpdk_flowcontrol_callback_t flowcontrol_callback;
 
@@ -310,6 +322,7 @@ typedef struct {
 
   /* Config stuff */
   u8 ** eal_init_args;
+  u8 * eal_init_args_str;
   u8 * eth_if_blacklist;
   u8 * eth_if_whitelist;
   u8 * uio_driver_name;
@@ -322,6 +335,7 @@ typedef struct {
   u32 nchannels;
   u32 num_mbufs;
   u32 use_rss;
+  u32 max_tx_queues;
   u8 num_kni; /* while kni_init allows u32, port_id in callback fn is only u8 */
 
   /* Ethernet input node index */
@@ -443,6 +457,8 @@ void increment_efd_drop_counter (vlib_main_t * vm, u32 counter_index, u32 count)
 }
 
 void dpdk_update_link_state (dpdk_device_t * xd, f64 now);
+void dpdk_device_lock_init(dpdk_device_t * xd);
+void dpdk_device_lock_free(dpdk_device_t * xd);
 void dpdk_efd_update_counters(dpdk_device_t *xd, u32 n_buffers, u16 enabled);
 u32 is_efd_discardable(vlib_thread_main_t *tm,
                        vlib_buffer_t * b0,
@@ -495,7 +511,8 @@ int dpdk_vhost_user_create_if (vnet_main_t * vnm, vlib_main_t * vm,
                               u8 is_server,
                               u32 * sw_if_index,
                               u64 feature_mask,
-                              u8 renumber, u32 custom_dev_instance);
+                              u8 renumber, u32 custom_dev_instance,
+                              u8 *hwaddr);
 int dpdk_vhost_user_modify_if (vnet_main_t * vnm, vlib_main_t * vm,
                               const char * sock_filename,
                               u8 is_server,