VPP-34 GRE traffic blackholes in encap direction 26/1026/1
authorChris Luke <chrisy@flirble.org>
Fri, 6 May 2016 21:09:09 +0000 (17:09 -0400)
committerChris Luke <chrisy@flirble.org>
Fri, 6 May 2016 21:09:09 +0000 (17:09 -0400)
The GRE code is missing the logic to indicate the "hardware" interface
is up. The fix is to listen for admin up/down events on the "software"
interface and reflect that into the hardware interface state.

Change-Id: If06e4f03989b2c52c32f50c11e1943e42bb2609f
Signed-off-by: Chris Luke <chrisy@flirble.org>
vnet/vnet/gre/gre.c

index aad7645..075bd6f 100644 (file)
@@ -416,6 +416,17 @@ gre_interface_tx (vlib_main_t * vm,
   return frame->n_vectors;
 }
 
+static clib_error_t *
+gre_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
+{
+  if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
+    vnet_hw_interface_set_flags (vnm, hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP);
+  else
+    vnet_hw_interface_set_flags (vnm, hw_if_index, 0 /* down */);
+
+  return /* no error */ 0;
+}
+
 static u8 * format_gre_tunnel_name (u8 * s, va_list * args)
 {
   u32 dev_instance = va_arg (*args, u32);
@@ -437,9 +448,9 @@ VNET_DEVICE_CLASS (gre_device_class) = {
   .format_device = format_gre_device,
   .format_tx_trace = format_gre_tx_trace,
   .tx_function = gre_interface_tx,
+  .admin_up_down_function = gre_interface_admin_up_down,
 #ifdef SOON
   .clear counter = 0;
-  .admin_up_down_function = 0;
 #endif
 };