From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796279392; b=u/QJx/2/L2jQm35SxSSR8ZrMjOWRzj0ClYWNH77vh0bX7/odRvDuIxK/DdOk/iiLYTGI JqM5b6v/WZKV8LbiJuKPDbq4h6C9+9m+KCYcjxeujtokVph081GQVNmj97+uk0IlrHLKd Hj8RBtNssAAi4WNM5r1Ypityoh0WOzVgam0kczC1/ii3Z8i3LE52jCzlUm1bUW9I4i+mC 226nSYeNA7nIqVFBcGRSmRkxzCUY8LxQ7HBy4rNfLt4H8UgPLs5C+a0RE5sVn9qfVhUDf 2xkYxRUPDtM2KN9yq2rUrUjdkCKQ025tJZqQ4etdKaASmS4FdGaKEqm9glQtUMx/qOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796279392; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=tjrtLV41OvAWP4ovG//rlgmAKkHswDYFXA93luwTKFM=; b=FukxmhBXXsnfnpyudOPP16bQb2mdoDLFyjeqXVVZ6YzJzeg+rpRU5fPmE94EPSaDZBPi Fv1HJhOAQTrg5OQAx9cDRfabO/4856QNKbdutSbhj4T+cit9iy5iixRF5uVhMtoQa/a3u ee0UQ3aEYdLBy281FgkGqerixQvJhBQN9Zdw+PyE7Heec0PBNZywKDgWli/nWrqYDWBCm VVI+swdLjoejvIqLy/XZ0mFxK09ypm/Y84aGSv9xweqmaaUq1kpsCOq116h4WV0/tDZIM JsCtz7rG9y4ImNNKHKSWlYhRD0vQZnciXYgHVzmMcbwg2lEAEw4sc/JXwYkJFHzNchQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OP3bgAEl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC933606A322; Thu, 3 Dec 2026 06:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OP3bgAEl Received: by smtp.kernel.org (Postfix) with ESMTPSA id C514B1F000C1; Thu, 3 Dec 2026 06:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796279392; bh=tjrtLV41OvAWP4ovG//rlgmAKkHswDYFXA93luwTKFM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=OP3bgAElTCC1wmMPC9ZlbO45zWj7lsXji1VL3drEcj/zPpagFFZgoWLxja4+KWeMH FQV2UOtYOW7CiktHpFl5QtesVKPpuLzSHLq3bHIujhfNyvaBi3vPQz3+HDSCepjoGh orulLLfBF1URWzJbHQBTuRqX2Cg87xomIdzO4XwfrailhRv3zwuv0Dsh16ICWCQYny YMutqUU+pa2HvkkvZtcKPTUBXmUsoXJqbBBfqn5MF+uGnpXUGoXFC8MiMmf49gAVxq ewkvS+D9wZpM4gfYuO1kUvMCtrd8n6OCc80xOUEj5M9hQfyp3wldeL6gZxx7nV6XVP 7+1bgnxl0GFNw== Subject: Re: [PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" From: netdev-bot+sashiko@kernel.org To: hangbin.liu@linux.dev 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 Date: Thu, 03 Dec 2026 06:29:51 +0000 Message-ID: <179627939130.3146.1019948269668529702@kernel.org> In-Reply-To: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn> References: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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. 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? [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(). Both patches carry Cc: stable, but the dependency is only stated in prose. Could the revert be squashed into the follow-up, or could the follow-up be referenced explicitly for stable? Either way, a bisect or a backport of only this commit would not land on the broken intermediate state. > kfree_rcu(usable, rcu); > + > + all = rtnl_dereference(bond->all_slaves); > + rcu_assign_pointer(bond->all_slaves, all_slaves); > + kfree_rcu(all, rcu); > } -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-bond_broadcast_updelay-v2-0-969e1844f2c4%40kylinos.cn