diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-28 05:16:51 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 01:13:48 -0700 |
commit | cf4432f550a0fe4e08e7cd522568cfbae754582c (patch) | |
tree | 3d60448c5be287b1660f8a1d92a4843513fe8393 /net | |
parent | 8c56ba0530af3d5eee6445dce9dc9296f1f74ed5 (diff) | |
download | op-kernel-dev-cf4432f550a0fe4e08e7cd522568cfbae754582c.zip op-kernel-dev-cf4432f550a0fe4e08e7cd522568cfbae754582c.tar.gz |
ip6tnl: Optimize multiple unregistration
Speedup module unloading by factorizing synchronize_rcu() calls
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 670c291..6c1b5c9 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1393,14 +1393,19 @@ static void ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n) { int h; struct ip6_tnl *t; + LIST_HEAD(list); for (h = 0; h < HASH_SIZE; h++) { - while ((t = ip6n->tnls_r_l[h]) != NULL) - unregister_netdevice(t->dev); + t = ip6n->tnls_r_l[h]; + while (t != NULL) { + unregister_netdevice_queue(t->dev, &list); + t = t->next; + } } t = ip6n->tnls_wc[0]; - unregister_netdevice(t->dev); + unregister_netdevice_queue(t->dev, &list); + unregister_netdevice_many(&list); } static int ip6_tnl_init_net(struct net *net) |