When lacp_active is set to off, the bond operates in passive mode, meaning it
will only "speak when spoken to." However, the current kernel implementation
only sends an LACPDU in response when the partner's state changes.
In this situation, once LACP negotiation succeeds, the actor stops sending
LACPDUs until the partner times out and sends an "expired" LACPDU.
This leads to endless LACP state flapping.
To avoid this, we need update ntt to true once received an LACPDU from the
partner, ensuring an immediate reply. With this fix, the link becomes stable
in most cases, except for one specific scenario:
Actor: lacp_active=off, lacp_rate=slow
Partner: lacp_active=on, lacp_rate=fast
In this case, the partner expects frequent LACPDUs (every 1 second), but the
actor only responds after receiving an LACPDU, which, in this setup, the
partner sends every 30 seconds due to the actor's lacp_rate=slow. By the time
the actor replies, the partner has already timed out and sent an "expired"
LACPDU.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Hangbin Liu <[email protected]>
---
drivers/net/bonding/bond_3ad.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index c6807e473ab7..e001d1c8a49b 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -666,6 +666,8 @@ static void __update_default_selected(struct port *port)
*/
static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
{
+ struct bonding *bond;
+
/* validate lacpdu and port */
if (lacpdu && port) {
/* check if any parameter is different then
@@ -683,6 +685,10 @@ static void __update_ntt(struct lacpdu *lacpdu, struct
port *port)
) {
port->ntt = true;
}
+
+ bond = __get_bond_by_port(port);
+ if (bond && !bond->params.lacp_active)
+ port->ntt = true;
}
}
--
2.46.0