lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1304927148.3342.4.camel@edumazet-laptop>
Date:	Mon, 09 May 2011 09:45:48 +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 v2 net-next-2.6] 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>
---
v2: added a list_del(&list) for safety (see commit ceaaec98)
 drivers/net/veth.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 3b0151a..b41d6a9 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -416,8 +416,17 @@ 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);
+		list_del(&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

Powered by Openwall GNU/*/Linux Powered by OpenVZ