l2_output: fix packet drop error reporting when mapping is in progress 93/3093/2
authorDamjan Marion <damarion@cisco.com>
Thu, 22 Sep 2016 14:37:29 +0000 (16:37 +0200)
committerJohn Lo <loj@cisco.com>
Thu, 22 Sep 2016 22:47:34 +0000 (22:47 +0000)
Change-Id: I64aa4c28e87e82a742313e9b89409c957fa62101
Signed-off-by: Damjan Marion <damarion@cisco.com>
vnet/vnet/l2/l2_output.h

index 0aabbc0..6a846f3 100644 (file)
@@ -123,7 +123,8 @@ _(L2OUTPUT,     "L2 output packets")                        \
 _(EFP_DROP,     "L2 EFP filter pre-rewrite drops")     \
 _(VTR_DROP,     "L2 output tag rewrite drops")         \
 _(SHG_DROP,     "L2 split horizon drops")              \
-_(DROP,         "L2 output drops")
+_(DROP,         "L2 output drops")                     \
+_(MAPPING_DROP, "L2 Output interface mapping in progress")
 
 typedef enum
 {
@@ -245,6 +246,15 @@ l2_output_dispatch (vlib_main_t * vlib_main,
                                             sw_if_index,
                                             &next_nodes->output_node_index_vec);
 
+         if (*next0 == L2OUTPUT_NEXT_DROP)
+           {
+             vnet_hw_interface_t *hw0;
+             hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index);
+
+             if (hw0->flags & VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED)
+               b0->error = node->errors[L2OUTPUT_ERROR_MAPPING_DROP];
+           }
+
          /* Update the one-entry cache */
          *cached_sw_if_index = sw_if_index;
          *cached_next_index = *next0;