aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_alb.c
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-05-15 15:39:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-16 16:34:33 -0400
commit8557cd74ca8af9a71ae19d445e33d92bd50a6dc5 (patch)
treec6ad54191e3ed0afc12f62cd5f546189058ec096 /drivers/net/bonding/bond_alb.c
parent891ab54d6636b7aa0da48b5a5dd738af8b75cafe (diff)
bonding: replace SLAVE_IS_OK() with bond_slave_can_tx()
They're verifying the same thing (except of IFF_UP, which is implied for netif_running(), which is also a prerequisite). CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r--drivers/net/bonding/bond_alb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index efacb0e98ed7..03e0bcade234 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -228,7 +228,7 @@ static struct slave *tlb_get_least_loaded_slave(struct bonding *bond)
228 228
229 /* Find the slave with the largest gap */ 229 /* Find the slave with the largest gap */
230 bond_for_each_slave_rcu(bond, slave, iter) { 230 bond_for_each_slave_rcu(bond, slave, iter) {
231 if (SLAVE_IS_OK(slave)) { 231 if (bond_slave_can_tx(slave)) {
232 long long gap = compute_gap(slave); 232 long long gap = compute_gap(slave);
233 233
234 if (max_gap < gap) { 234 if (max_gap < gap) {
@@ -383,7 +383,7 @@ static struct slave *rlb_next_rx_slave(struct bonding *bond)
383 bool found = false; 383 bool found = false;
384 384
385 bond_for_each_slave(bond, slave, iter) { 385 bond_for_each_slave(bond, slave, iter) {
386 if (!SLAVE_IS_OK(slave)) 386 if (!bond_slave_can_tx(slave))
387 continue; 387 continue;
388 if (!found) { 388 if (!found) {
389 if (!before || before->speed < slave->speed) 389 if (!before || before->speed < slave->speed)
@@ -416,7 +416,7 @@ static struct slave *__rlb_next_rx_slave(struct bonding *bond)
416 bool found = false; 416 bool found = false;
417 417
418 bond_for_each_slave_rcu(bond, slave, iter) { 418 bond_for_each_slave_rcu(bond, slave, iter) {
419 if (!SLAVE_IS_OK(slave)) 419 if (!bond_slave_can_tx(slave))
420 continue; 420 continue;
421 if (!found) { 421 if (!found) {
422 if (!before || before->speed < slave->speed) 422 if (!before || before->speed < slave->speed)
@@ -1100,13 +1100,13 @@ static void alb_swap_mac_addr(struct slave *slave1, struct slave *slave2)
1100static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, 1100static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
1101 struct slave *slave2) 1101 struct slave *slave2)
1102{ 1102{
1103 int slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2)); 1103 int slaves_state_differ = (bond_slave_can_tx(slave1) != bond_slave_can_tx(slave2));
1104 struct slave *disabled_slave = NULL; 1104 struct slave *disabled_slave = NULL;
1105 1105
1106 ASSERT_RTNL(); 1106 ASSERT_RTNL();
1107 1107
1108 /* fasten the change in the switch */ 1108 /* fasten the change in the switch */
1109 if (SLAVE_IS_OK(slave1)) { 1109 if (bond_slave_can_tx(slave1)) {
1110 alb_send_learning_packets(slave1, slave1->dev->dev_addr); 1110 alb_send_learning_packets(slave1, slave1->dev->dev_addr);
1111 if (bond->alb_info.rlb_enabled) { 1111 if (bond->alb_info.rlb_enabled) {
1112 /* inform the clients that the mac address 1112 /* inform the clients that the mac address
@@ -1118,7 +1118,7 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
1118 disabled_slave = slave1; 1118 disabled_slave = slave1;
1119 } 1119 }
1120 1120
1121 if (SLAVE_IS_OK(slave2)) { 1121 if (bond_slave_can_tx(slave2)) {
1122 alb_send_learning_packets(slave2, slave2->dev->dev_addr); 1122 alb_send_learning_packets(slave2, slave2->dev->dev_addr);
1123 if (bond->alb_info.rlb_enabled) { 1123 if (bond->alb_info.rlb_enabled) {
1124 /* inform the clients that the mac address 1124 /* inform the clients that the mac address
@@ -1360,7 +1360,7 @@ static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
1360 bond_info->unbalanced_load += skb->len; 1360 bond_info->unbalanced_load += skb->len;
1361 } 1361 }
1362 1362
1363 if (tx_slave && SLAVE_IS_OK(tx_slave)) { 1363 if (tx_slave && bond_slave_can_tx(tx_slave)) {
1364 if (tx_slave != rcu_dereference(bond->curr_active_slave)) { 1364 if (tx_slave != rcu_dereference(bond->curr_active_slave)) {
1365 ether_addr_copy(eth_data->h_source, 1365 ether_addr_copy(eth_data->h_source,
1366 tx_slave->dev->dev_addr); 1366 tx_slave->dev->dev_addr);