aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bonding/cli.c
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2019-01-17 15:11:29 -0800
committerDamjan Marion <dmarion@me.com>2019-01-23 21:06:29 +0000
commite43278f75fe3188551580c7d7991958805756e2f (patch)
tree0937ea661cef9226ffcd3c1cbcd5b45d8f6295a7 /src/vnet/bonding/cli.c
parent9a8a12a06e9e67c4ef339d3002cdc5151341826d (diff)
bond: packet drops on VPP bond interface [VPP-1544]
We register callback for VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION and VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION to add and remove the slave interface from the bond interface accordingly. For static bonding without lacp, one would think that it is good enough to put the slave interface into the ective slave set as soon as it is configured. Wrong, sometimes the slave interface is configured to be part of the bonding without ever bringing up the hardware carrier or setting the admin state to up. In that case, we send traffic to the "dead" slave interface. The fix is to make sure both the carrier and admin state are up before we put the slave into the active set for forwarding traffic. Change-Id: I93b1c36d5481ca76cc8b87e8ca1b375ca3bd453b Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vnet/bonding/cli.c')
-rw-r--r--src/vnet/bonding/cli.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c
index 2ccf0d4b4ce..bccbb2c036e 100644
--- a/src/vnet/bonding/cli.c
+++ b/src/vnet/bonding/cli.c
@@ -531,11 +531,13 @@ bond_enslave (vlib_main_t * vm, bond_enslave_args_t * args)
ethernet_set_rx_redirect (vnm, sif_hw, 1);
}
- if ((bif->mode == BOND_MODE_LACP) && bm->lacp_enable_disable)
+ if (bif->mode == BOND_MODE_LACP)
{
- (*bm->lacp_enable_disable) (vm, bif, sif, 1);
+ if (bm->lacp_enable_disable)
+ (*bm->lacp_enable_disable) (vm, bif, sif, 1);
}
- else
+ else if (sif->port_enabled &&
+ (sif_hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP))
{
bond_enable_collecting_distributing (vm, sif);
}