mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
net: bonding: update the slave array for broadcast mode
This patch fixesce7a381697("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:ce7a381697("net: bonding: add broadcast_neighbor option for 802.3ad") Cc: Simon Horman <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: <[email protected]> Reported-by: Jiri Slaby <[email protected]> Tested-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Tonghao Zhang <[email protected]> Reviewed-by: Hangbin Liu <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Acked-by: Jay Vosburgh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
committed by
Jakub Kicinski
parent
cb74f8c952
commit
e0caeb24f5
@@ -2287,7 +2287,9 @@ skip_mac_set:
|
||||
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 ||
|
||||
@@ -2463,7 +2465,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",
|
||||
|
||||
Reference in New Issue
Block a user