Netdev List
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Yun Lu <luyun_611@163.com>
Cc: jv@jvosburgh.net, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	maheshb@google.com, razor@blackwall.org, netdev@vger.kernel.org
Subject: Re: [PATCH net v3] bonding: 3ad: select a port when the TX array is empty
Date: Sat, 10 Oct 2026 17:43:18 +0800	[thread overview]
Message-ID: <asoItm3JVXSC5GQ4@fedora> (raw)
In-Reply-To: <20261008024031.16224-1-luyun_611@163.com>

Hi Lu Yun,
On Thu, Oct 08, 2026 at 10:40:31AM +0800, Yun Lu wrote:
> From: Yun Lu <luyun@kylinos.cn>
> 
> This issue was observed on a machine in real use. During 802.3ad
> bring-up in production, packets were dropped even though the bond's
> carrier was up and LACP had enabled ports for distribution. The
> transmit path only consults usable_slaves and returns no slave when
> the array is NULL or its count is zero.
> 
> LACP port eligibility and the TX array are updated separately. The
> state machine enables ports and updates carrier before scheduling
> slave_arr_work to rebuild and publish the array. The worker requires
> RTNL and retries if rtnl_trylock() fails, so RTNL contention can
> prolong the interval in which eligible ports exist but the cached
> array is empty.
> 
> Add a fallback for 802.3ad when the usable array is empty and carrier
> is up. Walk the RCU-protected slave list and use ports whose
> aggregator is active and which pass bond_slave_can_tx(), without
> taking mode_lock or changing LACP state. In 802.3ad mode the
> per-slave active flag is set only by the mux machine for ports of the
> active aggregator, so these lockless reads identify distributable
> ports with the same criteria bond_update_slave_arr() applies when
> building the array.

`bond_update_slave_arr()` is called from `bond_enslave()`, and it should be
very fast. Could we add a check in `bond_3ad_state_machine_handler()` or
another suitable place to ensure usable slaves exist before entering the
distribution state?

The fallback path seems somewhat complex and costly. Or you can wait for
Jay's feedback.

Thanks
Hangbin

      reply	other threads:[~2026-10-10  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  2:40 [PATCH net v3] bonding: 3ad: select a port when the TX array is empty Yun Lu
2026-10-10  9:43 ` Hangbin Liu [this message]

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=asoItm3JVXSC5GQ4@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=luyun_611@163.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    /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