# Re: \[PATCH net v5\] bonding: 3ad: update transmit arrays without waiting for RTNL

- From: Eric Dumazet \<edumazet@kernel.org\>
- Date: 2026-11-04 09:31:18 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/11/17859437
- Thread: https://ratatoskr.run/netdev/2026/11/17858415/t.md

```text
Le mer. 4 nov. 2026 à 07:44, Yun Lu [ref] a écrit :
>
> From: Yun Lu <redacted>
>
> During 802.3ad bring-up, packets can be dropped despite carrier being up
> and LACP having enabled ports for distribution. This was observed on a
> machine in real use.
>
> The LACP worker enables ports before queuing slave_arr_work to rebuild
> usable_slaves. The transmit path keeps using that array, which can
> remain empty while the array worker retries rtnl_trylock(). Unrelated
> RTNL contention can therefore prolong the packet loss.
>
> Rebuild the arrays directly from the LACP worker after releasing
> mode_lock and RCU, and remove the retry worker's RTNL dependency. Retain
> delayed work to retry allocation failures.
>
> Use a per-bond mutex to serialize array allocation, filling and
> publication, and walk the lower list under RCU. Keep upper link/unlink
> notifications outside this mutex. Exclude new slaves from both arrays
> until all fallible setup, including XDP propagation, succeeds and
> commits array_ready under the same mutex. This keeps concurrently linked
> slaves from overrunning arrays sized from an earlier slave count.
> Release completes its final rebuild or allocation-failure skip under the
> mutex before waiting for RCU readers and freeing a slave.
>
> Retry failed final updates for running bonds. Also rebuild broadcast
> arrays on open and retry failed open updates. Protect the
> peer-notification array reader with RCU now that RTNL no longer excludes
> writers. Updating the shared arrays also covers XDP and lower-device
> queries without changing their selection rules.
>
> Tests used an RTNL holder, userspace LACP peers, slow notifiers and
> test-only allocation failures under KASAN and lockdep to check recovery,
> concurrent member changes and teardown. All 16 bonding selftests passed.
>
> Fixes: ee6377147409 ("bonding: Simplify the xmit function for modes that use xmit_hash")
> Signed-off-by: Yun Lu <redacted>
> ---

I think this should target net-next. The rtnl_trylock() retry
has been there since v3.18, and this patch adds a new locking scheme
across enslave, release, open, uninit and the 3ad worker. With the
Fixes: tag it would be backported to every stable tree, which seems
risky for an issue that only shows up under RTNL contention. Please
resend against net-next without the Fixes: tag, and keep the problem
description in the changelog.

pw-bot: cr
```
