From: Louis Scalbert <louis.scalbert@6wind.com>
To: netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, jv@jvosburgh.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, fbl@redhat.com,
andy@greyhouse.net, shemminger@vyatta.com, maheshb@google.com,
jonas.gorski@gmail.com, horms@kernel.org,
Louis Scalbert <louis.scalbert@6wind.com>
Subject: [PATCH net v8 5/6] bonding: 3ad: fix mux port state on oper down
Date: Wed, 3 Jun 2026 17:03:30 +0200 [thread overview]
Message-ID: <20260603150331.1919611-6-louis.scalbert@6wind.com> (raw)
In-Reply-To: <20260603150331.1919611-1-louis.scalbert@6wind.com>
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>
---
drivers/net/bonding/bond_3ad.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 98abb2fdd7a6..ab7ce9eecbf5 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -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;
--
2.39.2
next prev parent reply other threads:[~2026-06-03 15:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 15:03 [PATCH net v8 0/6] bonding: 3ad: fix carrier state with no usable slaves Louis Scalbert
2026-06-03 15:03 ` [PATCH net v8 1/6] tools: missed broadcast_neigh if_link uapi header Louis Scalbert
2026-06-08 21:16 ` Jay Vosburgh
2026-06-08 21:20 ` Jay Vosburgh
2026-06-03 15:03 ` [PATCH net v8 2/6] netlink: specs: rt-link: missed broadcast-neigh Louis Scalbert
2026-06-03 15:03 ` [PATCH net v8 3/6] bonding: 3ad: add lacp_strict configuration knob Louis Scalbert
2026-06-03 15:03 ` [PATCH net v8 4/6] bonding: 3ad: fix carrier when no usable slaves Louis Scalbert
2026-06-08 21:37 ` Jay Vosburgh
2026-06-03 15:03 ` Louis Scalbert [this message]
2026-06-03 15:03 ` [PATCH net v8 6/6] selftests: bonding: add test for lacp_strict mode Louis Scalbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260603150331.1919611-6-louis.scalbert@6wind.com \
--to=louis.scalbert@6wind.com \
--cc=andrew+netdev@lunn.ch \
--cc=andy@greyhouse.net \
--cc=edumazet@google.com \
--cc=fbl@redhat.com \
--cc=horms@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox