hs-test: cache docker build in local filesystem
[vpp.git] / src / vnet / ethernet / p2p_ethernet_input.c
index 36845fc..3d81e99 100644 (file)
@@ -119,11 +119,12 @@ VLIB_NODE_FN (p2p_ethernet_input_node) (vlib_main_t * vm,
              vnet_buffer (b0)->sw_if_index[VLIB_RX] = rx0;
              n_p2p_ethernet_packets += 1;
 
-             if (PREDICT_FALSE (n_trace > 0))
+             if (PREDICT_FALSE
+                 (n_trace > 0
+                  && vlib_trace_buffer (vm, node, next_index, b0,
+                                        1 /* follow_chain */ )))
                {
                  p2p_ethernet_trace_t *t0;
-                 vlib_trace_buffer (vm, node, next_index, b0,
-                                    1 /* follow_chain */ );
                  vlib_set_trace_count (vm, node, --n_trace);
                  t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
                  t0->sw_if_index = sw_if_index0;
@@ -140,11 +141,12 @@ VLIB_NODE_FN (p2p_ethernet_input_node) (vlib_main_t * vm,
              vnet_buffer (b1)->sw_if_index[VLIB_RX] = rx1;
              n_p2p_ethernet_packets += 1;
 
-             if (PREDICT_FALSE (n_trace > 0))
+             if (PREDICT_FALSE
+                 (n_trace > 0
+                  && vlib_trace_buffer (vm, node, next_index, b1,
+                                        1 /* follow_chain */ )))
                {
                  p2p_ethernet_trace_t *t1;
-                 vlib_trace_buffer (vm, node, next_index, b1,
-                                    1 /* follow_chain */ );
                  vlib_set_trace_count (vm, node, --n_trace);
                  t1 = vlib_add_trace (vm, node, b1, sizeof (*t1));
                  t1->sw_if_index = sw_if_index1;
@@ -195,11 +197,12 @@ VLIB_NODE_FN (p2p_ethernet_input_node) (vlib_main_t * vm,
              vnet_buffer (b0)->sw_if_index[VLIB_RX] = rx0;
              n_p2p_ethernet_packets += 1;
 
-             if (PREDICT_FALSE (n_trace > 0))
+             if (PREDICT_FALSE
+                 (n_trace > 0
+                  && vlib_trace_buffer (vm, node, next_index, b0,
+                                        1 /* follow_chain */ )))
                {
                  p2p_ethernet_trace_t *t0;
-                 vlib_trace_buffer (vm, node, next_index, b0,
-                                    1 /* follow_chain */ );
                  vlib_set_trace_count (vm, node, --n_trace);
                  t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
                  t0->sw_if_index = sw_if_index0;
@@ -228,15 +231,16 @@ VLIB_NODE_FN (p2p_ethernet_input_node) (vlib_main_t * vm,
 
   vlib_node_increment_counter (vm, p2p_ethernet_input_node.index,
                               P2PE_ERROR_HITS, n_p2p_ethernet_packets);
+
   return frame->n_vectors;
 }
 
-/* *INDENT-OFF* */
 VLIB_REGISTER_NODE (p2p_ethernet_input_node) = {
   .name = "p2p-ethernet-input",
   .vector_size = sizeof (u32),
   .format_trace = format_p2p_ethernet_trace,
   .type = VLIB_NODE_TYPE_INTERNAL,
+  .flags = VLIB_NODE_FLAG_TRACE_SUPPORTED,
 
   .n_errors = ARRAY_LEN(p2p_ethernet_error_strings),
   .error_strings = p2p_ethernet_error_strings,
@@ -248,7 +252,6 @@ VLIB_REGISTER_NODE (p2p_ethernet_input_node) = {
     [0] = "error-drop",
   },
 };
-/* *INDENT-ON* */
 
 /*
  * fd.io coding-style-patch-verification: ON