]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bonding: send LACPDUs periodically in passive mode after receiving partner's LACPDU
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 15 Aug 2025 06:19:59 +0000 (06:19 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 Aug 2025 07:35:20 +0000 (09:35 +0200)
commit0599640a21e98f0d6a3e9ff85c0a687c90a8103b
tree82075ac7dffe6b00fd67fb4cfd71f3025a476d26
parentb64d035f77b1f02ab449393342264b44950a75ae
bonding: send LACPDUs periodically in passive mode after receiving partner's LACPDU

When `lacp_active` is set to `off`, the bond operates in passive mode, meaning
it only "speaks when spoken to." However, the current kernel implementation
only sends an LACPDU in response when the partner's state changes.

As a result, once LACP negotiation succeeds, the actor stops sending LACPDUs
until the partner times out and sends an "expired" LACPDU. This causes
continuous LACP state flapping.

According to IEEE 802.1AX-2014, 6.4.13 Periodic Transmission machine. The
values of Partner_Oper_Port_State.LACP_Activity and
Actor_Oper_Port_State.LACP_Activity determine whether periodic transmissions
take place. If either or both parameters are set to Active LACP, then periodic
transmissions occur; if both are set to Passive LACP, then periodic
transmissions do not occur.

To comply with this, we remove the `!bond->params.lacp_active` check in
`ad_periodic_machine()`. Instead, we initialize the actor's port's
`LACP_STATE_LACP_ACTIVITY` state based on `lacp_active` setting.

Additionally, we avoid setting the partner's state to
`LACP_STATE_LACP_ACTIVITY` in the EXPIRED state, since we should not assume
the partner is active by default.

This ensures that in passive mode, the bond starts sending periodic LACPDUs
after receiving one from the partner, and avoids flapping due to inactivity.

Fixes: 3a755cd8b7c6 ("bonding: add new option lacp_active")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250815062000.22220-3-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_3ad.c