diff options
author | Bud Grise <griseb@cisco.com> | 2016-03-30 17:00:24 -0400 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-04-28 16:34:59 +0000 |
commit | 1589576c57e4bfb2b81dc5237e0af74130cb908f (patch) | |
tree | 2134188796d401e60b6edf3df8e74dc0aa6c0b41 /vnet | |
parent | 07aecbb46f345e2ca1da1f159d4460d6758f0f19 (diff) |
Fix bug that prevented packet trace from working on multicore
The vlib_node_runtime can change after the thread starts up.
Change-Id: Id5bc248c009ef9be26213b36a0115938b61cb8c4
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/devices/dpdk/node.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c index 3b4b82afbbc..a7590a5c566 100644 --- a/vnet/vnet/devices/dpdk/node.c +++ b/vnet/vnet/devices/dpdk/node.c @@ -1101,7 +1101,7 @@ void dpdk_io_thread (vlib_worker_thread_t * w, u32 num_devices = 0; uword * p; u16 queue_id = 0; - vlib_node_runtime_t * node_trace; + vlib_node_runtime_t * node_trace = 0; u32 first_worker_index = 0; u32 buffer_flags_template; @@ -1145,9 +1145,6 @@ void dpdk_io_thread (vlib_worker_thread_t * w, first_worker_index + num_workers - 1, (vlib_frame_queue_t *)(~0)); - /* packet tracing is triggered on the dpdk-input node for ease-of-use */ - node_trace = vlib_node_get_runtime (vm, dpdk_input_node.index); - buffer_flags_template = dm->buffer_flags_template; /* And handle them... */ @@ -1204,8 +1201,19 @@ void dpdk_io_thread (vlib_worker_thread_t * w, continue; } - vec_reset_length (xd->d_trace_buffers); - trace_cnt = n_trace = vlib_get_trace_count (vm, node_trace); + trace_cnt = n_trace = 0; + if (PREDICT_FALSE(vm->trace_main.trace_active_hint)) + { + /* + * packet tracing is triggered on the dpdk-input node for + * ease-of-use. Re-fetch the node_runtime for dpdk-input + * in case it has changed. + */ + node_trace = vlib_node_get_runtime (vm, dpdk_input_node.index); + + vec_reset_length (xd->d_trace_buffers); + trace_cnt = n_trace = vlib_get_trace_count (vm, node_trace); + } /* * DAW-FIXME: VMXNET3 device stop/start doesn't work, |