diff options
author | Veaceslav Falico <vfalico@gmail.com> | 2014-05-15 15:39:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-16 16:34:32 -0400 |
commit | 01844098ecd9564cd5f903e3ff6c1ea96355772d (patch) | |
tree | 4bf2bb8089248698ec1380d8c4e9cd018141466f /drivers/net/bonding/bond_main.c | |
parent | ec0865a94991d1819d4f99866a2492af8df5c882 (diff) |
bonding: create a macro for bond mode and use it
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_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 48bea62fb4d0..744c47111045 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -343,7 +343,7 @@ static int bond_set_carrier(struct bonding *bond) | |||
343 | if (!bond_has_slaves(bond)) | 343 | if (!bond_has_slaves(bond)) |
344 | goto down; | 344 | goto down; |
345 | 345 | ||
346 | if (bond->params.mode == BOND_MODE_8023AD) | 346 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
347 | return bond_3ad_set_carrier(bond); | 347 | return bond_3ad_set_carrier(bond); |
348 | 348 | ||
349 | bond_for_each_slave(bond, slave, iter) { | 349 | bond_for_each_slave(bond, slave, iter) { |
@@ -574,7 +574,7 @@ static void bond_hw_addr_flush(struct net_device *bond_dev, | |||
574 | dev_uc_unsync(slave_dev, bond_dev); | 574 | dev_uc_unsync(slave_dev, bond_dev); |
575 | dev_mc_unsync(slave_dev, bond_dev); | 575 | dev_mc_unsync(slave_dev, bond_dev); |
576 | 576 | ||
577 | if (bond->params.mode == BOND_MODE_8023AD) { | 577 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
578 | /* del lacpdu mc addr from mc list */ | 578 | /* del lacpdu mc addr from mc list */ |
579 | u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR; | 579 | u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR; |
580 | 580 | ||
@@ -810,7 +810,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
810 | new_active->delay = 0; | 810 | new_active->delay = 0; |
811 | new_active->link = BOND_LINK_UP; | 811 | new_active->link = BOND_LINK_UP; |
812 | 812 | ||
813 | if (bond->params.mode == BOND_MODE_8023AD) | 813 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
814 | bond_3ad_handle_link_change(new_active, BOND_LINK_UP); | 814 | bond_3ad_handle_link_change(new_active, BOND_LINK_UP); |
815 | 815 | ||
816 | if (bond_is_lb(bond)) | 816 | if (bond_is_lb(bond)) |
@@ -838,7 +838,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
838 | rcu_assign_pointer(bond->curr_active_slave, new_active); | 838 | rcu_assign_pointer(bond->curr_active_slave, new_active); |
839 | } | 839 | } |
840 | 840 | ||
841 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) { | 841 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) { |
842 | if (old_active) | 842 | if (old_active) |
843 | bond_set_slave_inactive_flags(old_active, | 843 | bond_set_slave_inactive_flags(old_active, |
844 | BOND_SLAVE_NOTIFY_NOW); | 844 | BOND_SLAVE_NOTIFY_NOW); |
@@ -877,7 +877,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
877 | * bonding modes and the retransmission is enabled */ | 877 | * bonding modes and the retransmission is enabled */ |
878 | if (netif_running(bond->dev) && (bond->params.resend_igmp > 0) && | 878 | if (netif_running(bond->dev) && (bond->params.resend_igmp > 0) && |
879 | ((bond_uses_primary(bond) && new_active) || | 879 | ((bond_uses_primary(bond) && new_active) || |
880 | bond->params.mode == BOND_MODE_ROUNDROBIN)) { | 880 | BOND_MODE(bond) == BOND_MODE_ROUNDROBIN)) { |
881 | bond->igmp_retrans = bond->params.resend_igmp; | 881 | bond->igmp_retrans = bond->params.resend_igmp; |
882 | queue_delayed_work(bond->wq, &bond->mcast_work, 1); | 882 | queue_delayed_work(bond->wq, &bond->mcast_work, 1); |
883 | } | 883 | } |
@@ -1084,7 +1084,7 @@ static bool bond_should_deliver_exact_match(struct sk_buff *skb, | |||
1084 | struct bonding *bond) | 1084 | struct bonding *bond) |
1085 | { | 1085 | { |
1086 | if (bond_is_slave_inactive(slave)) { | 1086 | if (bond_is_slave_inactive(slave)) { |
1087 | if (bond->params.mode == BOND_MODE_ALB && | 1087 | if (BOND_MODE(bond) == BOND_MODE_ALB && |
1088 | skb->pkt_type != PACKET_BROADCAST && | 1088 | skb->pkt_type != PACKET_BROADCAST && |
1089 | skb->pkt_type != PACKET_MULTICAST) | 1089 | skb->pkt_type != PACKET_MULTICAST) |
1090 | return false; | 1090 | return false; |
@@ -1126,7 +1126,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1126 | 1126 | ||
1127 | skb->dev = bond->dev; | 1127 | skb->dev = bond->dev; |
1128 | 1128 | ||
1129 | if (bond->params.mode == BOND_MODE_ALB && | 1129 | if (BOND_MODE(bond) == BOND_MODE_ALB && |
1130 | bond->dev->priv_flags & IFF_BRIDGE_PORT && | 1130 | bond->dev->priv_flags & IFF_BRIDGE_PORT && |
1131 | skb->pkt_type == PACKET_HOST) { | 1131 | skb->pkt_type == PACKET_HOST) { |
1132 | 1132 | ||
@@ -1171,7 +1171,7 @@ static struct slave *bond_alloc_slave(struct bonding *bond) | |||
1171 | if (!slave) | 1171 | if (!slave) |
1172 | return NULL; | 1172 | return NULL; |
1173 | 1173 | ||
1174 | if (bond->params.mode == BOND_MODE_8023AD) { | 1174 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
1175 | SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), | 1175 | SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), |
1176 | GFP_KERNEL); | 1176 | GFP_KERNEL); |
1177 | if (!SLAVE_AD_INFO(slave)) { | 1177 | if (!SLAVE_AD_INFO(slave)) { |
@@ -1186,7 +1186,7 @@ static void bond_free_slave(struct slave *slave) | |||
1186 | { | 1186 | { |
1187 | struct bonding *bond = bond_get_bond_by_slave(slave); | 1187 | struct bonding *bond = bond_get_bond_by_slave(slave); |
1188 | 1188 | ||
1189 | if (bond->params.mode == BOND_MODE_8023AD) | 1189 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
1190 | kfree(SLAVE_AD_INFO(slave)); | 1190 | kfree(SLAVE_AD_INFO(slave)); |
1191 | 1191 | ||
1192 | kfree(slave); | 1192 | kfree(slave); |
@@ -1298,7 +1298,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1298 | if (!bond_has_slaves(bond)) { | 1298 | if (!bond_has_slaves(bond)) { |
1299 | pr_warn("%s: Warning: The first slave device specified does not support setting the MAC address\n", | 1299 | pr_warn("%s: Warning: The first slave device specified does not support setting the MAC address\n", |
1300 | bond_dev->name); | 1300 | bond_dev->name); |
1301 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) { | 1301 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) { |
1302 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; | 1302 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; |
1303 | pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", | 1303 | pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", |
1304 | bond_dev->name); | 1304 | bond_dev->name); |
@@ -1347,7 +1347,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1347 | ether_addr_copy(new_slave->perm_hwaddr, slave_dev->dev_addr); | 1347 | ether_addr_copy(new_slave->perm_hwaddr, slave_dev->dev_addr); |
1348 | 1348 | ||
1349 | if (!bond->params.fail_over_mac || | 1349 | if (!bond->params.fail_over_mac || |
1350 | bond->params.mode != BOND_MODE_ACTIVEBACKUP) { | 1350 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { |
1351 | /* | 1351 | /* |
1352 | * Set slave to master's mac address. The application already | 1352 | * Set slave to master's mac address. The application already |
1353 | * set the master's mac address to that of the first slave | 1353 | * set the master's mac address to that of the first slave |
@@ -1407,7 +1407,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1407 | netif_addr_unlock_bh(bond_dev); | 1407 | netif_addr_unlock_bh(bond_dev); |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | if (bond->params.mode == BOND_MODE_8023AD) { | 1410 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
1411 | /* add lacpdu mc addr to mc list */ | 1411 | /* add lacpdu mc addr to mc list */ |
1412 | u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR; | 1412 | u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR; |
1413 | 1413 | ||
@@ -1488,7 +1488,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1488 | } | 1488 | } |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | switch (bond->params.mode) { | 1491 | switch (BOND_MODE(bond)) { |
1492 | case BOND_MODE_ACTIVEBACKUP: | 1492 | case BOND_MODE_ACTIVEBACKUP: |
1493 | bond_set_slave_inactive_flags(new_slave, | 1493 | bond_set_slave_inactive_flags(new_slave, |
1494 | BOND_SLAVE_NOTIFY_NOW); | 1494 | BOND_SLAVE_NOTIFY_NOW); |
@@ -1615,7 +1615,7 @@ err_close: | |||
1615 | 1615 | ||
1616 | err_restore_mac: | 1616 | err_restore_mac: |
1617 | if (!bond->params.fail_over_mac || | 1617 | if (!bond->params.fail_over_mac || |
1618 | bond->params.mode != BOND_MODE_ACTIVEBACKUP) { | 1618 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { |
1619 | /* XXX TODO - fom follow mode needs to change master's | 1619 | /* XXX TODO - fom follow mode needs to change master's |
1620 | * MAC if this slave's MAC is in use by the bond, or at | 1620 | * MAC if this slave's MAC is in use by the bond, or at |
1621 | * least print a warning. | 1621 | * least print a warning. |
@@ -1691,7 +1691,7 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1691 | write_lock_bh(&bond->lock); | 1691 | write_lock_bh(&bond->lock); |
1692 | 1692 | ||
1693 | /* Inform AD package of unbinding of slave. */ | 1693 | /* Inform AD package of unbinding of slave. */ |
1694 | if (bond->params.mode == BOND_MODE_8023AD) | 1694 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
1695 | bond_3ad_unbind_slave(slave); | 1695 | bond_3ad_unbind_slave(slave); |
1696 | 1696 | ||
1697 | write_unlock_bh(&bond->lock); | 1697 | write_unlock_bh(&bond->lock); |
@@ -1706,7 +1706,7 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1706 | bond->current_arp_slave = NULL; | 1706 | bond->current_arp_slave = NULL; |
1707 | 1707 | ||
1708 | if (!all && (!bond->params.fail_over_mac || | 1708 | if (!all && (!bond->params.fail_over_mac || |
1709 | bond->params.mode != BOND_MODE_ACTIVEBACKUP)) { | 1709 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) { |
1710 | if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && | 1710 | if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && |
1711 | bond_has_slaves(bond)) | 1711 | bond_has_slaves(bond)) |
1712 | pr_warn("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s - set the HWaddr of %s to a different address to avoid conflicts\n", | 1712 | pr_warn("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s - set the HWaddr of %s to a different address to avoid conflicts\n", |
@@ -1805,7 +1805,7 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1805 | dev_close(slave_dev); | 1805 | dev_close(slave_dev); |
1806 | 1806 | ||
1807 | if (bond->params.fail_over_mac != BOND_FOM_ACTIVE || | 1807 | if (bond->params.fail_over_mac != BOND_FOM_ACTIVE || |
1808 | bond->params.mode != BOND_MODE_ACTIVEBACKUP) { | 1808 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { |
1809 | /* restore original ("permanent") mac address */ | 1809 | /* restore original ("permanent") mac address */ |
1810 | ether_addr_copy(addr.sa_data, slave->perm_hwaddr); | 1810 | ether_addr_copy(addr.sa_data, slave->perm_hwaddr); |
1811 | addr.sa_family = slave_dev->type; | 1811 | addr.sa_family = slave_dev->type; |
@@ -1851,7 +1851,7 @@ static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) | |||
1851 | { | 1851 | { |
1852 | struct bonding *bond = netdev_priv(bond_dev); | 1852 | struct bonding *bond = netdev_priv(bond_dev); |
1853 | 1853 | ||
1854 | info->bond_mode = bond->params.mode; | 1854 | info->bond_mode = BOND_MODE(bond); |
1855 | info->miimon = bond->params.miimon; | 1855 | info->miimon = bond->params.miimon; |
1856 | 1856 | ||
1857 | info->num_slaves = bond->slave_cnt; | 1857 | info->num_slaves = bond->slave_cnt; |
@@ -1907,7 +1907,7 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
1907 | if (slave->delay) { | 1907 | if (slave->delay) { |
1908 | pr_info("%s: link status down for %sinterface %s, disabling it in %d ms\n", | 1908 | pr_info("%s: link status down for %sinterface %s, disabling it in %d ms\n", |
1909 | bond->dev->name, | 1909 | bond->dev->name, |
1910 | (bond->params.mode == | 1910 | (BOND_MODE(bond) == |
1911 | BOND_MODE_ACTIVEBACKUP) ? | 1911 | BOND_MODE_ACTIVEBACKUP) ? |
1912 | (bond_is_active_slave(slave) ? | 1912 | (bond_is_active_slave(slave) ? |
1913 | "active " : "backup ") : "", | 1913 | "active " : "backup ") : "", |
@@ -1998,10 +1998,10 @@ static void bond_miimon_commit(struct bonding *bond) | |||
1998 | slave->link = BOND_LINK_UP; | 1998 | slave->link = BOND_LINK_UP; |
1999 | slave->last_link_up = jiffies; | 1999 | slave->last_link_up = jiffies; |
2000 | 2000 | ||
2001 | if (bond->params.mode == BOND_MODE_8023AD) { | 2001 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
2002 | /* prevent it from being the active one */ | 2002 | /* prevent it from being the active one */ |
2003 | bond_set_backup_slave(slave); | 2003 | bond_set_backup_slave(slave); |
2004 | } else if (bond->params.mode != BOND_MODE_ACTIVEBACKUP) { | 2004 | } else if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { |
2005 | /* make it immediately active */ | 2005 | /* make it immediately active */ |
2006 | bond_set_active_slave(slave); | 2006 | bond_set_active_slave(slave); |
2007 | } else if (slave != bond->primary_slave) { | 2007 | } else if (slave != bond->primary_slave) { |
@@ -2015,7 +2015,7 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2015 | slave->duplex ? "full" : "half"); | 2015 | slave->duplex ? "full" : "half"); |
2016 | 2016 | ||
2017 | /* notify ad that the link status has changed */ | 2017 | /* notify ad that the link status has changed */ |
2018 | if (bond->params.mode == BOND_MODE_8023AD) | 2018 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
2019 | bond_3ad_handle_link_change(slave, BOND_LINK_UP); | 2019 | bond_3ad_handle_link_change(slave, BOND_LINK_UP); |
2020 | 2020 | ||
2021 | if (bond_is_lb(bond)) | 2021 | if (bond_is_lb(bond)) |
@@ -2034,15 +2034,15 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2034 | 2034 | ||
2035 | slave->link = BOND_LINK_DOWN; | 2035 | slave->link = BOND_LINK_DOWN; |
2036 | 2036 | ||
2037 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || | 2037 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP || |
2038 | bond->params.mode == BOND_MODE_8023AD) | 2038 | BOND_MODE(bond) == BOND_MODE_8023AD) |
2039 | bond_set_slave_inactive_flags(slave, | 2039 | bond_set_slave_inactive_flags(slave, |
2040 | BOND_SLAVE_NOTIFY_NOW); | 2040 | BOND_SLAVE_NOTIFY_NOW); |
2041 | 2041 | ||
2042 | pr_info("%s: link status definitely down for interface %s, disabling it\n", | 2042 | pr_info("%s: link status definitely down for interface %s, disabling it\n", |
2043 | bond->dev->name, slave->dev->name); | 2043 | bond->dev->name, slave->dev->name); |
2044 | 2044 | ||
2045 | if (bond->params.mode == BOND_MODE_8023AD) | 2045 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
2046 | bond_3ad_handle_link_change(slave, | 2046 | bond_3ad_handle_link_change(slave, |
2047 | BOND_LINK_DOWN); | 2047 | BOND_LINK_DOWN); |
2048 | 2048 | ||
@@ -2887,7 +2887,7 @@ static int bond_slave_netdev_event(unsigned long event, | |||
2887 | 2887 | ||
2888 | bond_update_speed_duplex(slave); | 2888 | bond_update_speed_duplex(slave); |
2889 | 2889 | ||
2890 | if (bond->params.mode == BOND_MODE_8023AD) { | 2890 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
2891 | if (old_speed != slave->speed) | 2891 | if (old_speed != slave->speed) |
2892 | bond_3ad_adapter_speed_changed(slave); | 2892 | bond_3ad_adapter_speed_changed(slave); |
2893 | if (old_duplex != slave->duplex) | 2893 | if (old_duplex != slave->duplex) |
@@ -3078,7 +3078,7 @@ static void bond_work_init_all(struct bonding *bond) | |||
3078 | bond_resend_igmp_join_requests_delayed); | 3078 | bond_resend_igmp_join_requests_delayed); |
3079 | INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor); | 3079 | INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor); |
3080 | INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor); | 3080 | INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor); |
3081 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) | 3081 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) |
3082 | INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon); | 3082 | INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon); |
3083 | else | 3083 | else |
3084 | INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon); | 3084 | INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon); |
@@ -3124,7 +3124,7 @@ static int bond_open(struct net_device *bond_dev) | |||
3124 | /* bond_alb_initialize must be called before the timer | 3124 | /* bond_alb_initialize must be called before the timer |
3125 | * is started. | 3125 | * is started. |
3126 | */ | 3126 | */ |
3127 | if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) | 3127 | if (bond_alb_initialize(bond, (BOND_MODE(bond) == BOND_MODE_ALB))) |
3128 | return -ENOMEM; | 3128 | return -ENOMEM; |
3129 | if (bond->params.tlb_dynamic_lb) | 3129 | if (bond->params.tlb_dynamic_lb) |
3130 | queue_delayed_work(bond->wq, &bond->alb_work, 0); | 3130 | queue_delayed_work(bond->wq, &bond->alb_work, 0); |
@@ -3138,7 +3138,7 @@ static int bond_open(struct net_device *bond_dev) | |||
3138 | bond->recv_probe = bond_arp_rcv; | 3138 | bond->recv_probe = bond_arp_rcv; |
3139 | } | 3139 | } |
3140 | 3140 | ||
3141 | if (bond->params.mode == BOND_MODE_8023AD) { | 3141 | if (BOND_MODE(bond) == BOND_MODE_8023AD) { |
3142 | queue_delayed_work(bond->wq, &bond->ad_work, 0); | 3142 | queue_delayed_work(bond->wq, &bond->ad_work, 0); |
3143 | /* register to receive LACPDUs */ | 3143 | /* register to receive LACPDUs */ |
3144 | bond->recv_probe = bond_3ad_lacpdu_recv; | 3144 | bond->recv_probe = bond_3ad_lacpdu_recv; |
@@ -3497,7 +3497,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
3497 | struct list_head *iter; | 3497 | struct list_head *iter; |
3498 | int res = 0; | 3498 | int res = 0; |
3499 | 3499 | ||
3500 | if (bond->params.mode == BOND_MODE_ALB) | 3500 | if (BOND_MODE(bond) == BOND_MODE_ALB) |
3501 | return bond_alb_set_mac_address(bond_dev, addr); | 3501 | return bond_alb_set_mac_address(bond_dev, addr); |
3502 | 3502 | ||
3503 | 3503 | ||
@@ -3508,7 +3508,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
3508 | * Returning an error causes ifenslave to fail. | 3508 | * Returning an error causes ifenslave to fail. |
3509 | */ | 3509 | */ |
3510 | if (bond->params.fail_over_mac && | 3510 | if (bond->params.fail_over_mac && |
3511 | bond->params.mode == BOND_MODE_ACTIVEBACKUP) | 3511 | BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) |
3512 | return 0; | 3512 | return 0; |
3513 | 3513 | ||
3514 | if (!is_valid_ether_addr(sa->sa_data)) | 3514 | if (!is_valid_ether_addr(sa->sa_data)) |
@@ -3792,7 +3792,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev | |||
3792 | !bond_slave_override(bond, skb)) | 3792 | !bond_slave_override(bond, skb)) |
3793 | return NETDEV_TX_OK; | 3793 | return NETDEV_TX_OK; |
3794 | 3794 | ||
3795 | switch (bond->params.mode) { | 3795 | switch (BOND_MODE(bond)) { |
3796 | case BOND_MODE_ROUNDROBIN: | 3796 | case BOND_MODE_ROUNDROBIN: |
3797 | return bond_xmit_roundrobin(skb, dev); | 3797 | return bond_xmit_roundrobin(skb, dev); |
3798 | case BOND_MODE_ACTIVEBACKUP: | 3798 | case BOND_MODE_ACTIVEBACKUP: |
@@ -3810,7 +3810,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev | |||
3810 | default: | 3810 | default: |
3811 | /* Should never happen, mode already checked */ | 3811 | /* Should never happen, mode already checked */ |
3812 | pr_err("%s: Error: Unknown bonding mode %d\n", | 3812 | pr_err("%s: Error: Unknown bonding mode %d\n", |
3813 | dev->name, bond->params.mode); | 3813 | dev->name, BOND_MODE(bond)); |
3814 | WARN_ON_ONCE(1); | 3814 | WARN_ON_ONCE(1); |
3815 | dev_kfree_skb_any(skb); | 3815 | dev_kfree_skb_any(skb); |
3816 | return NETDEV_TX_OK; | 3816 | return NETDEV_TX_OK; |