aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_alb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-24 18:51:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-24 18:51:40 -0500
commit701b259f446be2f3625fb852bceb93afe76e206d (patch)
tree93f15bcd00bd59c38b4e59fed9af7ddf6b06c8b3 /drivers/net/bonding/bond_alb.c
parentd2346963bfcbb9a8ee783ca3c3b3bdd7448ec9d5 (diff)
parentefc3dbc37412c027e363736b4f4c74ee5e8ecffc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Davem says: 1) Fix JIT code generation on x86-64 for divide by zero, from Eric Dumazet. 2) tg3 header length computation correction from Eric Dumazet. 3) More build and reference counting fixes for socket memory cgroup code from Glauber Costa. 4) module.h snuck back into a core header after all the hard work we did to remove that, from Paul Gortmaker and Jesper Dangaard Brouer. 5) Fix PHY naming regression and add some new PCI IDs in stmmac, from Alessandro Rubini. 6) Netlink message generation fix in new team driver, should only advertise the entries that changed during events, from Jiri Pirko. 7) SRIOV VF registration and unregistration fixes, and also add a missing PCI ID, from Roopa Prabhu. 8) Fix infinite loop in tx queue flush code of brcmsmac, from Stanislaw Gruszka. 9) ftgmac100/ftmac100 build fix, missing interrupt.h include. 10) Memory leak fix in net/hyperv do_set_mutlicast() handling, from Wei Yongjun. 11) Off by one fix in netem packet scheduler, from Vijay Subramanian. 12) TCP loss detection fix from Yuchung Cheng. 13) TCP reset packet MD5 calculation uses wrong address, fix from Shawn Lu. 14) skge carrier assertion and DMA mapping fixes from Stephen Hemminger. 15) Congestion recovery undo performed at the wrong spot in BIC and CUBIC congestion control modules, fix from Neal Cardwell. 16) Ethtool ETHTOOL_GSSET_INFO is unnecessarily restrictive, from Michał Mirosław. 17) Fix triggerable race in ipv6 sysctl handling, from Francesco Ruggeri. 18) Statistics bug fixes in mlx4 from Eugenia Emantayev. 19) rds locking bug fix during info dumps, from your's truly. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (67 commits) rds: Make rds_sock_lock BH rather than IRQ safe. netprio_cgroup.h: dont include module.h from other includes net: flow_dissector.c missing include linux/export.h team: send only changed options/ports via netlink net/hyperv: fix possible memory leak in do_set_multicast() drivers/net: dsa/mv88e6xxx.c files need linux/module.h stmmac: added PCI identifiers llc: Fix race condition in llc_ui_recvmsg stmmac: fix phy naming inconsistency dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches. tg3: fix ipv6 header length computation skge: add byte queue limit support mv643xx_eth: Add Rx Discard and Rx Overrun statistics bnx2x: fix compilation error with SOE in fw_dump bnx2x: handle CHIP_REVISION during init_one bnx2x: allow user to change ring size in ISCSI SD mode bnx2x: fix Big-Endianess in ethtool -t bnx2x: fixed ethtool statistics for MF modes bnx2x: credit-leakage fixup on vlan_mac_del_all macvlan: fix a possible use after free ...
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r--drivers/net/bonding/bond_alb.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 342626f4bc46..f820b26b9db3 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -909,16 +909,12 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
909 } 909 }
910} 910}
911 911
912/* hw is a boolean parameter that determines whether we should try and 912static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
913 * set the hw address of the device as well as the hw address of the
914 * net_device
915 */
916static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
917{ 913{
918 struct net_device *dev = slave->dev; 914 struct net_device *dev = slave->dev;
919 struct sockaddr s_addr; 915 struct sockaddr s_addr;
920 916
921 if (!hw) { 917 if (slave->bond->params.mode == BOND_MODE_TLB) {
922 memcpy(dev->dev_addr, addr, dev->addr_len); 918 memcpy(dev->dev_addr, addr, dev->addr_len);
923 return 0; 919 return 0;
924 } 920 }
@@ -948,8 +944,8 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct
948 u8 tmp_mac_addr[ETH_ALEN]; 944 u8 tmp_mac_addr[ETH_ALEN];
949 945
950 memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN); 946 memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN);
951 alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled); 947 alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr);
952 alb_set_slave_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled); 948 alb_set_slave_mac_addr(slave2, tmp_mac_addr);
953 949
954} 950}
955 951
@@ -1096,8 +1092,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
1096 1092
1097 /* Try setting slave mac to bond address and fall-through 1093 /* Try setting slave mac to bond address and fall-through
1098 to code handling that situation below... */ 1094 to code handling that situation below... */
1099 alb_set_slave_mac_addr(slave, bond->dev->dev_addr, 1095 alb_set_slave_mac_addr(slave, bond->dev->dev_addr);
1100 bond->alb_info.rlb_enabled);
1101 } 1096 }
1102 1097
1103 /* The slave's address is equal to the address of the bond. 1098 /* The slave's address is equal to the address of the bond.
@@ -1133,8 +1128,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
1133 } 1128 }
1134 1129
1135 if (free_mac_slave) { 1130 if (free_mac_slave) {
1136 alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, 1131 alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr);
1137 bond->alb_info.rlb_enabled);
1138 1132
1139 pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", 1133 pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n",
1140 bond->dev->name, slave->dev->name, 1134 bond->dev->name, slave->dev->name,
@@ -1491,8 +1485,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
1491{ 1485{
1492 int res; 1486 int res;
1493 1487
1494 res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr, 1488 res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr);
1495 bond->alb_info.rlb_enabled);
1496 if (res) { 1489 if (res) {
1497 return res; 1490 return res;
1498 } 1491 }
@@ -1643,8 +1636,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
1643 alb_swap_mac_addr(bond, swap_slave, new_slave); 1636 alb_swap_mac_addr(bond, swap_slave, new_slave);
1644 } else { 1637 } else {
1645 /* set the new_slave to the bond mac address */ 1638 /* set the new_slave to the bond mac address */
1646 alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr, 1639 alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr);
1647 bond->alb_info.rlb_enabled);
1648 } 1640 }
1649 1641
1650 if (swap_slave) { 1642 if (swap_slave) {
@@ -1704,8 +1696,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
1704 alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave); 1696 alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
1705 alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave); 1697 alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave);
1706 } else { 1698 } else {
1707 alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr, 1699 alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr);
1708 bond->alb_info.rlb_enabled);
1709 1700
1710 read_lock(&bond->lock); 1701 read_lock(&bond->lock);
1711 alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr); 1702 alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);