🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24990

[PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for broadcast mode"

#24990
From: Hangbin Liu
Date: Tue, 01 Dec 2026 06:29
76 lines
11648 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>

This reverts commit 45fc134bcfadde456639c1b1e206e6918d69a553.

The reverted commit 45fc134bcfad ("bonding: do not set usable_slaves for
broadcast mode") assumes the bond updelay always applies. However, based
on bonding.rst section 13.1 paragraph 4 and commit f8a65ab2f3ff ("bonding:
fix link recovery in mode 2 when updelay is nonzero"), when a slave is
enslaved and there are no active slaves, the slave should become usable
immediately once its link comes up, updelay should be ignored.

Before this revert: with no active interfaces, the only slave still waited
out the 1000 ms updelay before being brought into use.

  [  154.846629] bond0: (slave veth0): link status definitely down, disabling slave
  [  154.849879] bond0: now running without any active interface!
  [  159.544736] bond0: (slave veth0): link status up, enabling it in 1000 ms
  [  160.586299] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
  [  160.603278] bond0: active interface up!

After this revert: the first slave can be used immediately on link up.
Subsequent slave veth2 still honor the 1000 ms updelay.

  [   94.106425] bond0: (slave veth0): link status definitely down, disabling slave
  [   94.109130] bond0: now running without any active interface!
  [   98.272494] bond0: (slave veth0): link status up, enabling it in 0 ms
  [   98.273279] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
  [   98.275056] bond0: active interface up!
  [  110.855705] bond0: (slave veth2): Enslaving as an active interface with an up link
  [  111.904688] bond0: (slave veth2): link status definitely up, 10000 Mbps full duplex
  [  114.608488] bond0: (slave veth2): link status definitely down, disabling slave
  [  117.624491] bond0: (slave veth2): link status up, enabling it in 1000 ms
  [  118.664636] bond0: (slave veth2): link status definitely up, 10000 Mbps full duplex

The stale-empty side of the problem that revert this one is addressed
by the follow-up patch in this series, "bonding: update slave array on
link change for broadcast mode", which rebuilds the array on link
transitions, together they keep ignore_updelay correct in both directions.

Cc: stable@vger.kernel.org
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 drivers/net/bonding/bond_main.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 042d7c75548f..d6675e87d06b 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);
 	kfree_rcu(usable, rcu);
+
+	all = rtnl_dereference(bond->all_slaves);
+	rcu_assign_pointer(bond->all_slaves, all_slaves);
+	kfree_rcu(all, rcu);
 }
 
 static void bond_reset_slave_arr(struct bonding *bond)

-- 
2.56.0
Technical Details
Message-ID: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374727-linux-kernel-netdev=dewy.ru
References: <20261201-bond_broadcast_updelay-v2-0-969e1844f2c4@kylinos.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374727-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 1/3] Revert "bonding: do not set usable_slaves for
 broadcast mode"
