From f974794e2e47ad2dfa244c2c2408d503e9120e2b Mon Sep 17 00:00:00 2001 From: Wei CHEN Date: Wed, 26 Jun 2019 11:01:15 +0800 Subject: interface: fix issue that pcap rx/tx trace not available when there are worker threads Type: fix Change-Id: Ie9a3a78b45b53344a0a5d7e2027c0e0354a49ebe Signed-off-by: Wei CHEN --- src/vnet/ethernet/node.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/vnet/ethernet/node.c') diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c index eabcf42812c..4640540ac2b 100755 --- a/src/vnet/ethernet/node.c +++ b/src/vnet/ethernet/node.c @@ -990,7 +990,7 @@ ethernet_input_trace (vlib_main_t * vm, vlib_node_runtime_t * node, } /* rx pcap capture if enabled */ - if (PREDICT_FALSE (vm->pcap[VLIB_RX].pcap_enable)) + if (PREDICT_FALSE (vlib_global_main.pcap[VLIB_RX].pcap_enable)) { u32 bi0; @@ -1003,11 +1003,12 @@ ethernet_input_trace (vlib_main_t * vm, vlib_node_runtime_t * node, from++; b0 = vlib_get_buffer (vm, bi0); - if (vm->pcap[VLIB_RX].pcap_sw_if_index == 0 || - vm->pcap[VLIB_RX].pcap_sw_if_index + if (vlib_global_main.pcap[VLIB_RX].pcap_sw_if_index == 0 || + vlib_global_main.pcap[VLIB_RX].pcap_sw_if_index == vnet_buffer (b0)->sw_if_index[VLIB_RX]) { - pcap_add_buffer (&vm->pcap[VLIB_RX].pcap_main, vm, bi0, 512); + pcap_add_buffer (&vlib_global_main.pcap[VLIB_RX].pcap_main, vm, + bi0, 512); } n_left--; } -- cgit 1.2.3-korg