diff options
author | Eric Dumazet <edumazet@google.com> | 2024-04-08 21:04:35 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-10 02:31:45 +0200 |
commit | 6c5d17143fa4e433894a11cd4ce4ce147131d6bf (patch) | |
tree | 1735d4946c11e8382eba975c98c0707c4a361341 /drivers/net/bonding/bond_main.c | |
parent | net: sched: cake: Optimize the number of function calls and branches in heap ... (diff) | |
download | linux-6c5d17143fa4e433894a11cd4ce4ce147131d6bf.tar.xz linux-6c5d17143fa4e433894a11cd4ce4ce147131d6bf.zip |
bonding: no longer use RTNL in bonding_show_bonds()
netdev structures are already RCU protected.
Change bond_init() and bond_uninit() to use RCU
enabled list_add_tail_rcu() and list_del_rcu().
Then bonding_show_bonds() can use rcu_read_lock()
while iterating through bn->dev_list.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20240408190437.2214473-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index c9f0415f780a..08e9bdbf450a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5933,7 +5933,7 @@ static void bond_uninit(struct net_device *bond_dev) bond_set_slave_arr(bond, NULL, NULL); - list_del(&bond->bond_list); + list_del_rcu(&bond->bond_list); bond_debug_unregister(bond); } @@ -6347,7 +6347,7 @@ static int bond_init(struct net_device *bond_dev) spin_lock_init(&bond->stats_lock); netdev_lockdep_set_classes(bond_dev); - list_add_tail(&bond->bond_list, &bn->dev_list); + list_add_tail_rcu(&bond->bond_list, &bn->dev_list); bond_prepare_sysfs_group(bond); |