aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-28 01:16:51 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-29 04:13:48 -0400
commitcf4432f550a0fe4e08e7cd522568cfbae754582c (patch)
tree3d60448c5be287b1660f8a1d92a4843513fe8393 /net/ipv6
parent8c56ba0530af3d5eee6445dce9dc9296f1f74ed5 (diff)
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/ipv6')
-rw-r--r--net/ipv6/ip6_tunnel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 670c291d2567..6c1b5c98e818 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)
1393{ 1393{
1394 int h; 1394 int h;
1395 struct ip6_tnl *t; 1395 struct ip6_tnl *t;
1396 LIST_HEAD(list);
1396 1397
1397 for (h = 0; h < HASH_SIZE; h++) { 1398 for (h = 0; h < HASH_SIZE; h++) {
1398 while ((t = ip6n->tnls_r_l[h]) != NULL) 1399 t = ip6n->tnls_r_l[h];
1399 unregister_netdevice(t->dev); 1400 while (t != NULL) {
1401 unregister_netdevice_queue(t->dev, &list);
1402 t = t->next;
1403 }
1400 } 1404 }
1401 1405
1402 t = ip6n->tnls_wc[0]; 1406 t = ip6n->tnls_wc[0];
1403 unregister_netdevice(t->dev); 1407 unregister_netdevice_queue(t->dev, &list);
1408 unregister_netdevice_many(&list);
1404} 1409}
1405 1410
1406static int ip6_tnl_init_net(struct net *net) 1411static int ip6_tnl_init_net(struct net *net)