From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.63 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796284331; b=uKYwL/85tSr1AiDqI+44WsgXOT5ahHVIJkQjf936iJZp3J7NJ+h8zSFubky6TggLbZrY LtNZuX+XzdH2WMBKhSlqAZ4O8OJHgPOjcKx2BowdToks2SGBu3q2X+GZdnfIvlkTDC1XO V3mVInrsEUnIemlE+X3zAP/K516+kgQY75yPdJcgGhUlcRHQEswF28JPcttHBpywgm41P /eIx3YqWNHc4ZyGCkt7GpYlGoDhhDFJcU6oRC/Llkf6MJ/FZ+2okYIEVJ+3F5JFuMSZYo KqXouATRFBB9SXOS8vQzTbUFf24xMb0kOs0MSxHoTUKh0Xq/uSGjoDihvkwBhDcyYPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284331; 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=KdQtU0UqjHlpnc7Ypb/ZbIU4wgzYkgjaeKSlvIYQK1IhHJnx72uflnm5e5VceP6XuTQX 2HwJXiwmOEwE5NL0c1wGLa6Z6DQYRmixY45ibm9yhF9hBCY6hnzf5/PHkjgOJFnVym2cX CxGnLkSfcbb5uMlVNVEd2jIBpah30XOh7ObpzfK6eSQLsnCbfoSxIQEwTIaYW1W0tQbzH +svxzcJw08rlHJuxaGwY6eOXWMpVh2KeUBudNC/rtFsyuKqUc5na6/taeT28pavjzEhZX hOpP13tqjTwPyoUVH+HJvE2Do6jUET2TrUJ4yCtO16nZZ8kGS8tuEObp/xwyFMACLtg== 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="WV3wWQS/"; arc=none smtp.remote-ip=95.215.58.63 Received: from mta1.migadu.com (out-63.mta1.migadu.com [95.215.58.63]) (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 D2C3F606A333 for ; Thu, 3 Dec 2026 07:52:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2C3F606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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=WV3wWQS/ X-Envelope-To: linux-kernel@vger.kernel.org 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=1796284327; v=1; x=1796889127; b=WV3wWQS/93UL++GD8pwoT8aE/YpKwKFf81yTzFFHBVKhNBwIP+pl0YiMFFdJih2UmynyIJ87 lcSbR/dVzOwwdYbcGv063jD8o9hHY27wLhLMPqvwdj0/Pepx0THBaPSGmoFvzARnz9zk6wT/hR6 o8pRRanBAjjdM/qLkb217X2Y= X-Envelope-To: linux-kernel@vger.kernel.org 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 Date: Thu, 3 Dec 2026 15:51:59 +0800 From: Hangbin Liu 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" Message-ID: References: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn> <179627939130.3146.1019948269668529702@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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