summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.c
diff options
context:
space:
mode:
authorDave Barach <dbarach@cisco.com>2018-05-25 17:36:05 -0400
committerDave Barach <dbarach@cisco.com>2018-05-25 17:36:44 -0400
commitc6f186b23d00685b3e9f132ba79a5cb44f0a44c0 (patch)
treecddcc7b7831e61f0f5d7b008a7ca1ae80e14f280 /src/plugins/dpdk/device/device.c
parentc65770deebf63d34cc09c6aa3af7c86b3affb4b8 (diff)
Add interface rx pcap tracing
Should cost at most 1 clock per frame when not enabled. Add "pcap rx trace..." debug CLI, refactored "pcap tx trace" debug CLI to avoid duplicating code. Change-Id: I19ac75d1cf94a6a24c98facbf0753381d37963ea Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/device.c')
-rw-r--r--src/plugins/dpdk/device/device.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 0ac798fa704..5409fe4f50e 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -351,16 +351,17 @@ CLIB_MULTIARCH_FN (dpdk_interface_tx) (vlib_main_t * vm,
ASSERT (n_packets <= VLIB_FRAME_SIZE);
/* TX PCAP tracing */
- if (PREDICT_FALSE (dm->tx_pcap_enable))
+ if (PREDICT_FALSE (dm->pcap[VLIB_TX].pcap_enable))
{
n_left = n_packets;
while (n_left > 0)
{
u32 bi0 = from[0];
vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
- if (dm->pcap_sw_if_index == 0 ||
- dm->pcap_sw_if_index == vnet_buffer (b0)->sw_if_index[VLIB_TX])
- pcap_add_buffer (&dm->pcap_main, vm, bi0, 512);
+ if (dm->pcap[VLIB_TX].pcap_sw_if_index == 0 ||
+ dm->pcap[VLIB_TX].pcap_sw_if_index
+ == vnet_buffer (b0)->sw_if_index[VLIB_TX])
+ pcap_add_buffer (&dm->pcap[VLIB_TX].pcap_main, vm, bi0, 512);
from++;
n_left--;
}