lldp packet transmission on a bonded interface 95/7495/2
authorSteve Shin <jonshin@cisco.com>
Fri, 7 Jul 2017 21:57:46 +0000 (14:57 -0700)
committerJohn Lo <loj@cisco.com>
Sat, 8 Jul 2017 14:00:49 +0000 (14:00 +0000)
LLDP packets are dropped at interface output node if each slave's link
is configured as the LLDP interface. The admin state is configured and
managed by the bonded interface, so slave link's state is down by default.
The checking for the admin state UP should be ignored for the slave link.

Change-Id: I06ca250f42fcb8cc50e0ea3a3817a2c5b56865df
Signed-off-by: Steve Shin <jonshin@cisco.com>
src/plugins/dpdk/device/init.c
src/vnet/interface_output.c
src/vnet/lldp/lldp_cli.c

index 9602e93..17e7761 100755 (executable)
@@ -1268,9 +1268,9 @@ dpdk_update_link_state (dpdk_device_t * xd, f64 now)
       ed->new_link_state = (u8) xd->link.link_status;
     }
 
-  if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) &&
-      ((xd->link.link_status != 0) ^
-       vnet_hw_interface_is_link_up (vnm, xd->hw_if_index)))
+  if ((xd->flags & (DPDK_DEVICE_FLAG_ADMIN_UP | DPDK_DEVICE_FLAG_BOND_SLAVE))
+      && ((xd->link.link_status != 0) ^
+         vnet_hw_interface_is_link_up (vnm, xd->hw_if_index)))
     {
       hw_flags_chg = 1;
       hw_flags |= (xd->link.link_status ? VNET_HW_INTERFACE_FLAG_LINK_UP : 0);
index 3f45cb9..846eb57 100644 (file)
@@ -259,7 +259,8 @@ vnet_interface_output_node_flatten (vlib_main_t * vm,
 
   si = vnet_get_sw_interface (vnm, rt->sw_if_index);
   hi = vnet_get_sup_hw_interface (vnm, rt->sw_if_index);
-  if (!(si->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ||
+  if (!(si->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
+                    VNET_SW_INTERFACE_FLAG_BOND_SLAVE)) ||
       !(hi->flags & VNET_HW_INTERFACE_FLAG_LINK_UP))
     {
       vlib_simple_counter_main_t *cm;
@@ -451,7 +452,8 @@ vnet_interface_output_node (vlib_main_t * vm,
 
   si = vnet_get_sw_interface (vnm, rt->sw_if_index);
   hi = vnet_get_sup_hw_interface (vnm, rt->sw_if_index);
-  if (!(si->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ||
+  if (!(si->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
+                    VNET_SW_INTERFACE_FLAG_BOND_SLAVE)) ||
       !(hi->flags & VNET_HW_INTERFACE_FLAG_LINK_UP))
     {
       vlib_simple_counter_main_t *cm;
index af18f90..1933ca8 100644 (file)
@@ -74,7 +74,8 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, int enable)
 
       const vnet_sw_interface_t *sw =
        vnet_get_sw_interface (lm->vnet_main, hi->sw_if_index);
-      if (sw->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
+      if (sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
+                      VNET_SW_INTERFACE_FLAG_BOND_SLAVE))
        {
          lldp_schedule_intf (lm, n);
        }
@@ -501,7 +502,8 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm)
         hw = vnet_get_hw_interface(vnm, n->hw_if_index);
         sw = vnet_get_sw_interface(lm->vnet_main, hw->sw_if_index);
         /* Interface shutdown */
-        if (!(sw->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP))
+        if (!(sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
+                           VNET_SW_INTERFACE_FLAG_BOND_SLAVE)))
           {
             s = format(s, "\nInterface name: %s\nInterface/peer state: "
                           "interface down\nLast packet sent: %U\n",