X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fdpdk%2Fdevice%2Fdpdk.h;h=f02e718dc9ca0ddf2f543466d8726780280b2eb8;hb=eb987d3a09f669787014b1553f032219522149e1;hp=896617bd55f955f826f201e892037e6e8393488f;hpb=5b6ae8de4fd0d7855f8f38426dd4524ebcb15fee;p=vpp.git diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 896617bd55f..f02e718dc9c 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -125,6 +125,9 @@ typedef uint16_t dpdk_portid_t; typedef struct { + /* Required for vec_validate_aligned */ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + struct rte_ring *swq; u64 hqos_field0_slabmask; @@ -141,6 +144,8 @@ typedef struct typedef struct { + /* Required for vec_validate_aligned */ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); struct rte_ring **swq; struct rte_mbuf **pkts_enq; struct rte_mbuf **pkts_deq; @@ -181,14 +186,13 @@ typedef struct dpdk_portid_t device_index; u32 hw_if_index; - u32 vlib_sw_if_index; + u32 sw_if_index; /* next node index if we decide to steal the rx graph arc */ u32 per_interface_next_index; /* dpdk rte_mbuf rx and tx vectors, VLIB_FRAME_SIZE */ struct rte_mbuf ***tx_vectors; /* one per worker thread */ - struct rte_mbuf ***rx_vectors; dpdk_pmd_t pmd:8; i8 cpu_socket; @@ -350,19 +354,30 @@ typedef struct extern dpdk_config_main_t dpdk_config_main; +#define DPDK_RX_BURST_SZ VLIB_FRAME_SIZE + +typedef struct +{ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + struct rte_mbuf *mbufs[DPDK_RX_BURST_SZ]; + u32 buffers[DPDK_RX_BURST_SZ]; + u16 next[DPDK_RX_BURST_SZ]; + u16 etype[DPDK_RX_BURST_SZ]; + u8 flags[DPDK_RX_BURST_SZ]; + vlib_buffer_t buffer_template; +} dpdk_per_thread_data_t; + typedef struct { /* Devices */ dpdk_device_t *devices; dpdk_device_and_queue_t **devices_by_hqos_cpu; + dpdk_per_thread_data_t *per_thread_data; /* per-thread recycle lists */ u32 **recycle; - /* per-thread buffer templates */ - vlib_buffer_t *buffer_templates; - /* buffer flags template, configurable to enable/disable tcp / udp cksum */ u32 buffer_flags_template; @@ -416,7 +431,7 @@ typedef struct /* Copy of VLIB buffer; packet data stored in pre_data. */ vlib_buffer_t buffer; u8 data[256]; /* First 256 data bytes, used for hexdump */ -} dpdk_tx_dma_trace_t; +} dpdk_tx_trace_t; typedef struct { @@ -426,7 +441,7 @@ typedef struct struct rte_mbuf mb; vlib_buffer_t buffer; /* Copy of VLIB buffer; pkt data stored in pre_data. */ u8 data[256]; /* First 256 data bytes, used for hexdump */ -} dpdk_rx_dma_trace_t; +} dpdk_rx_trace_t; void dpdk_device_setup (dpdk_device_t * xd); void dpdk_device_start (dpdk_device_t * xd); @@ -467,8 +482,8 @@ void dpdk_update_link_state (dpdk_device_t * xd, f64 now); format_function_t format_dpdk_device_name; format_function_t format_dpdk_device; format_function_t format_dpdk_device_errors; -format_function_t format_dpdk_tx_dma_trace; -format_function_t format_dpdk_rx_dma_trace; +format_function_t format_dpdk_tx_trace; +format_function_t format_dpdk_rx_trace; format_function_t format_dpdk_rte_mbuf; format_function_t format_dpdk_rx_rte_mbuf; unformat_function_t unformat_dpdk_log_level;