mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: netdev-bot+sashiko@kernel.org
Cc: jv@jvosburgh.net, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	tonghao@bamaicloud.com, razor@blackwall.org, shuah@kernel.org,
	jiangjiehua1@huawei.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for broadcast mode"
Date: Thu, 3 Dec 2026 15:51:59 +0800	[thread overview]
Message-ID: <axEe43xZ6oilYqtp@fedora> (raw)
In-Reply-To: <179627939130.3146.1019948269668529702@kernel.org>

On Thu, Dec 03, 2026 at 06:29:51AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 1
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
> 
> - [Medium] Looking only at this commit: after the revert,
>   bond_set_slave_arr() publishes bond->usable_slaves for…
> - [Low] bonding: missing Fixes trailer on revert of commit 45fc134bcfad
> 
> --
> 
> Revert "bonding: do not set usable_slaves for broadcast mode"
> 
> This reverts 45fc134bcfad so that bond_set_slave_arr() publishes
> bond->usable_slaves in broadcast mode again. The goal is to let
> bond_miimon_inspect() skip updelay when no slaves are usable. The
> commit message says the follow-up patch, "bonding: update slave array
> on link change for broadcast mode", handles the stale array side.
> 
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > index 042d7c75548fa..d6675e87d06b6 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -5140,18 +5140,13 @@ static void bond_set_slave_arr(struct bonding *bond,
> >  {
> >  	struct bond_up_slave *usable, *all;
> >  
> > -	all = rtnl_dereference(bond->all_slaves);
> > -	rcu_assign_pointer(bond->all_slaves, all_slaves);
> > -	kfree_rcu(all, rcu);
> > -
> > -	if (BOND_MODE(bond) == BOND_MODE_BROADCAST) {
> > -		kfree_rcu(usable_slaves, rcu);
> > -		return;
> > -	}
> > -
> >  	usable = rtnl_dereference(bond->usable_slaves);
> >  	rcu_assign_pointer(bond->usable_slaves, usable_slaves);
> 
> [Severity: Low]
> The changelog identifies the reverted commit and carries Cc: stable,
> but there is no Fixes: trailer. This revert fixes a regression that
> 45fc134bcfad introduced. bond_set_slave_arr() stopped publishing
> bond->usable_slaves in broadcast mode, so bond_miimon_inspect() could
> no longer set ignore_updelay. Shouldn't this carry a Fixes: tag
> pointing at 45fc134bcfad ("bonding: do not set usable_slaves for
> broadcast mode")?
> 
> This matters for more than tidiness. Stable backport tooling uses
> Fixes: to decide which trees need a patch. Patch 2/3 in this series
> carries Fixes: e0caeb24f538 ("net: bonding: update the slave array
> for broadcast mode") and depends on this revert.

Stable tree will backport the whole series.

> 
> Suppose only the follow-up is picked for a tree that already has
> 45fc134bcfad. The broadcast early return in bond_set_slave_arr() is
> still there, so usable_slaves stays NULL. The new rebuild calls would
> then not change the ignore_updelay decision at all.
> 
> Could the Fixes: tag be added in the next revision?

OK, if there is a new version, I can add the Fixes tag.

> 
> [Severity: Medium]
> On its own, can this commit leave a stale usable_slaves array in
> broadcast mode?
> 
> At this point in the series, broadcast mode rebuilds the array only in
> bond_enslave() and __bond_release_one(). bond_miimon_link_change() only
> rebuilds it for BOND_MODE_XOR:
> 
> bond_miimon_link_change() {
>     ...
> 	case BOND_MODE_XOR:
> 		bond_update_slave_arr(bond, NULL);
> 		break;
>     ...
> }
> 
> bond_open(), bond_slave_netdev_event() and the ARP load-balance monitor
> only check bond_mode_can_use_xmit_hash(), so they skip broadcast too.
> 
> With miimon and updelay set, bond_enslave() puts a slave that already
> has carrier into BOND_LINK_BACK:
> 
> 	if (bond->params.updelay) {
> 		bond_set_slave_link_state(new_slave,
> 					  BOND_LINK_BACK,
> 		...
> 
> That means the array published at enslave time has count == 0.
> bond_miimon_inspect() then sees this on every later pass:
> 
> 	if (usable_slaves && usable_slaves->count == 0)
> 		ignore_updelay = true;
> 
> Wouldn't updelay be ignored permanently here? That is the behaviour
> 45fc134bcfad fixed.
> 
> It can also go the other way. An array built while slaves were up stays
> non-empty after every link drops. Wouldn't the first slave to recover
> still wait out the full updelay, which is the symptom this revert is
> meant to fix?
> 
> The next patch, "bonding: update slave array on link change for
> broadcast mode", resolves this. It adds BOND_MODE_BROADCAST handling
> to bond_miimon_link_change(), bond_loadbalance_arp_mon(),
> bond_slave_netdev_event() and bond_open().

As you said, the later patch fixed the issues.

Thanks
Hangbin

  reply	other threads:[~2026-12-03  7:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  6:29 [PATCH net v2 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
2026-12-01  6:29 ` [PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" Hangbin Liu
2026-12-03  6:29   ` netdev-bot+sashiko
2026-12-03  7:51     ` Hangbin Liu [this message]
2026-12-01  6:29 ` [PATCH net v2 2/3] bonding: update slave array on link change for broadcast mode Hangbin Liu
2026-12-03  6:29   ` netdev-bot+sashiko
2026-12-03  8:39     ` Hangbin Liu
2026-12-01  6:29 ` [PATCH net v2 3/3] selftests: bonding: add recovery updelay test " Hangbin Liu
2026-12-03  6:29   ` netdev-bot+sashiko
2026-12-01  6:34 ` [PATCH net v2 0/3] bonding: ignore updelay when no active links " netdev-bot+sinfo
2026-12-01  8:38   ` Hangbin Liu

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=axEe43xZ6oilYqtp@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jiangjiehua1@huawei.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=shuah@kernel.org \
    --cc=tonghao@bamaicloud.com \
    /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

all inboxes | Powered by JetHome®