net: speedup netdev_set_master()
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 18 Mar 2010 13:37:40 +0000 (13:37 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2010 01:34:15 +0000 (18:34 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index fe2a754238a902dfb1fcb5c8e9e02cde8f3388ee..2d01f18f303a0dc985028b8bcc657ab1734d26de 100644 (file)
@@ -3757,11 +3757,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