Commit 36a29fb6 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bridge: switch br_net_exit to batch mode

cleanup_net() is competing with other rtnl users.

Instead of calling br_net_exit() for each netns,
call br_net_exit_batch() once.

This gives cleanup_net() ability to group more devices
and call unregister_netdevice_many() only once for all bridge devices.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Roopa Prabhu <roopa@nvidia.com>
Cc: Nikolay Aleksandrov <razor@blackwall.org>
Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7cc3464
...@@ -342,23 +342,26 @@ void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on) ...@@ -342,23 +342,26 @@ void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)
clear_bit(opt, &br->options); clear_bit(opt, &br->options);
} }
static void __net_exit br_net_exit(struct net *net) static void __net_exit br_net_exit_batch(struct list_head *net_list)
{ {
struct net_device *dev; struct net_device *dev;
struct net *net;
LIST_HEAD(list); LIST_HEAD(list);
rtnl_lock(); rtnl_lock();
list_for_each_entry(net, net_list, exit_list)
for_each_netdev(net, dev) for_each_netdev(net, dev)
if (netif_is_bridge_master(dev)) if (netif_is_bridge_master(dev))
br_dev_delete(dev, &list); br_dev_delete(dev, &list);
unregister_netdevice_many(&list); unregister_netdevice_many(&list);
rtnl_unlock();
rtnl_unlock();
} }
static struct pernet_operations br_net_ops = { static struct pernet_operations br_net_ops = {
.exit = br_net_exit, .exit_batch = br_net_exit_batch,
}; };
static const struct stp_proto br_stp_proto = { static const struct stp_proto br_stp_proto = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment