]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bonding: 3ad: fix mux port state on oper down
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 3 Jun 2026 15:03:30 +0000 (17:03 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Jun 2026 14:53:36 +0000 (07:53 -0700)
When the bonding interface has carrier down due to the absence of
usable slaves and a slave transitions from down to up, the bonding
interface briefly goes carrier up, then down again, and finally up
once LACP negotiates collecting and distributing on the port.

When lacp_strict mode is on, the interface should not transition to
carrier up until LACP negotiation is complete.

This happens because the actor and partner port states remain in
Collecting_Distributing when the port goes down. When the port
comes back up, it temporarily remains in this state until LACP
renegotiation occurs.

Previously this was mostly cosmetic, but since the bonding carrier
state may depend on the LACP negotiation state, it causes the
interface to flap.

According to IEEE 802.3ad-2000 and IEEE 802.1ax-2014, Collecting and
Distributing should be reset when a port goes down:
- In the Receive state machine, port_enabled == FALSE causes a
  transition to the PORT_DISABLED state, which is expected to clear
  Partner_Oper_Port_State.Synchronization.
- In the Mux state machine, Partner_Oper_Port_State.Synchronization ==
  FALSE causes a transition to the ATTACHED state, which disables
  Collecting and Distributing.

However, Partner_Oper_Port_State.Synchronization is not cleared in the
PORT_DISABLED state.

Clear Partner_Oper_Port_State.Synchronization in the Receive
PORT_DISABLED state.

Fixes: 655f8919d549 ("bonding: add min links parameter to 802.3ad")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20260603150331.1919611-6-louis.scalbert@6wind.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_3ad.c

index 51d86e3d34db874dd38ed7163b57f2bf400e365c..acbba08dbdfada00c118bd41b89a60e60f8521e7 100644 (file)
@@ -1337,6 +1337,7 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
                        fallthrough;
                case AD_RX_PORT_DISABLED:
                        port->sm_vars &= ~AD_PORT_MATCHED;
+                       port->partner_oper.port_state &= ~LACP_STATE_SYNCHRONIZATION;
                        break;
                case AD_RX_LACP_DISABLED:
                        port->sm_vars &= ~AD_PORT_SELECTED;