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 5680F334695; Sat, 30 May 2026 17:27:22 +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=1780162043; cv=none; b=H9bipZpcC2dP9LyoLp/LkxS1/gFBmKvXjdwXumI0qob6geVN7kDqG4j2SfLrLcx0Fg4mzWrjfGEIFqYmUfkSJoJ2KVFpsX092AICrOrJBjScABA4LocEGbZkm+oKH7ghEQB9+lkZRSB9Unbxmy6QuphFkfqPaeKWUs6HHBH/PPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162043; c=relaxed/simple; bh=1XkrABQ5huUWYG4MFGafohwGphvbXzH0mDc3rqxdDEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nNv/pEaKElBNfl9rdWzx5PgpOBouCu/KyZ6i+OELuKDujFxVpGNlqocLW71/hBTWKFmT2+PkkV+VEP4z/WNW3TAYC1EM15nA2HWFIHrbAsAdBhL79tBH2uS81SP/CrSBcKxuOGQKU7uG/d7Gnd/DwI6jfi6gC4S+RRemN3Hz9W0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ozghKvRY; 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="ozghKvRY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB131F00893; Sat, 30 May 2026 17:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780162042; bh=eItvgdo//jyE6ScQBLHDW6bRIhLBmQKnWO9R9BU4TT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ozghKvRYnXYu188MZ4nZgrEPJSVTh8rlvv7fvbOw/PO84OcKZ2ljJUZi5w3nXA5yr pPXjGmRN4ef2otYYB/wQOsJHfMs2ui+DPhoa/fITtZRNlSNZcQN+j4HCCnt10v48hm H/FCV7ZEH2eg2NOjKab4QtPQDG8yeL7kXkss0jyc= 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 , Sasha Levin Subject: [PATCH 6.1 804/969] net: bonding: update the slave array for broadcast mode Date: Sat, 30 May 2026 18:05:28 +0200 Message-ID: <20260530160322.832331032@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tonghao Zhang [ Upstream commit e0caeb24f538c3c9c94f471882ceeb43d9dc2739 ] 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: Sasha Levin --- drivers/net/bonding/bond_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d3c41dc57e547..e9e2dec1dcb13 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2258,7 +2258,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, unblock_netpoll_tx(); } - 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); if (!slave_dev->netdev_ops->ndo_bpf || @@ -2432,7 +2434,8 @@ static int __bond_release_one(struct net_device *bond_dev, 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", -- 2.53.0