diff options
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index bdb68a600382..d0ea760ce419 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -171,7 +171,7 @@ MODULE_PARM_DESC(resend_igmp, "Number of IGMP membership reports to send on link | |||
171 | /*----------------------------- Global variables ----------------------------*/ | 171 | /*----------------------------- Global variables ----------------------------*/ |
172 | 172 | ||
173 | #ifdef CONFIG_NET_POLL_CONTROLLER | 173 | #ifdef CONFIG_NET_POLL_CONTROLLER |
174 | cpumask_var_t netpoll_block_tx; | 174 | atomic_t netpoll_block_tx = ATOMIC_INIT(0); |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | static const char * const version = | 177 | static const char * const version = |
@@ -878,8 +878,10 @@ static void __bond_resend_igmp_join_requests(struct net_device *dev) | |||
878 | rcu_read_lock(); | 878 | rcu_read_lock(); |
879 | in_dev = __in_dev_get_rcu(dev); | 879 | in_dev = __in_dev_get_rcu(dev); |
880 | if (in_dev) { | 880 | if (in_dev) { |
881 | read_lock(&in_dev->mc_list_lock); | ||
881 | for (im = in_dev->mc_list; im; im = im->next) | 882 | for (im = in_dev->mc_list; im; im = im->next) |
882 | ip_mc_rejoin_group(im); | 883 | ip_mc_rejoin_group(im); |
884 | read_unlock(&in_dev->mc_list_lock); | ||
883 | } | 885 | } |
884 | 886 | ||
885 | rcu_read_unlock(); | 887 | rcu_read_unlock(); |
@@ -1574,7 +1576,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1574 | 1576 | ||
1575 | /* If this is the first slave, then we need to set the master's hardware | 1577 | /* If this is the first slave, then we need to set the master's hardware |
1576 | * address to be the same as the slave's. */ | 1578 | * address to be the same as the slave's. */ |
1577 | if (bond->slave_cnt == 0) | 1579 | if (is_zero_ether_addr(bond->dev->dev_addr)) |
1578 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, | 1580 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, |
1579 | slave_dev->addr_len); | 1581 | slave_dev->addr_len); |
1580 | 1582 | ||
@@ -5297,13 +5299,6 @@ static int __init bonding_init(void) | |||
5297 | if (res) | 5299 | if (res) |
5298 | goto out; | 5300 | goto out; |
5299 | 5301 | ||
5300 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5301 | if (!alloc_cpumask_var(&netpoll_block_tx, GFP_KERNEL)) { | ||
5302 | res = -ENOMEM; | ||
5303 | goto out; | ||
5304 | } | ||
5305 | #endif | ||
5306 | |||
5307 | res = register_pernet_subsys(&bond_net_ops); | 5302 | res = register_pernet_subsys(&bond_net_ops); |
5308 | if (res) | 5303 | if (res) |
5309 | goto out; | 5304 | goto out; |
@@ -5332,9 +5327,6 @@ err: | |||
5332 | rtnl_link_unregister(&bond_link_ops); | 5327 | rtnl_link_unregister(&bond_link_ops); |
5333 | err_link: | 5328 | err_link: |
5334 | unregister_pernet_subsys(&bond_net_ops); | 5329 | unregister_pernet_subsys(&bond_net_ops); |
5335 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5336 | free_cpumask_var(netpoll_block_tx); | ||
5337 | #endif | ||
5338 | goto out; | 5330 | goto out; |
5339 | 5331 | ||
5340 | } | 5332 | } |
@@ -5351,7 +5343,10 @@ static void __exit bonding_exit(void) | |||
5351 | unregister_pernet_subsys(&bond_net_ops); | 5343 | unregister_pernet_subsys(&bond_net_ops); |
5352 | 5344 | ||
5353 | #ifdef CONFIG_NET_POLL_CONTROLLER | 5345 | #ifdef CONFIG_NET_POLL_CONTROLLER |
5354 | free_cpumask_var(netpoll_block_tx); | 5346 | /* |
5347 | * Make sure we don't have an imbalance on our netpoll blocking | ||
5348 | */ | ||
5349 | WARN_ON(atomic_read(&netpoll_block_tx)); | ||
5355 | #endif | 5350 | #endif |
5356 | } | 5351 | } |
5357 | 5352 | ||