aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2e8ec8b79f05..ac60b697ab7e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2092,23 +2092,19 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
2092 2092
2093 read_lock(&bond->lock); 2093 read_lock(&bond->lock);
2094 2094
2095 read_lock(&bond->curr_slave_lock);
2096 old_active = bond->curr_active_slave; 2095 old_active = bond->curr_active_slave;
2097 read_unlock(&bond->curr_slave_lock);
2098
2099 new_active = bond_get_slave_by_dev(bond, slave_dev); 2096 new_active = bond_get_slave_by_dev(bond, slave_dev);
2100
2101 /* 2097 /*
2102 * Changing to the current active: do nothing; return success. 2098 * Changing to the current active: do nothing; return success.
2103 */ 2099 */
2104 if (new_active && (new_active == old_active)) { 2100 if (new_active && new_active == old_active) {
2105 read_unlock(&bond->lock); 2101 read_unlock(&bond->lock);
2106 return 0; 2102 return 0;
2107 } 2103 }
2108 2104
2109 if ((new_active) && 2105 if (new_active &&
2110 (old_active) && 2106 old_active &&
2111 (new_active->link == BOND_LINK_UP) && 2107 new_active->link == BOND_LINK_UP &&
2112 IS_UP(new_active->dev)) { 2108 IS_UP(new_active->dev)) {
2113 block_netpoll_tx(); 2109 block_netpoll_tx();
2114 write_lock_bh(&bond->curr_slave_lock); 2110 write_lock_bh(&bond->curr_slave_lock);
@@ -2660,10 +2656,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2660 if (list_empty(&bond->slave_list)) 2656 if (list_empty(&bond->slave_list))
2661 goto re_arm; 2657 goto re_arm;
2662 2658
2663 read_lock(&bond->curr_slave_lock);
2664 oldcurrent = bond->curr_active_slave; 2659 oldcurrent = bond->curr_active_slave;
2665 read_unlock(&bond->curr_slave_lock);
2666
2667 /* see if any of the previous devices are up now (i.e. they have 2660 /* see if any of the previous devices are up now (i.e. they have
2668 * xmt and rcv traffic). the curr_active_slave does not come into 2661 * xmt and rcv traffic). the curr_active_slave does not come into
2669 * the picture unless it is null. also, slave->jiffies is not needed 2662 * the picture unless it is null. also, slave->jiffies is not needed
@@ -3818,11 +3811,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
3818 */ 3811 */
3819 if ((iph->protocol == IPPROTO_IGMP) && 3812 if ((iph->protocol == IPPROTO_IGMP) &&
3820 (skb->protocol == htons(ETH_P_IP))) { 3813 (skb->protocol == htons(ETH_P_IP))) {
3821
3822 read_lock(&bond->curr_slave_lock);
3823 slave = bond->curr_active_slave; 3814 slave = bond->curr_active_slave;
3824 read_unlock(&bond->curr_slave_lock);
3825
3826 if (!slave) 3815 if (!slave)
3827 goto out; 3816 goto out;
3828 } else { 3817 } else {
@@ -3867,15 +3856,12 @@ out:
3867static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) 3856static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
3868{ 3857{
3869 struct bonding *bond = netdev_priv(bond_dev); 3858 struct bonding *bond = netdev_priv(bond_dev);
3859 struct slave *slave;
3870 int res = 1; 3860 int res = 1;
3871 3861
3872 read_lock(&bond->curr_slave_lock); 3862 slave = bond->curr_active_slave;
3873 3863 if (slave)
3874 if (bond->curr_active_slave) 3864 res = bond_dev_queue_xmit(bond, skb, slave->dev);
3875 res = bond_dev_queue_xmit(bond, skb,
3876 bond->curr_active_slave->dev);
3877
3878 read_unlock(&bond->curr_slave_lock);
3879 3865
3880 if (res) 3866 if (res)
3881 /* no suitable interface, frame not sent */ 3867 /* no suitable interface, frame not sent */
@@ -3935,10 +3921,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
3935 int i; 3921 int i;
3936 int res = 1; 3922 int res = 1;
3937 3923
3938 read_lock(&bond->curr_slave_lock);
3939 start_at = bond->curr_active_slave; 3924 start_at = bond->curr_active_slave;
3940 read_unlock(&bond->curr_slave_lock);
3941
3942 if (!start_at) 3925 if (!start_at)
3943 goto out; 3926 goto out;
3944 3927