netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] net: speedup netdev_set_master()
@ 2010-03-18 23:37 Eric Dumazet
  2010-03-19  5:22 ` David Miller
  2010-03-22  1:37 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Dumazet @ 2010-03-18 23:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

We currently force a synchronize_net() in netdev_set_master()

This seems necessary only when a slave had a master and we dismantle it.

In the other case ("ifenslave bond0 ethO"), we dont need this long
delay.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/core/dev.c b/net/core/dev.c
index 17b1686..ff578ff 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3733,11 +3733,10 @@ int netdev_set_master(struct net_device *slave, struct net_device *master)
 
 	slave->master = master;
 
-	synchronize_net();
-
-	if (old)
+	if (old) {
+		synchronize_net();
 		dev_put(old);
-
+	}
 	if (master)
 		slave->flags |= IFF_SLAVE;
 	else



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-22  1:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 23:37 [PATCH net-next-2.6] net: speedup netdev_set_master() Eric Dumazet
2010-03-19  5:22 ` David Miller
2010-03-19  5:28   ` Eric Dumazet
2010-03-19  5:36     ` David Miller
2010-03-19  5:45       ` Eric Dumazet
2010-03-19  6:11         ` David Miller
2010-03-22  1:37 ` David Miller

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).