提交 cf4432f5 编写于 作者: E Eric Dumazet 提交者: David S. Miller

ip6tnl: Optimize multiple unregistration

Speedup module unloading by factorizing synchronize_rcu() calls
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8c56ba05
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册