[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1304916275.3207.79.camel@edumazet-laptop>
Date: Mon, 09 May 2011 06:44:35 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: Alex Bligh <alex@...x.org.uk>, netdev@...r.kernel.org,
Jesse Gross <jesse@...ira.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ben Greear <greearb@...delatech.com>
Subject: [PATCH] veth: use batched device unregister
veth devices dont use the batched device unregisters yet.
Since veth are a pair of devices, it makes sense to use a batch of two
unregisters, this roughly divide dismantle time by two.
Reported-by: Alex Bligh <alex@...x.org.uk>
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Cc: Jesse Gross <jesse@...ira.com>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Ben Greear <greearb@...delatech.com>
---
drivers/net/veth.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 3b99f64..77c4679 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -451,8 +451,16 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
priv = netdev_priv(dev);
peer = priv->peer;
- unregister_netdevice_queue(dev, head);
- unregister_netdevice_queue(peer, head);
+ if (head == NULL) {
+ LIST_HEAD(list);
+ /* make a batch of two devices to speedup unregister */
+ unregister_netdevice_queue(dev, &list);
+ unregister_netdevice_queue(peer, &list);
+ unregister_netdevice_many(&list);
+ } else {
+ unregister_netdevice_queue(dev, head);
+ unregister_netdevice_queue(peer, head);
+ }
}
static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists