nat: added handoff trace index for easier trace match 12/20612/7
authorFilip Varga <fivarga@cisco.com>
Thu, 11 Jul 2019 16:08:43 +0000 (12:08 -0400)
committerDave Barach <openvpp@barachs.net>
Fri, 12 Jul 2019 12:27:32 +0000 (12:27 +0000)
Type: feature

Change-Id: Id818f86164acabcb732e9a65d0e284d68e747a7b
Signed-off-by: Filip Varga <fivarga@cisco.com>
src/plugins/nat/nat44_handoff.c

index 2a8404d..e4cb483 100644 (file)
@@ -27,6 +27,7 @@
 typedef struct
 {
   u32 next_worker_index;
+  u32 trace_index;
   u8 in2out;
 } nat44_handoff_trace_t;
 
@@ -60,8 +61,8 @@ format_nat44_handoff_trace (u8 * s, va_list * args)
 
   tag = t->in2out ? "IN2OUT" : "OUT2IN";
   s =
-    format (s, "NAT44_%s_WORKER_HANDOFF: next-worker %d", tag,
-           t->next_worker_index);
+    format (s, "NAT44_%s_WORKER_HANDOFF: next-worker %d trace index %d", tag,
+           t->next_worker_index, t->trace_index);
 
   return s;
 }
@@ -125,6 +126,7 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          nat44_handoff_trace_t *t =
            vlib_add_trace (vm, node, b[0], sizeof (*t));
          t->next_worker_index = ti[0];
+         t->trace_index = vlib_buffer_get_trace_index (b[0]);
          t->in2out = is_in2out;
        }