diff options
author | Damjan Marion <damarion@cisco.com> | 2016-11-18 11:41:37 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2016-11-18 11:56:33 +0000 |
commit | 4015b1958675eeae464fdfc5ff2b2046b6e745a7 (patch) | |
tree | ec05b4e41888f400aa4cb35c19a5e4327ecf9f0f /vnet | |
parent | 36806d18e8f2cc96fa8bc6ed3de7d5dfa1c274a5 (diff) |
dpdk: maintain per-worker trace buffer
Change-Id: I8234054cef4cadada6745a8c00c8df2c20daac33
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-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 ad973323..b970d4a5 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 e014506b..7ca3dede 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 ed92bdee..fa894039 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 |