diff options
-rw-r--r-- | vnet/vnet/devices/dpdk/dpdk.h | 2 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/init.c | 3 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/node.c | 12 |
3 files changed, 10 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h index ad973323359..b970d4a5f50 100644 --- a/vnet/vnet/devices/dpdk/dpdk.h +++ b/vnet/vnet/devices/dpdk/dpdk.h @@ -183,7 +183,7 @@ typedef struct struct rte_mbuf ***rx_vectors; /* vector of traced contexts, per device */ - u32 *d_trace_buffers; + u32 **d_trace_buffers; dpdk_pmd_t pmd:8; i8 cpu_socket; diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c index e014506b9e8..7ca3dedeee3 100644 --- a/vnet/vnet/devices/dpdk/init.c +++ b/vnet/vnet/devices/dpdk/init.c @@ -731,6 +731,9 @@ dpdk_lib_init (dpdk_main_t * dm) vec_reset_length (xd->rx_vectors[j]); } + vec_validate_aligned (xd->d_trace_buffers, tm->n_vlib_mains, + CLIB_CACHE_LINE_BYTES); + rv = dpdk_port_setup (dm, xd); if (rv) diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c index ed92bdeef52..fa89403938c 100644 --- a/vnet/vnet/devices/dpdk/node.c +++ b/vnet/vnet/devices/dpdk/node.c @@ -241,7 +241,7 @@ dpdk_device_input (dpdk_main_t * dm, buffer_flags_template = dm->buffer_flags_template; - vec_reset_length (xd->d_trace_buffers); + vec_reset_length (xd->d_trace_buffers[cpu_index]); trace_cnt = n_trace = vlib_get_trace_count (vm, node); fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX); @@ -360,19 +360,19 @@ dpdk_device_input (dpdk_main_t * dm, to_next, n_left_to_next, bi0, next0); if (PREDICT_FALSE (n_trace > mb_index)) - vec_add1 (xd->d_trace_buffers, bi0); + vec_add1 (xd->d_trace_buffers[cpu_index], bi0); n_buffers--; mb_index++; } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } - if (PREDICT_FALSE (vec_len (xd->d_trace_buffers) > 0)) + if (PREDICT_FALSE (vec_len (xd->d_trace_buffers[cpu_index]) > 0)) { - dpdk_rx_trace (dm, node, xd, queue_id, xd->d_trace_buffers, - vec_len (xd->d_trace_buffers)); + dpdk_rx_trace (dm, node, xd, queue_id, xd->d_trace_buffers[cpu_index], + vec_len (xd->d_trace_buffers[cpu_index])); vlib_set_trace_count (vm, node, - n_trace - vec_len (xd->d_trace_buffers)); + n_trace - vec_len (xd->d_trace_buffers[cpu_index])); } vlib_increment_combined_counter |