bonding: support custom interface IDs
[vpp.git] / src / vnet / policer / node_funcs.c
index 25cb420..7e7e131 100644 (file)
@@ -22,6 +22,8 @@
 #include <vnet/ip/ip.h>
 #include <vnet/classify/policer_classify.h>
 #include <vnet/classify/vnet_classify.h>
+#include <vnet/l2/feat_bitmap.h>
+#include <vnet/l2/l2_input.h>
 
 
 /* Dispatch functions meant to be instantiated elsewhere */
@@ -490,7 +492,7 @@ format_policer_classify_trace (u8 * s, va_list * args)
 #define foreach_policer_classify_error                 \
 _(MISS, "Policer classify misses")                     \
 _(HIT, "Policer classify hits")                        \
-_(CHAIN_HIT, "Polcier classify hits after chain walk") \
+_(CHAIN_HIT, "Policer classify hits after chain walk") \
 _(DROP, "Policer classify action drop")
 
 typedef enum
@@ -521,7 +523,6 @@ policer_classify_inline (vlib_main_t * vm,
   u32 hits = 0;
   u32 misses = 0;
   u32 chain_hits = 0;
-  u32 drop = 0;
   u32 n_next_nodes;
   u64 time_in_policer_periods;
 
@@ -707,7 +708,6 @@ policer_classify_inline (vlib_main_t * vm,
                    {
                      next0 = POLICER_CLASSIFY_NEXT_INDEX_DROP;
                      b0->error = node->errors[POLICER_CLASSIFY_ERROR_DROP];
-                     drop++;
                    }
                  hits++;
                }
@@ -743,7 +743,6 @@ policer_classify_inline (vlib_main_t * vm,
                              next0 = POLICER_CLASSIFY_NEXT_INDEX_DROP;
                              b0->error =
                                node->errors[POLICER_CLASSIFY_ERROR_DROP];
-                             drop++;
                            }
                          hits++;
                          chain_hits++;
@@ -778,8 +777,6 @@ policer_classify_inline (vlib_main_t * vm,
                               POLICER_CLASSIFY_ERROR_HIT, hits);
   vlib_node_increment_counter (vm, node->node_index,
                               POLICER_CLASSIFY_ERROR_CHAIN_HIT, chain_hits);
-  vlib_node_increment_counter (vm, node->node_index,
-                              POLICER_CLASSIFY_ERROR_DROP, drop);
 
   return frame->n_vectors;
 }
@@ -841,19 +838,22 @@ l2_policer_classify (vlib_main_t * vm,
   return policer_classify_inline (vm, node, frame, POLICER_CLASSIFY_TABLE_L2);
 }
 
-VLIB_REGISTER_NODE (l2_policer_classify_node) =
-{
-  .function = l2_policer_classify,.name = "l2-policer-classify",.vector_size =
-    sizeof (u32),.format_trace = format_policer_classify_trace,.n_errors =
-    ARRAY_LEN (policer_classify_error_strings),.error_strings =
-    policer_classify_error_strings,.n_next_nodes =
-    POLICER_CLASSIFY_NEXT_INDEX_N_NEXT,.next_nodes =
-  {
-  [POLICER_CLASSIFY_NEXT_INDEX_DROP] = "error-drop",}
-,};
+/* *INDENT-OFF* */
+VLIB_REGISTER_NODE (l2_policer_classify_node) = {
+  .function = l2_policer_classify,
+  .name = "l2-policer-classify",
+  .vector_size = sizeof (u32),
+  .format_trace = format_policer_classify_trace,
+  .n_errors = ARRAY_LEN (policer_classify_error_strings),
+  .error_strings = policer_classify_error_strings,
+  .n_next_nodes = POLICER_CLASSIFY_NEXT_INDEX_N_NEXT,
+  .next_nodes = {
+    [POLICER_CLASSIFY_NEXT_INDEX_DROP] = "error-drop",
+  },
+};
 
 VLIB_NODE_FUNCTION_MULTIARCH (l2_policer_classify_node, l2_policer_classify);
-
+/* *INDENT-ON* */
 
 static clib_error_t *
 policer_classify_init (vlib_main_t * vm)