nat: remove non-error error counters
[vpp.git] / src / plugins / nat / nat66 / nat66_out2in.c
index 563ad6f..9d44b48 100644 (file)
@@ -42,7 +42,6 @@ format_nat66_out2in_trace (u8 * s, va_list * args)
 }
 
 #define foreach_nat66_out2in_error                       \
-_(OUT2IN_PACKETS, "good out2in packets processed")       \
 _(NO_TRANSLATION, "no translation")                      \
 _(UNKNOWN, "unknown")
 
@@ -73,7 +72,6 @@ VLIB_NODE_FN (nat66_out2in_node) (vlib_main_t * vm,
 {
   u32 n_left_from, *from, *to_next;
   nat66_out2in_next_t next_index;
-  u32 pkts_processed = 0;
   u32 thread_index = vm->thread_index;
   nat66_main_t *nm = &nat66_main;
 
@@ -179,7 +177,11 @@ VLIB_NODE_FN (nat66_out2in_node) (vlib_main_t * vm,
              t->next_index = next0;
            }
 
-         pkts_processed += next0 != NAT66_OUT2IN_NEXT_DROP;
+         if (next0 != NAT66_OUT2IN_NEXT_DROP)
+           {
+             vlib_increment_simple_counter (&nm->out2in_packets,
+                                            thread_index, sw_if_index0, 1);
+           }
 
          /* verify speculative enqueue, maybe switch current next frame */
          vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
@@ -188,9 +190,6 @@ VLIB_NODE_FN (nat66_out2in_node) (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
     }
 
-  vlib_node_increment_counter (vm, nm->out2in_node_index,
-                              NAT66_OUT2IN_ERROR_OUT2IN_PACKETS,
-                              pkts_processed);
   return frame->n_vectors;
 }