Article View: linux.kernel.netdev
Article #26197Re: [PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for broadcast mode"
From: Hangbin Liu
Date: Thu, 03 Dec 2026 07:51
Date: Thu, 03 Dec 2026 07:51
124 lines
13263 bytes
13263 bytes
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
Technical Details
Message-ID:
<axEe43xZ6oilYqtp@fedora>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376379-linux-kernel-netdev=dewy.ruReferences:
<20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn> <179627939130.3146.1019948269668529702@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376379-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <axEe43xZ6oilYqtp@fedora> References: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn> <179627939130.3146.1019948269668529702@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2429063"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:YP2B2N0YUHLiH2ki/O/LB39EnJk= sha256:vkbHqPiqTSJ/3+m9kGbIP8I3fMP6RycXTZKOemJztnw= sha1:sgoyHaUsfhVNu8RQhvv+UMeWV5c= sha256:LDynrXpjie0lo8gU3bgnixhwkg7MbkR/0cNl1wDP9Kk= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 7070C11786F; Thu, 3 Dec 2026 10:52:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.151 X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RwhixNdufZJk; Thu, 3 Dec 2026 10:52:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376379-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 111BF11786D; Thu, 3 Dec 2026 10:52:19 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 1D9BF25DE3; Thu, 3 Dec 2026 07:52:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796284332; b=P75IdHBYmPmsgXE4UerheBWBCz+KmzUyaaO9pZ16BJdEEJzL1kfvZJUY9deEPuqmDqVv /8hM69DiUQSwdmCEYPTt25IS5ZV7YbmdC2UEoj1E75E1GRdMuiyLoB0TNHR3FVUHd1241 7m8pTqNUyLsCmUguoKT4Nsk6bk/KGD/Y/5roWTSKEc65UnNVoozBVgJK6x4KT3yUHYO8T fBlKkhjgVtYn/J20JGvWAhQLecC1QXrz8CflC3Abiggbz6aXAywf0JMBha3JFZUby/6aQ xlAOxGVGil2fWmOTRlrdlPzxpJChbv632Y4zIkZmBvnlawyJ6LbXXCXUQg2VSLVqYXw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284332; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=elKuqGhRPUKzjOypfsb1UiP7euSbeF4KLcfVnFYNG+M=; b=qwf2Ov8SU+azt6gZZt4h5tanLy2DXYrTV1XL+bJt3PK6zkEO7jW67J5tuePXIpg+cqhb PmeqdXznQtwJPRG+lj8GS1LEWFnGpt62wiWnJB6jRs1cIUZ2OY/tDfPoZibZWRFF77LoV 88ZD8u+jlXOsIOCrN3PYU7HE45kANGIY5dpqM5ReMdOI704N4kbYzxN5SBNpSO09H7yJc KfLmJqSrPd3vmjgZLtJEedeyteKl7Y3um/eQLPeitDT0tJP2yjXN4LZTBOOaiV+BM7u6D 3kTN2uEGut568ChRUKoC8/1gI10KZ62Ic9SFPFVPYMK0L8EFhkyBNTJ7eiJ/pQstbvA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=whDpuSf0; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D80C6606A32D; Thu, 3 Dec 2026 07:52:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=whDpuSf0 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.30 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796284332; b=kA2iG5btBcbWzxzapyB1F7HvPF9a5MQ5V07+TAehRnzk3ZtI8TlRuYPEL1MGCuQlxU6n VtQ5+6ZIZuu08K77gkZS32jNdCIlvJbuorbw8nf1Rw9nwTwEecasrbwA+WS+8GpclmXz1 jWwO+Q8BMhp62lIyBzsKbpZdAwggA1R5/uvbYnqwVYxXs7ebcgYUHX+oIoTUzmsVYqIdT Z0XwyG4a0Yps/jZccHw8eeR0HNPQeAsf2p1KHARGKSCxdxeYkIFUlrtVxqvkzreuH0aX1 SLHihoMnYVQA7x5QXWHPUZEFeGKxtwVcpy9qLI7Uy5frympYai7YEMS6PJto9KMHT+Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284332; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=elKuqGhRPUKzjOypfsb1UiP7euSbeF4KLcfVnFYNG+M=; b=AkxI3FUvV1bE9rnbjop3CQhaUZS6cnjXmm/oDL9sHHW+fcCyWvhydg93WdvAujgjZoSQ SdYb5YqMQRorDzyR8hgk/GtTJLT7Wkxucefi1q87nIUUzn3yfKuSZoyRkTnF9BsGc7rzh Wf0gkbPOcINjWmiG8dmMGdyB4ch3qVY8oG6vKr4bYL7wiofwlqfn7KGMy3bYNbG8hzUHk 0bZTu2RzbNVsMkzX0OtcmBulhGk+mS4I74NMLXpWALqaKxpCzU8lVAHooK2ifAzQk+r/E L5NXzW/ihm8UnUH4wBU/g5Ctnd6Mhc5d7HP5rDG+ZGnf6XByGSY+xs32Vr9PNIbA3OA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=whDpuSf0; arc=none smtp.remote-ip=91.218.175.30 X-Received: from mta0.migadu.com (out-30.mta0.migadu.com [91.218.175.30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA1A5606A322 for <netdev@vger.kernel.org>; Thu, 3 Dec 2026 07:52:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA1A5606A322 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=bFPTo9IhJsBPZVzMB08LOhwAq04a4yN5DDn/MsvxvKU=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796284326; v=1; x=1796889126; b=whDpuSf0kE9g8pxMYSor1Le0kq+m4Icn/GZAM0Cw9jkNa8Okl3SrxQf+g7Ir7xUFCHmVFFu4 RBq+J0qcfdE7QZ5LHrBVOQZlFn2x/pC1cnqjFOKpWQ3VylsC3FfaZkkGOaYm+e7gPWwxD4nf39J u5nsDgUCW2KhE0dovtFPTRQc= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 9592dc38a39154d5; Thu, 03 Dec 2026 07:52:06 +0000 X-Mizu-Trace-ID: 9592dc38a39154d5 X-Migadu-Flow: FLOW_OUT X-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 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <179627939130.3146.1019948269668529702@kernel.org>