Skip to content

Commit

Permalink
net: speedup netdev_set_master()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 22, 2010
1 parent 907cdda commit 283f2fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 283f2fe

Please sign in to comment.