netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] cxgb3: rtnl_lock out of loop will be faster
@ 2007-12-12  8:47 Wang Chen
  0 siblings, 0 replies; only message in thread
From: Wang Chen @ 2007-12-12  8:47 UTC (permalink / raw)
  To: David S. Miller, Jeff Garzik; +Cc: netdev, Wang Chen

[PATCH 2/4] [NETDEV] cxgb3: rtnl_lock out of loop will be faster

Before this patch, it gets and releases the lock at each
iteration of the loop. Changing unregister_netdev to
unregister_netdevice and locking outside of the loop will
be faster for this approach.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 cxgb3_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.24.rc5.org/drivers/net/cxgb3/cxgb3_main.c	2007-12-12 10:19:39.000000000 +0800
+++ linux-2.6.24.rc5/drivers/net/cxgb3/cxgb3_main.c	2007-12-12 15:19:15.000000000 +0800
@@ -2584,9 +2584,11 @@ static void __devexit remove_one(struct 
 		sysfs_remove_group(&adapter->port[0]->dev.kobj,
 				   &cxgb3_attr_group);
 
+		rtnl_lock();
 		for_each_port(adapter, i)
 		    if (test_bit(i, &adapter->registered_device_map))
-			unregister_netdev(adapter->port[i]);
+			unregister_netdevice(adapter->port[i]);
+		rtnl_unlock();
 
 		if (is_offload(adapter)) {
 			cxgb3_adapter_unofld(adapter);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-12  8:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12  8:47 [PATCH 2/4] cxgb3: rtnl_lock out of loop will be faster Wang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).