Re: [PATCH net 1/2] bonding: send LACPDUs periodically in passive mode after receiving partner's LACPDU
From: Hangbin Liu
Date: Fri Jul 25 2025 - 08:55:58 EST
On Fri, Jul 25, 2025 at 11:49:00AM +0300, Nikolay Aleksandrov wrote:
> On 7/25/25 09:28, Hangbin Liu wrote:
> > 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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>
> Shouldn't the fixes tag be lacp_active commit id?
> E.g. 3a755cd8b7c6 ("bonding: add new option lacp_active")
Totally forgot that I added this option -_-!!
Thanks
Hangbin