Skip to content

Commit

Permalink
ip6tnl: Optimize multiple unregistration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 29, 2009
1 parent 8c56ba0 commit cf4432f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf4432f

Please sign in to comment.