summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_output.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-10-02 19:36:57 +0200
committerDave Barach <openvpp@barachs.net>2020-11-09 11:51:34 +0000
commit9a3973e3a36bfd4dd8dbffe130a92649fc1b73d3 (patch)
tree1ed9e9c7a3b13edd68f7e78d66dbb995cbe79a2a /src/vnet/interface_output.c
parentf6b02e0d0bfd7e0f1d79e8ee426f48ca37ae5ff3 (diff)
vlib: fix trace number accounting
When using classifier to filter traces, not all packets will be traced. In that case, we should only count traced packets. Type: fix Change-Id: I87d1e217b580ebff8c6ade7860eb43950420ae78 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/interface_output.c')
-rw-r--r--src/vnet/interface_output.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 52c07accc4a..65bc4a4b7ec 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -800,19 +800,21 @@ interface_drop_punt (vlib_main_t * vm,
node->flags |= VLIB_NODE_FLAG_TRACE;
while (n_trace && n_left)
{
- vlib_trace_buffer (vm, node, 0 /* next_index */ ,
- b[0], 0 /* follow chain */ );
- /*
- * Here we have a wireshark dissector problem.
- * Packets may be well-formed, or not. We
- * must not blow chunks in any case.
- *
- * Try to produce trace records which will help
- * folks understand what's going on.
- */
- drop_catchup_trace (vm, node, b[0]);
-
- n_trace--;
+ if (PREDICT_TRUE
+ (vlib_trace_buffer (vm, node, 0 /* next_index */ , b[0],
+ 0 /* follow chain */ )))
+ {
+ /*
+ * Here we have a wireshark dissector problem.
+ * Packets may be well-formed, or not. We
+ * must not blow chunks in any case.
+ *
+ * Try to produce trace records which will help
+ * folks understand what's going on.
+ */
+ drop_catchup_trace (vm, node, b[0]);
+ n_trace--;
+ }
n_left--;
b++;
}