Skip to content

Commit 2eb7e6f

Browse files
peltzigregkh
authored andcommitted
bonding: fix 802.3ad state sent to partner when unbinding slave
[ Upstream commit 3b5b3a3331d141e8f2a7aaae3a94dfa1e61ecbe4 ] Previously when unbinding a slave the 802.3ad implementation only told partner that the port is not suitable for aggregation by setting the port aggregation state from aggregatable to individual. This is not enough. If the physical layer still stays up and we only unbinded this port from the bond there is nothing in the aggregation status alone to prevent the partner from sending traffic towards us. To ensure that the partner doesn't consider this port at all anymore we should also disable collecting and distributing to signal that this actor is going away. Also clear AD_STATE_SYNCHRONIZATION to ensure partner exits collecting + distributing state. I have tested this behaviour againts Arista EOS switches with mlx5 cards (physical link stays up even when interface is down) and simulated the same situation virtually Linux <-> Linux with two network namespaces running two veth device pairs. In both cases setting aggregation to individual doesn't alone prevent traffic from being to sent towards this port given that the link stays up in partners end. Partner still keeps it's end in collecting + distributing state and continues until timeout is reached. In most cases this means we are losing the traffic partner sends towards our port while we wait for timeout. This is most visible with slow periodic time (LACP rate slow). Other open source implementations like Open VSwitch and libreswitch, and vendor implementations like Arista EOS, seem to disable collecting + distributing to when doing similar port disabling/detaching/removing change. With this patch kernel implementation would behave the same way and ensure partner doesn't consider our actor viable anymore. Signed-off-by: Toni Peltonen <peltzi@peltzi.fi> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com> Acked-by: Jonathan Toppins <jtoppins@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent beab9a7 commit 2eb7e6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/bonding/bond_3ad.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,6 +2050,9 @@ void bond_3ad_unbind_slave(struct slave *slave)
20502050
aggregator->aggregator_identifier);
20512051

20522052
/* Tell the partner that this port is not suitable for aggregation */
2053+
port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION;
2054+
port->actor_oper_port_state &= ~AD_STATE_COLLECTING;
2055+
port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING;
20532056
port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;
20542057
__update_lacpdu_from_port(port);
20552058
ad_lacpdu_send(port);

0 commit comments

Comments
 (0)