From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 155503AF64D; Thu, 2 Jul 2026 16:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010710; cv=none; b=QgJnldocpfQzPDLanGR+ggO56zd9ZLrpy0VxCnjKNOhbhvjkch+xo0Y/fk4YmVtvY+N+gFgdtDBsTYFX89CGAsmuzZ0y8XM0UKLmTk1E9hEFxJo0hqKWqj6XV34wkI/hA63LGZC+I55xV59poNMgSVYXqbxxvb4O05bqqAto0B4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010710; c=relaxed/simple; bh=S7Jk7ky1p4uVrbkQbDfdggfvu2yaazvbxj9h5cdhCq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OCKRgF1PDVXTi772vdukynu5nuIs/DYUSi6eK66dj3ymJn28ykx84F58adEa0Z4+vRRRJcvc6xTeA30I/g6H7v0vgeLm3I9tFqV+02u3z+QDrDJl6qDFg/Vi2zRWcgaPZhHD6dScg/7MjkaxHt6SOQssi7pVvN6vK2HU+14QXeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NqqmodX1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NqqmodX1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BC881F000E9; Thu, 2 Jul 2026 16:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010708; bh=qcng3kCTruOsyoKOsYWsW9a81s0OnAasgh/X6KagxU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NqqmodX1njzyGym4U0VpSSyCegawP/lQ52hAIfhtIopzgRNb/S2hTBfrU+QONSjFk SglyM7kL++JGcBIUETscg1wNKqYq61KUu0F+qPim2A4nsdaS5xxA2P5i9pm6qVbgRv MX8pidsC874YcqudQJsqbNw6BQ0AQhbBsz9zlDnc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Simon Horman , Jonathan Corbet , Andrew Lunn , Jiri Slaby , Tonghao Zhang , Hangbin Liu , Nikolay Aleksandrov , Jay Vosburgh , Jakub Kicinski Subject: [PATCH 6.12 202/204] net: bonding: update the slave array for broadcast mode Date: Thu, 2 Jul 2026 18:20:59 +0200 Message-ID: <20260702155122.896823808@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155118.667618796@linuxfoundation.org> References: <20260702155118.667618796@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tonghao Zhang commit e0caeb24f538c3c9c94f471882ceeb43d9dc2739 upstream. This patch fixes ce7a381697cb ("net: bonding: add broadcast_neighbor option for 802.3ad"). Before this commit, on the broadcast mode, all devices were traversed using the bond_for_each_slave_rcu. This patch supports traversing devices by using all_slaves. Therefore, we need to update the slave array when enslave or release slave. Fixes: ce7a381697cb ("net: bonding: add broadcast_neighbor option for 802.3ad") Cc: Simon Horman Cc: Jonathan Corbet Cc: Andrew Lunn Cc: Reported-by: Jiri Slaby Tested-by: Jiri Slaby Link: https://lore.kernel.org/all/a97e6e1e-81bc-4a79-8352-9e4794b0d2ca@kernel.org/ Signed-off-by: Tonghao Zhang Reviewed-by: Hangbin Liu Reviewed-by: Nikolay Aleksandrov Acked-by: Jay Vosburgh Link: https://patch.msgid.link/20251016125136.16568-1-tonghao@bamaicloud.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2390,7 +2390,9 @@ skip_mac_set: bpf_prog_inc(bond->xdp_prog); } - if (bond_mode_can_use_xmit_hash(bond)) + /* broadcast mode uses the all_slaves to loop through slaves. */ + if (bond_mode_can_use_xmit_hash(bond) || + BOND_MODE(bond) == BOND_MODE_BROADCAST) bond_update_slave_arr(bond, NULL); bond_xdp_set_features(bond_dev); @@ -2533,7 +2535,8 @@ static int __bond_release_one(struct net bond_upper_dev_unlink(bond, slave); - if (bond_mode_can_use_xmit_hash(bond)) + if (bond_mode_can_use_xmit_hash(bond) || + BOND_MODE(bond) == BOND_MODE_BROADCAST) bond_update_slave_arr(bond, slave); slave_info(bond_dev, slave_dev, "Releasing %s interface\n",