Date: Tue, 01 Dec 2026 14:29:16 +0800
Organization: Usenet Network
Message-ID: <20261201-bond_broadcast_updelay-v2-1-969e1844f2c4@kylinos.cn>
References: <20261201-bond_broadcast_updelay-v2-0-969e1844f2c4@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1634905"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GSFHZZ1sy2edrzjP4iw2vaTXiOg= sha256:UksT4N3/VsbH4YeVRChgGf8DsI6eeaE3mP0O16T/z+A=
	sha1:CmWU8Sz8j2oy4ENv3GOE+1ajscs= sha256:l3nqfLKxxoeJoEFKNZy8ssHUGjaYewUJ/B2afO92K5k=
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 326CA11725A; Tue,  1 Dec 2026 09:30:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 K2TyKdGljVA5;
	Tue,  1 Dec 2026 09:29:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-374727-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 75528117257; Tue,  1 Dec 2026 09:29:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 29CF720BB8; Tue,  1 Dec 2026 06:29:46 +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=1796106585;
	b=kHpvyr18OMm+2L+Ntz25e3VW4+KP3XTxBbCbJdRIj2nfTPqtVN+cfM3wlrqnDCYsQysG
	 EVxa4wuMfmFZoQ6EbnusPSH3WXUojDjQ5L52H8RTOu8zpSt+WTPUGzKkPnbASSYG4I0FA
	 5rornMsrJwfXI+YcS5ieEd4hMg/1WrC1R5qxoYTDLJ8ekMSh6qllgHm4SyY78RLvNRsOX
	 2FKi9FliAQTgz3GcdJwe8kLiGvPT6U/1p95X9pRw007o2HHXb6K9PLE1NlfEHKde1ngQl
	 uFx3MVcbFA75TMLu96Jd3MpHWm5RCD6vAhxG64O+tMueinw0epPoTyWugzPYavDNfGQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796106585;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer;
	bh=kQ/YXLvl7c3Al4H/ZZm9RvOhTPAQibInAir6i7h8u3s=;
	b=StE/9jCoT+FmirDkg7y0ofzMyp0xrkIeyiLun+0m3AYZtMRiJ7RMERTamr3uzCxyHVeE
	 9xvR/gidTd31ZlVJdx3zg1V8q0R0lrk/FjXIxSE28fvP50u/vwJnUhR7nEmrRTQhaVYgl
	 tTPFIvQIhyfjLmpQ2DtsZb35WYENR0Hs0PVrW9kO1T/1zKdafHEogoWwM65w+bfQmxxG6
	 wWJjbXTnx6Er2QPjWN7PNqW6lBJRYUo4mFM46V+E3o3lQ5ElrOOXVzefo85DIwxtHtbmT
	 M0kleGfbtaCBmWMfxVXUtJBaWWNDDtOn3x6qjVEVL+qQBBdSOh9TI9bgwIbHsL7gKqw==
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="jNK0kb/8";
	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 670DF606A335;
	Tue,  1 Dec 2026 06:29:45 +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=jNK0kb/8
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.20
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796106584;
	b=cH9hZEV2LdmA7EenVwueVU5SPI+VqZKJp5m8WpJcjqD1VO1ulu9ImtukAkEZiM0llN0D
	 3GcWzolDJWCQN/sPRPC2oLDdaeRNgqvqnfiGMvCU8BoFANPw6wI5EOyAODrQqVdKmrml+
	 ASet/vQzJoNd7nYPpkIX1pypZAsKncPaj2hkgpHlos5W7NCHMIMkWbIm3nM1ME/0psfW6
	 yatmAPFyew7BvR2cCEyPRIcjtwtZTTPwN9lKC1pEh4z2VCzQQTw+NTD1/uBHg5bPuocMZ
	 p7eqcUpljyqcBPbqSQrbpcc/RkrrUftzu+4iAPNJLz2KyiFSz/FsAjIv1U0mNcQHSUA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796106584;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:Subject:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer;
	bh=kQ/YXLvl7c3Al4H/ZZm9RvOhTPAQibInAir6i7h8u3s=;
	b=m9Qa/gPOxPmbLrT5vCgT8QjKJoraNgGCQGvuJpj1CBuyLN1fGx/M2yXyYyrjlw6gq/x4
	 SAK3OfMQ9y6OQ+PUh2Rt5ZBFHAqV+i23DWF9ocvhYtm++cQW1WkRO2DbAhI0EicZBib8i
	 vfZxk8HIYCPHMn6LVIMLvq5UwN6efLVe66QNVve/BP9svohfiUgP7vKCgGu+VzApksZqU
	 9D9/KTnocl+qxYIvM3wRy5htZkRyFmNoCVAnccyaI/VMAmddSA5oxX+4qyoCQ6RFMdoBK
	 nt8rNvT4MrM+GiBtwFyox1jWtvV5BFW5FohhmeEi77YlyFYjrV5piTxeq/foCqAzAcA==
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="jNK0kb/8";
	arc=none smtp.remote-ip=91.218.175.20
X-Received: from mta0.migadu.com (out-20.mta0.migadu.com [91.218.175.20])
	(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 E50A1606A320
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 06:29:43 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E50A1606A320
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=clvaed/c4hq986fjZIJB7SdOwGrW9cfAHHZtPYJFJG0=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1796106582; v=1; x=1796711382;
 b=jNK0kb/8qmS5sy5NDlR1Erb9wXGEAbXau2Pt4fqjoOMMr0ROhP8fyJ+XRJdr63w9iiU4fCGk
 uVLEP2r+7XtyMrDCi4mM+dDx7q4Akhgcsw8bh/46thvy5VPhjzq2W00qr/XN/ZaBPNiu0khPxNO
 l175ioYbjAlapS4fJOmhxc1E=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta11.migadu.com with ESMTPS id fd7cd15beb6c8228;
	Tue, 01 Dec 2026 06:29:42 +0000
X-Mizu-Trace-ID: fd7cd15beb6c8228
X-Migadu-Flow: FLOW_OUT
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: <20261201-bond_broadcast_updelay-v2-0-969e1844f2c4@kylinos.cn>
X-Cc: "jiangjiehua (A)" <jiangjiehua1@huawei.com>, 
 Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, 
 Hangbin Liu <hangbin.liu@linux.dev>, stable@vger.kernel.org
X-Mailer: b4 0.16.0