Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: bonding: update the slave array for broadcast mode

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 <horms@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: <stable@vger.kernel.org>
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Tested-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/all/a97e6e1e-81bc-4a79-8352-9e4794b0d2ca@kernel.org/
Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20251016125136.16568-1-tonghao@bamaicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Tonghao Zhang and committed by
Jakub Kicinski
e0caeb24 cb74f8c9

+5 -2
+5 -2
drivers/net/bonding/bond_main.c
··· 2287 2287 unblock_netpoll_tx(); 2288 2288 } 2289 2289 2290 - if (bond_mode_can_use_xmit_hash(bond)) 2290 + /* broadcast mode uses the all_slaves to loop through slaves. */ 2291 + if (bond_mode_can_use_xmit_hash(bond) || 2292 + BOND_MODE(bond) == BOND_MODE_BROADCAST) 2291 2293 bond_update_slave_arr(bond, NULL); 2292 2294 2293 2295 if (!slave_dev->netdev_ops->ndo_bpf || ··· 2465 2463 2466 2464 bond_upper_dev_unlink(bond, slave); 2467 2465 2468 - if (bond_mode_can_use_xmit_hash(bond)) 2466 + if (bond_mode_can_use_xmit_hash(bond) || 2467 + BOND_MODE(bond) == BOND_MODE_BROADCAST) 2469 2468 bond_update_slave_arr(bond, slave); 2470 2469 2471 2470 slave_info(bond_dev, slave_dev, "Releasing %s interface\n",