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.c607
1 files changed, 225 insertions, 382 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index af9b9c4eb496..3f0071cfe56b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -31,6 +31,8 @@
31 * 31 *
32 */ 32 */
33 33
34#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
35
34#include <linux/kernel.h> 36#include <linux/kernel.h>
35#include <linux/module.h> 37#include <linux/module.h>
36#include <linux/types.h> 38#include <linux/types.h>
@@ -260,7 +262,7 @@ static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id)
260 struct vlan_entry *vlan; 262 struct vlan_entry *vlan;
261 263
262 pr_debug("bond: %s, vlan id %d\n", 264 pr_debug("bond: %s, vlan id %d\n",
263 (bond ? bond->dev->name : "None"), vlan_id); 265 (bond ? bond->dev->name : "None"), vlan_id);
264 266
265 vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL); 267 vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL);
266 if (!vlan) 268 if (!vlan)
@@ -303,8 +305,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
303 if (bond_is_lb(bond)) 305 if (bond_is_lb(bond))
304 bond_alb_clear_vlan(bond, vlan_id); 306 bond_alb_clear_vlan(bond, vlan_id);
305 307
306 pr_debug("removed VLAN ID %d from bond %s\n", vlan_id, 308 pr_debug("removed VLAN ID %d from bond %s\n",
307 bond->dev->name); 309 vlan_id, bond->dev->name);
308 310
309 kfree(vlan); 311 kfree(vlan);
310 312
@@ -323,8 +325,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
323 } 325 }
324 } 326 }
325 327
326 pr_debug("couldn't find VLAN ID %d in bond %s\n", vlan_id, 328 pr_debug("couldn't find VLAN ID %d in bond %s\n",
327 bond->dev->name); 329 vlan_id, bond->dev->name);
328 330
329out: 331out:
330 write_unlock_bh(&bond->lock); 332 write_unlock_bh(&bond->lock);
@@ -348,7 +350,7 @@ static int bond_has_challenged_slaves(struct bonding *bond)
348 bond_for_each_slave(bond, slave, i) { 350 bond_for_each_slave(bond, slave, i) {
349 if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) { 351 if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) {
350 pr_debug("found VLAN challenged slave - %s\n", 352 pr_debug("found VLAN challenged slave - %s\n",
351 slave->dev->name); 353 slave->dev->name);
352 return 1; 354 return 1;
353 } 355 }
354 } 356 }
@@ -499,8 +501,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
499 501
500 res = bond_add_vlan(bond, vid); 502 res = bond_add_vlan(bond, vid);
501 if (res) { 503 if (res) {
502 pr_err(DRV_NAME 504 pr_err("%s: Error: Failed to add vlan id %d\n",
503 ": %s: Error: Failed to add vlan id %d\n",
504 bond_dev->name, vid); 505 bond_dev->name, vid);
505 } 506 }
506} 507}
@@ -534,8 +535,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
534 535
535 res = bond_del_vlan(bond, vid); 536 res = bond_del_vlan(bond, vid);
536 if (res) { 537 if (res) {
537 pr_err(DRV_NAME 538 pr_err("%s: Error: Failed to remove vlan id %d\n",
538 ": %s: Error: Failed to remove vlan id %d\n",
539 bond_dev->name, vid); 539 bond_dev->name, vid);
540 } 540 }
541} 541}
@@ -1053,8 +1053,7 @@ static void bond_do_fail_over_mac(struct bonding *bond,
1053 1053
1054 rv = dev_set_mac_address(new_active->dev, &saddr); 1054 rv = dev_set_mac_address(new_active->dev, &saddr);
1055 if (rv) { 1055 if (rv) {
1056 pr_err(DRV_NAME 1056 pr_err("%s: Error %d setting MAC of slave %s\n",
1057 ": %s: Error %d setting MAC of slave %s\n",
1058 bond->dev->name, -rv, new_active->dev->name); 1057 bond->dev->name, -rv, new_active->dev->name);
1059 goto out; 1058 goto out;
1060 } 1059 }
@@ -1067,16 +1066,14 @@ static void bond_do_fail_over_mac(struct bonding *bond,
1067 1066
1068 rv = dev_set_mac_address(old_active->dev, &saddr); 1067 rv = dev_set_mac_address(old_active->dev, &saddr);
1069 if (rv) 1068 if (rv)
1070 pr_err(DRV_NAME 1069 pr_err("%s: Error %d setting MAC of slave %s\n",
1071 ": %s: Error %d setting MAC of slave %s\n",
1072 bond->dev->name, -rv, new_active->dev->name); 1070 bond->dev->name, -rv, new_active->dev->name);
1073out: 1071out:
1074 read_lock(&bond->lock); 1072 read_lock(&bond->lock);
1075 write_lock_bh(&bond->curr_slave_lock); 1073 write_lock_bh(&bond->curr_slave_lock);
1076 break; 1074 break;
1077 default: 1075 default:
1078 pr_err(DRV_NAME 1076 pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n",
1079 ": %s: bond_do_fail_over_mac impossible: bad policy %d\n",
1080 bond->dev->name, bond->params.fail_over_mac); 1077 bond->dev->name, bond->params.fail_over_mac);
1081 break; 1078 break;
1082 } 1079 }
@@ -1178,11 +1175,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
1178 1175
1179 if (new_active->link == BOND_LINK_BACK) { 1176 if (new_active->link == BOND_LINK_BACK) {
1180 if (USES_PRIMARY(bond->params.mode)) { 1177 if (USES_PRIMARY(bond->params.mode)) {
1181 pr_info(DRV_NAME 1178 pr_info("%s: making interface %s the new active one %d ms earlier.\n",
1182 ": %s: making interface %s the new " 1179 bond->dev->name, new_active->dev->name,
1183 "active one %d ms earlier.\n", 1180 (bond->params.updelay - new_active->delay) * bond->params.miimon);
1184 bond->dev->name, new_active->dev->name,
1185 (bond->params.updelay - new_active->delay) * bond->params.miimon);
1186 } 1181 }
1187 1182
1188 new_active->delay = 0; 1183 new_active->delay = 0;
@@ -1195,10 +1190,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
1195 bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); 1190 bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP);
1196 } else { 1191 } else {
1197 if (USES_PRIMARY(bond->params.mode)) { 1192 if (USES_PRIMARY(bond->params.mode)) {
1198 pr_info(DRV_NAME 1193 pr_info("%s: making interface %s the new active one.\n",
1199 ": %s: making interface %s the new " 1194 bond->dev->name, new_active->dev->name);
1200 "active one.\n",
1201 bond->dev->name, new_active->dev->name);
1202 } 1195 }
1203 } 1196 }
1204 } 1197 }
@@ -1268,13 +1261,11 @@ void bond_select_active_slave(struct bonding *bond)
1268 return; 1261 return;
1269 1262
1270 if (netif_carrier_ok(bond->dev)) { 1263 if (netif_carrier_ok(bond->dev)) {
1271 pr_info(DRV_NAME 1264 pr_info("%s: first active interface up!\n",
1272 ": %s: first active interface up!\n", 1265 bond->dev->name);
1273 bond->dev->name);
1274 } else { 1266 } else {
1275 pr_info(DRV_NAME ": %s: " 1267 pr_info("%s: now running without any active interface !\n",
1276 "now running without any active interface !\n", 1268 bond->dev->name);
1277 bond->dev->name);
1278 } 1269 }
1279 } 1270 }
1280} 1271}
@@ -1423,16 +1414,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1423 1414
1424 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && 1415 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&
1425 slave_ops->ndo_do_ioctl == NULL) { 1416 slave_ops->ndo_do_ioctl == NULL) {
1426 pr_warning(DRV_NAME 1417 pr_warning("%s: Warning: no link monitoring support for %s\n",
1427 ": %s: Warning: no link monitoring support for %s\n", 1418 bond_dev->name, slave_dev->name);
1428 bond_dev->name, slave_dev->name);
1429 } 1419 }
1430 1420
1431 /* bond must be initialized by bond_open() before enslaving */ 1421 /* bond must be initialized by bond_open() before enslaving */
1432 if (!(bond_dev->flags & IFF_UP)) { 1422 if (!(bond_dev->flags & IFF_UP)) {
1433 pr_warning(DRV_NAME 1423 pr_warning("%s: master_dev is not up in bond_enslave\n",
1434 " %s: master_dev is not up in bond_enslave\n", 1424 bond_dev->name);
1435 bond_dev->name);
1436 } 1425 }
1437 1426
1438 /* already enslaved */ 1427 /* already enslaved */
@@ -1446,19 +1435,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1446 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { 1435 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
1447 pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); 1436 pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name);
1448 if (!list_empty(&bond->vlan_list)) { 1437 if (!list_empty(&bond->vlan_list)) {
1449 pr_err(DRV_NAME 1438 pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
1450 ": %s: Error: cannot enslave VLAN " 1439 bond_dev->name, slave_dev->name, bond_dev->name);
1451 "challenged slave %s on VLAN enabled "
1452 "bond %s\n", bond_dev->name, slave_dev->name,
1453 bond_dev->name);
1454 return -EPERM; 1440 return -EPERM;
1455 } else { 1441 } else {
1456 pr_warning(DRV_NAME 1442 pr_warning("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
1457 ": %s: Warning: enslaved VLAN challenged " 1443 bond_dev->name, slave_dev->name,
1458 "slave %s. Adding VLANs will be blocked as " 1444 slave_dev->name, bond_dev->name);
1459 "long as %s is part of bond %s\n",
1460 bond_dev->name, slave_dev->name, slave_dev->name,
1461 bond_dev->name);
1462 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 1445 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
1463 } 1446 }
1464 } else { 1447 } else {
@@ -1478,8 +1461,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1478 * enslaving it; the old ifenslave will not. 1461 * enslaving it; the old ifenslave will not.
1479 */ 1462 */
1480 if ((slave_dev->flags & IFF_UP)) { 1463 if ((slave_dev->flags & IFF_UP)) {
1481 pr_err(DRV_NAME ": %s is up. " 1464 pr_err("%s is up. This may be due to an out of date ifenslave.\n",
1482 "This may be due to an out of date ifenslave.\n",
1483 slave_dev->name); 1465 slave_dev->name);
1484 res = -EPERM; 1466 res = -EPERM;
1485 goto err_undo_flags; 1467 goto err_undo_flags;
@@ -1495,7 +1477,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1495 if (bond->slave_cnt == 0) { 1477 if (bond->slave_cnt == 0) {
1496 if (bond_dev->type != slave_dev->type) { 1478 if (bond_dev->type != slave_dev->type) {
1497 pr_debug("%s: change device type from %d to %d\n", 1479 pr_debug("%s: change device type from %d to %d\n",
1498 bond_dev->name, bond_dev->type, slave_dev->type); 1480 bond_dev->name,
1481 bond_dev->type, slave_dev->type);
1499 1482
1500 netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); 1483 netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE);
1501 1484
@@ -1507,28 +1490,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1507 netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); 1490 netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE);
1508 } 1491 }
1509 } else if (bond_dev->type != slave_dev->type) { 1492 } else if (bond_dev->type != slave_dev->type) {
1510 pr_err(DRV_NAME ": %s ether type (%d) is different " 1493 pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
1511 "from other slaves (%d), can not enslave it.\n", 1494 slave_dev->name,
1512 slave_dev->name, 1495 slave_dev->type, bond_dev->type);
1513 slave_dev->type, bond_dev->type); 1496 res = -EINVAL;
1514 res = -EINVAL; 1497 goto err_undo_flags;
1515 goto err_undo_flags;
1516 } 1498 }
1517 1499
1518 if (slave_ops->ndo_set_mac_address == NULL) { 1500 if (slave_ops->ndo_set_mac_address == NULL) {
1519 if (bond->slave_cnt == 0) { 1501 if (bond->slave_cnt == 0) {
1520 pr_warning(DRV_NAME 1502 pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active.",
1521 ": %s: Warning: The first slave device " 1503 bond_dev->name);
1522 "specified does not support setting the MAC "
1523 "address. Setting fail_over_mac to active.",
1524 bond_dev->name);
1525 bond->params.fail_over_mac = BOND_FOM_ACTIVE; 1504 bond->params.fail_over_mac = BOND_FOM_ACTIVE;
1526 } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) { 1505 } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
1527 pr_err(DRV_NAME 1506 pr_err("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active.\n",
1528 ": %s: Error: The slave device specified " 1507 bond_dev->name);
1529 "does not support setting the MAC address, "
1530 "but fail_over_mac is not set to active.\n"
1531 , bond_dev->name);
1532 res = -EOPNOTSUPP; 1508 res = -EOPNOTSUPP;
1533 goto err_undo_flags; 1509 goto err_undo_flags;
1534 } 1510 }
@@ -1655,22 +1631,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1655 * supported); thus, we don't need to change 1631 * supported); thus, we don't need to change
1656 * the messages for netif_carrier. 1632 * the messages for netif_carrier.
1657 */ 1633 */
1658 pr_warning(DRV_NAME 1634 pr_warning("%s: Warning: MII and ETHTOOL support not available for interface %s, and arp_interval/arp_ip_target module parameters not specified, thus bonding will not detect link failures! see bonding.txt for details.\n",
1659 ": %s: Warning: MII and ETHTOOL support not "
1660 "available for interface %s, and "
1661 "arp_interval/arp_ip_target module parameters "
1662 "not specified, thus bonding will not detect "
1663 "link failures! see bonding.txt for details.\n",
1664 bond_dev->name, slave_dev->name); 1635 bond_dev->name, slave_dev->name);
1665 } else if (link_reporting == -1) { 1636 } else if (link_reporting == -1) {
1666 /* unable get link status using mii/ethtool */ 1637 /* unable get link status using mii/ethtool */
1667 pr_warning(DRV_NAME 1638 pr_warning("%s: Warning: can't get link status from interface %s; the network driver associated with this interface does not support MII or ETHTOOL link status reporting, thus miimon has no effect on this interface.\n",
1668 ": %s: Warning: can't get link status from " 1639 bond_dev->name, slave_dev->name);
1669 "interface %s; the network driver associated "
1670 "with this interface does not support MII or "
1671 "ETHTOOL link status reporting, thus miimon "
1672 "has no effect on this interface.\n",
1673 bond_dev->name, slave_dev->name);
1674 } 1640 }
1675 } 1641 }
1676 1642
@@ -1678,34 +1644,27 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1678 if (!bond->params.miimon || 1644 if (!bond->params.miimon ||
1679 (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { 1645 (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) {
1680 if (bond->params.updelay) { 1646 if (bond->params.updelay) {
1681 pr_debug("Initial state of slave_dev is " 1647 pr_debug("Initial state of slave_dev is BOND_LINK_BACK\n");
1682 "BOND_LINK_BACK\n");
1683 new_slave->link = BOND_LINK_BACK; 1648 new_slave->link = BOND_LINK_BACK;
1684 new_slave->delay = bond->params.updelay; 1649 new_slave->delay = bond->params.updelay;
1685 } else { 1650 } else {
1686 pr_debug("Initial state of slave_dev is " 1651 pr_debug("Initial state of slave_dev is BOND_LINK_UP\n");
1687 "BOND_LINK_UP\n");
1688 new_slave->link = BOND_LINK_UP; 1652 new_slave->link = BOND_LINK_UP;
1689 } 1653 }
1690 new_slave->jiffies = jiffies; 1654 new_slave->jiffies = jiffies;
1691 } else { 1655 } else {
1692 pr_debug("Initial state of slave_dev is " 1656 pr_debug("Initial state of slave_dev is BOND_LINK_DOWN\n");
1693 "BOND_LINK_DOWN\n");
1694 new_slave->link = BOND_LINK_DOWN; 1657 new_slave->link = BOND_LINK_DOWN;
1695 } 1658 }
1696 1659
1697 if (bond_update_speed_duplex(new_slave) && 1660 if (bond_update_speed_duplex(new_slave) &&
1698 (new_slave->link != BOND_LINK_DOWN)) { 1661 (new_slave->link != BOND_LINK_DOWN)) {
1699 pr_warning(DRV_NAME 1662 pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n",
1700 ": %s: Warning: failed to get speed and duplex from %s, " 1663 bond_dev->name, new_slave->dev->name);
1701 "assumed to be 100Mb/sec and Full.\n",
1702 bond_dev->name, new_slave->dev->name);
1703 1664
1704 if (bond->params.mode == BOND_MODE_8023AD) { 1665 if (bond->params.mode == BOND_MODE_8023AD) {
1705 pr_warning(DRV_NAME 1666 pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n",
1706 ": %s: Warning: Operation of 802.3ad mode requires ETHTOOL " 1667 bond_dev->name);
1707 "support in base driver for proper aggregator "
1708 "selection.\n", bond_dev->name);
1709 } 1668 }
1710 } 1669 }
1711 1670
@@ -1777,11 +1736,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1777 if (res) 1736 if (res)
1778 goto err_close; 1737 goto err_close;
1779 1738
1780 pr_info(DRV_NAME 1739 pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
1781 ": %s: enslaving %s as a%s interface with a%s link.\n", 1740 bond_dev->name, slave_dev->name,
1782 bond_dev->name, slave_dev->name, 1741 new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup",
1783 new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup", 1742 new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
1784 new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
1785 1743
1786 /* enslave is successful */ 1744 /* enslave is successful */
1787 return 0; 1745 return 0;
@@ -1833,8 +1791,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1833 /* slave is not a slave or master is not master of this slave */ 1791 /* slave is not a slave or master is not master of this slave */
1834 if (!(slave_dev->flags & IFF_SLAVE) || 1792 if (!(slave_dev->flags & IFF_SLAVE) ||
1835 (slave_dev->master != bond_dev)) { 1793 (slave_dev->master != bond_dev)) {
1836 pr_err(DRV_NAME 1794 pr_err("%s: Error: cannot release %s.\n",
1837 ": %s: Error: cannot release %s.\n",
1838 bond_dev->name, slave_dev->name); 1795 bond_dev->name, slave_dev->name);
1839 return -EINVAL; 1796 return -EINVAL;
1840 } 1797 }
@@ -1844,9 +1801,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1844 slave = bond_get_slave_by_dev(bond, slave_dev); 1801 slave = bond_get_slave_by_dev(bond, slave_dev);
1845 if (!slave) { 1802 if (!slave) {
1846 /* not a slave of this bond */ 1803 /* not a slave of this bond */
1847 pr_info(DRV_NAME 1804 pr_info("%s: %s not enslaved\n",
1848 ": %s: %s not enslaved\n", 1805 bond_dev->name, slave_dev->name);
1849 bond_dev->name, slave_dev->name);
1850 write_unlock_bh(&bond->lock); 1806 write_unlock_bh(&bond->lock);
1851 return -EINVAL; 1807 return -EINVAL;
1852 } 1808 }
@@ -1854,14 +1810,10 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1854 if (!bond->params.fail_over_mac) { 1810 if (!bond->params.fail_over_mac) {
1855 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && 1811 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
1856 bond->slave_cnt > 1) 1812 bond->slave_cnt > 1)
1857 pr_warning(DRV_NAME 1813 pr_warning("%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",
1858 ": %s: Warning: the permanent HWaddr of %s - " 1814 bond_dev->name, slave_dev->name,
1859 "%pM - is still in use by %s. " 1815 slave->perm_hwaddr,
1860 "Set the HWaddr of %s to a different address " 1816 bond_dev->name, slave_dev->name);
1861 "to avoid conflicts.\n",
1862 bond_dev->name, slave_dev->name,
1863 slave->perm_hwaddr,
1864 bond_dev->name, slave_dev->name);
1865 } 1817 }
1866 1818
1867 /* Inform AD package of unbinding of slave. */ 1819 /* Inform AD package of unbinding of slave. */
@@ -1872,12 +1824,10 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1872 bond_3ad_unbind_slave(slave); 1824 bond_3ad_unbind_slave(slave);
1873 } 1825 }
1874 1826
1875 pr_info(DRV_NAME 1827 pr_info("%s: releasing %s interface %s\n",
1876 ": %s: releasing %s interface %s\n", 1828 bond_dev->name,
1877 bond_dev->name, 1829 (slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
1878 (slave->state == BOND_STATE_ACTIVE) 1830 slave_dev->name);
1879 ? "active" : "backup",
1880 slave_dev->name);
1881 1831
1882 oldcurrent = bond->curr_active_slave; 1832 oldcurrent = bond->curr_active_slave;
1883 1833
@@ -1934,21 +1884,15 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1934 if (list_empty(&bond->vlan_list)) { 1884 if (list_empty(&bond->vlan_list)) {
1935 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 1885 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
1936 } else { 1886 } else {
1937 pr_warning(DRV_NAME 1887 pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
1938 ": %s: Warning: clearing HW address of %s while it " 1888 bond_dev->name, bond_dev->name);
1939 "still has VLANs.\n", 1889 pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
1940 bond_dev->name, bond_dev->name); 1890 bond_dev->name);
1941 pr_warning(DRV_NAME
1942 ": %s: When re-adding slaves, make sure the bond's "
1943 "HW address matches its VLANs'.\n",
1944 bond_dev->name);
1945 } 1891 }
1946 } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && 1892 } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
1947 !bond_has_challenged_slaves(bond)) { 1893 !bond_has_challenged_slaves(bond)) {
1948 pr_info(DRV_NAME 1894 pr_info("%s: last VLAN challenged slave %s left bond %s. VLAN blocking is removed\n",
1949 ": %s: last VLAN challenged slave %s " 1895 bond_dev->name, slave_dev->name, bond_dev->name);
1950 "left bond %s. VLAN blocking is removed\n",
1951 bond_dev->name, slave_dev->name, bond_dev->name);
1952 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; 1896 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED;
1953 } 1897 }
1954 1898
@@ -2011,8 +1955,8 @@ int bond_release_and_destroy(struct net_device *bond_dev,
2011 1955
2012 ret = bond_release(bond_dev, slave_dev); 1956 ret = bond_release(bond_dev, slave_dev);
2013 if ((ret == 0) && (bond->slave_cnt == 0)) { 1957 if ((ret == 0) && (bond->slave_cnt == 0)) {
2014 pr_info(DRV_NAME ": %s: destroying bond %s.\n", 1958 pr_info("%s: destroying bond %s.\n",
2015 bond_dev->name, bond_dev->name); 1959 bond_dev->name, bond_dev->name);
2016 unregister_netdevice(bond_dev); 1960 unregister_netdevice(bond_dev);
2017 } 1961 }
2018 return ret; 1962 return ret;
@@ -2116,19 +2060,13 @@ static int bond_release_all(struct net_device *bond_dev)
2116 if (list_empty(&bond->vlan_list)) 2060 if (list_empty(&bond->vlan_list))
2117 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 2061 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
2118 else { 2062 else {
2119 pr_warning(DRV_NAME 2063 pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
2120 ": %s: Warning: clearing HW address of %s while it " 2064 bond_dev->name, bond_dev->name);
2121 "still has VLANs.\n", 2065 pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
2122 bond_dev->name, bond_dev->name); 2066 bond_dev->name);
2123 pr_warning(DRV_NAME
2124 ": %s: When re-adding slaves, make sure the bond's "
2125 "HW address matches its VLANs'.\n",
2126 bond_dev->name);
2127 } 2067 }
2128 2068
2129 pr_info(DRV_NAME 2069 pr_info("%s: released all slaves\n", bond_dev->name);
2130 ": %s: released all slaves\n",
2131 bond_dev->name);
2132 2070
2133out: 2071out:
2134 write_unlock_bh(&bond->lock); 2072 write_unlock_bh(&bond->lock);
@@ -2254,16 +2192,14 @@ static int bond_miimon_inspect(struct bonding *bond)
2254 slave->link = BOND_LINK_FAIL; 2192 slave->link = BOND_LINK_FAIL;
2255 slave->delay = bond->params.downdelay; 2193 slave->delay = bond->params.downdelay;
2256 if (slave->delay) { 2194 if (slave->delay) {
2257 pr_info(DRV_NAME 2195 pr_info("%s: link status down for %sinterface %s, disabling it in %d ms.\n",
2258 ": %s: link status down for %s" 2196 bond->dev->name,
2259 "interface %s, disabling it in %d ms.\n", 2197 (bond->params.mode ==
2260 bond->dev->name, 2198 BOND_MODE_ACTIVEBACKUP) ?
2261 (bond->params.mode == 2199 ((slave->state == BOND_STATE_ACTIVE) ?
2262 BOND_MODE_ACTIVEBACKUP) ? 2200 "active " : "backup ") : "",
2263 ((slave->state == BOND_STATE_ACTIVE) ? 2201 slave->dev->name,
2264 "active " : "backup ") : "", 2202 bond->params.downdelay * bond->params.miimon);
2265 slave->dev->name,
2266 bond->params.downdelay * bond->params.miimon);
2267 } 2203 }
2268 /*FALLTHRU*/ 2204 /*FALLTHRU*/
2269 case BOND_LINK_FAIL: 2205 case BOND_LINK_FAIL:
@@ -2273,13 +2209,11 @@ static int bond_miimon_inspect(struct bonding *bond)
2273 */ 2209 */
2274 slave->link = BOND_LINK_UP; 2210 slave->link = BOND_LINK_UP;
2275 slave->jiffies = jiffies; 2211 slave->jiffies = jiffies;
2276 pr_info(DRV_NAME 2212 pr_info("%s: link status up again after %d ms for interface %s.\n",
2277 ": %s: link status up again after %d " 2213 bond->dev->name,
2278 "ms for interface %s.\n", 2214 (bond->params.downdelay - slave->delay) *
2279 bond->dev->name, 2215 bond->params.miimon,
2280 (bond->params.downdelay - slave->delay) * 2216 slave->dev->name);
2281 bond->params.miimon,
2282 slave->dev->name);
2283 continue; 2217 continue;
2284 } 2218 }
2285 2219
@@ -2300,25 +2234,21 @@ static int bond_miimon_inspect(struct bonding *bond)
2300 slave->delay = bond->params.updelay; 2234 slave->delay = bond->params.updelay;
2301 2235
2302 if (slave->delay) { 2236 if (slave->delay) {
2303 pr_info(DRV_NAME 2237 pr_info("%s: link status up for interface %s, enabling it in %d ms.\n",
2304 ": %s: link status up for " 2238 bond->dev->name, slave->dev->name,
2305 "interface %s, enabling it in %d ms.\n", 2239 ignore_updelay ? 0 :
2306 bond->dev->name, slave->dev->name, 2240 bond->params.updelay *
2307 ignore_updelay ? 0 : 2241 bond->params.miimon);
2308 bond->params.updelay *
2309 bond->params.miimon);
2310 } 2242 }
2311 /*FALLTHRU*/ 2243 /*FALLTHRU*/
2312 case BOND_LINK_BACK: 2244 case BOND_LINK_BACK:
2313 if (!link_state) { 2245 if (!link_state) {
2314 slave->link = BOND_LINK_DOWN; 2246 slave->link = BOND_LINK_DOWN;
2315 pr_info(DRV_NAME 2247 pr_info("%s: link status down again after %d ms for interface %s.\n",
2316 ": %s: link status down again after %d " 2248 bond->dev->name,
2317 "ms for interface %s.\n", 2249 (bond->params.updelay - slave->delay) *
2318 bond->dev->name, 2250 bond->params.miimon,
2319 (bond->params.updelay - slave->delay) * 2251 slave->dev->name);
2320 bond->params.miimon,
2321 slave->dev->name);
2322 2252
2323 continue; 2253 continue;
2324 } 2254 }
@@ -2366,10 +2296,8 @@ static void bond_miimon_commit(struct bonding *bond)
2366 slave->state = BOND_STATE_BACKUP; 2296 slave->state = BOND_STATE_BACKUP;
2367 } 2297 }
2368 2298
2369 pr_info(DRV_NAME 2299 pr_info("%s: link status definitely up for interface %s.\n",
2370 ": %s: link status definitely " 2300 bond->dev->name, slave->dev->name);
2371 "up for interface %s.\n",
2372 bond->dev->name, slave->dev->name);
2373 2301
2374 /* notify ad that the link status has changed */ 2302 /* notify ad that the link status has changed */
2375 if (bond->params.mode == BOND_MODE_8023AD) 2303 if (bond->params.mode == BOND_MODE_8023AD)
@@ -2395,10 +2323,8 @@ static void bond_miimon_commit(struct bonding *bond)
2395 bond->params.mode == BOND_MODE_8023AD) 2323 bond->params.mode == BOND_MODE_8023AD)
2396 bond_set_slave_inactive_flags(slave); 2324 bond_set_slave_inactive_flags(slave);
2397 2325
2398 pr_info(DRV_NAME 2326 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2399 ": %s: link status definitely down for " 2327 bond->dev->name, slave->dev->name);
2400 "interface %s, disabling it\n",
2401 bond->dev->name, slave->dev->name);
2402 2328
2403 if (bond->params.mode == BOND_MODE_8023AD) 2329 if (bond->params.mode == BOND_MODE_8023AD)
2404 bond_3ad_handle_link_change(slave, 2330 bond_3ad_handle_link_change(slave,
@@ -2414,8 +2340,7 @@ static void bond_miimon_commit(struct bonding *bond)
2414 continue; 2340 continue;
2415 2341
2416 default: 2342 default:
2417 pr_err(DRV_NAME 2343 pr_err("%s: invalid new link %d on slave %s\n",
2418 ": %s: invalid new link %d on slave %s\n",
2419 bond->dev->name, slave->new_link, 2344 bond->dev->name, slave->new_link,
2420 slave->dev->name); 2345 slave->dev->name);
2421 slave->new_link = BOND_LINK_NOCHANGE; 2346 slave->new_link = BOND_LINK_NOCHANGE;
@@ -2534,19 +2459,19 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_
2534 struct sk_buff *skb; 2459 struct sk_buff *skb;
2535 2460
2536 pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op, 2461 pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op,
2537 slave_dev->name, dest_ip, src_ip, vlan_id); 2462 slave_dev->name, dest_ip, src_ip, vlan_id);
2538 2463
2539 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, 2464 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip,
2540 NULL, slave_dev->dev_addr, NULL); 2465 NULL, slave_dev->dev_addr, NULL);
2541 2466
2542 if (!skb) { 2467 if (!skb) {
2543 pr_err(DRV_NAME ": ARP packet allocation failed\n"); 2468 pr_err("ARP packet allocation failed\n");
2544 return; 2469 return;
2545 } 2470 }
2546 if (vlan_id) { 2471 if (vlan_id) {
2547 skb = vlan_put_tag(skb, vlan_id); 2472 skb = vlan_put_tag(skb, vlan_id);
2548 if (!skb) { 2473 if (!skb) {
2549 pr_err(DRV_NAME ": failed to insert VLAN tag\n"); 2474 pr_err("failed to insert VLAN tag\n");
2550 return; 2475 return;
2551 } 2476 }
2552 } 2477 }
@@ -2586,9 +2511,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2586 rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl); 2511 rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl);
2587 if (rv) { 2512 if (rv) {
2588 if (net_ratelimit()) { 2513 if (net_ratelimit()) {
2589 pr_warning(DRV_NAME 2514 pr_warning("%s: no route to arp_ip_target %pI4\n",
2590 ": %s: no route to arp_ip_target %pI4\n", 2515 bond->dev->name, &fl.fl4_dst);
2591 bond->dev->name, &fl.fl4_dst);
2592 } 2516 }
2593 continue; 2517 continue;
2594 } 2518 }
@@ -2623,10 +2547,9 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2623 } 2547 }
2624 2548
2625 if (net_ratelimit()) { 2549 if (net_ratelimit()) {
2626 pr_warning(DRV_NAME 2550 pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
2627 ": %s: no path to arp_ip_target %pI4 via rt.dev %s\n", 2551 bond->dev->name, &fl.fl4_dst,
2628 bond->dev->name, &fl.fl4_dst, 2552 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
2629 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
2630 } 2553 }
2631 ip_rt_put(rt); 2554 ip_rt_put(rt);
2632 } 2555 }
@@ -2644,8 +2567,8 @@ static void bond_send_gratuitous_arp(struct bonding *bond)
2644 struct vlan_entry *vlan; 2567 struct vlan_entry *vlan;
2645 struct net_device *vlan_dev; 2568 struct net_device *vlan_dev;
2646 2569
2647 pr_debug("bond_send_grat_arp: bond %s slave %s\n", bond->dev->name, 2570 pr_debug("bond_send_grat_arp: bond %s slave %s\n",
2648 slave ? slave->dev->name : "NULL"); 2571 bond->dev->name, slave ? slave->dev->name : "NULL");
2649 2572
2650 if (!slave || !bond->send_grat_arp || 2573 if (!slave || !bond->send_grat_arp ||
2651 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) 2574 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
@@ -2674,7 +2597,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2674 2597
2675 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { 2598 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
2676 pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", 2599 pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
2677 &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); 2600 &sip, &tip, i, &targets[i],
2601 bond_has_this_ip(bond, tip));
2678 if (sip == targets[i]) { 2602 if (sip == targets[i]) {
2679 if (bond_has_this_ip(bond, tip)) 2603 if (bond_has_this_ip(bond, tip))
2680 slave->last_arp_rx = jiffies; 2604 slave->last_arp_rx = jiffies;
@@ -2698,8 +2622,8 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2698 read_lock(&bond->lock); 2622 read_lock(&bond->lock);
2699 2623
2700 pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", 2624 pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n",
2701 bond->dev->name, skb->dev ? skb->dev->name : "NULL", 2625 bond->dev->name, skb->dev ? skb->dev->name : "NULL",
2702 orig_dev ? orig_dev->name : "NULL"); 2626 orig_dev ? orig_dev->name : "NULL");
2703 2627
2704 slave = bond_get_slave_by_dev(bond, orig_dev); 2628 slave = bond_get_slave_by_dev(bond, orig_dev);
2705 if (!slave || !slave_do_arp_validate(bond, slave)) 2629 if (!slave || !slave_do_arp_validate(bond, slave))
@@ -2724,9 +2648,9 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2724 memcpy(&tip, arp_ptr, 4); 2648 memcpy(&tip, arp_ptr, 4);
2725 2649
2726 pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", 2650 pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
2727 bond->dev->name, slave->dev->name, slave->state, 2651 bond->dev->name, slave->dev->name, slave->state,
2728 bond->params.arp_validate, slave_do_arp_validate(bond, slave), 2652 bond->params.arp_validate, slave_do_arp_validate(bond, slave),
2729 &sip, &tip); 2653 &sip, &tip);
2730 2654
2731 /* 2655 /*
2732 * Backup slaves won't see the ARP reply, but do come through 2656 * Backup slaves won't see the ARP reply, but do come through
@@ -2800,17 +2724,14 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2800 * is closed. 2724 * is closed.
2801 */ 2725 */
2802 if (!oldcurrent) { 2726 if (!oldcurrent) {
2803 pr_info(DRV_NAME 2727 pr_info("%s: link status definitely up for interface %s, ",
2804 ": %s: link status definitely " 2728 bond->dev->name,
2805 "up for interface %s, ", 2729 slave->dev->name);
2806 bond->dev->name,
2807 slave->dev->name);
2808 do_failover = 1; 2730 do_failover = 1;
2809 } else { 2731 } else {
2810 pr_info(DRV_NAME 2732 pr_info("%s: interface %s is now up\n",
2811 ": %s: interface %s is now up\n", 2733 bond->dev->name,
2812 bond->dev->name, 2734 slave->dev->name);
2813 slave->dev->name);
2814 } 2735 }
2815 } 2736 }
2816 } else { 2737 } else {
@@ -2829,10 +2750,9 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2829 if (slave->link_failure_count < UINT_MAX) 2750 if (slave->link_failure_count < UINT_MAX)
2830 slave->link_failure_count++; 2751 slave->link_failure_count++;
2831 2752
2832 pr_info(DRV_NAME 2753 pr_info("%s: interface %s is now down.\n",
2833 ": %s: interface %s is now down.\n", 2754 bond->dev->name,
2834 bond->dev->name, 2755 slave->dev->name);
2835 slave->dev->name);
2836 2756
2837 if (slave == oldcurrent) 2757 if (slave == oldcurrent)
2838 do_failover = 1; 2758 do_failover = 1;
@@ -2965,9 +2885,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2965 slave->link = BOND_LINK_UP; 2885 slave->link = BOND_LINK_UP;
2966 bond->current_arp_slave = NULL; 2886 bond->current_arp_slave = NULL;
2967 2887
2968 pr_info(DRV_NAME 2888 pr_info("%s: link status definitely up for interface %s.\n",
2969 ": %s: link status definitely "
2970 "up for interface %s.\n",
2971 bond->dev->name, slave->dev->name); 2889 bond->dev->name, slave->dev->name);
2972 2890
2973 if (!bond->curr_active_slave || 2891 if (!bond->curr_active_slave ||
@@ -2985,9 +2903,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2985 slave->link = BOND_LINK_DOWN; 2903 slave->link = BOND_LINK_DOWN;
2986 bond_set_slave_inactive_flags(slave); 2904 bond_set_slave_inactive_flags(slave);
2987 2905
2988 pr_info(DRV_NAME 2906 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2989 ": %s: link status definitely down for "
2990 "interface %s, disabling it\n",
2991 bond->dev->name, slave->dev->name); 2907 bond->dev->name, slave->dev->name);
2992 2908
2993 if (slave == bond->curr_active_slave) { 2909 if (slave == bond->curr_active_slave) {
@@ -2998,8 +2914,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2998 continue; 2914 continue;
2999 2915
3000 default: 2916 default:
3001 pr_err(DRV_NAME 2917 pr_err("%s: impossible: new_link %d on slave %s\n",
3002 ": %s: impossible: new_link %d on slave %s\n",
3003 bond->dev->name, slave->new_link, 2918 bond->dev->name, slave->new_link,
3004 slave->dev->name); 2919 slave->dev->name);
3005 continue; 2920 continue;
@@ -3028,9 +2943,9 @@ static void bond_ab_arp_probe(struct bonding *bond)
3028 read_lock(&bond->curr_slave_lock); 2943 read_lock(&bond->curr_slave_lock);
3029 2944
3030 if (bond->current_arp_slave && bond->curr_active_slave) 2945 if (bond->current_arp_slave && bond->curr_active_slave)
3031 pr_info(DRV_NAME "PROBE: c_arp %s && cas %s BAD\n", 2946 pr_info("PROBE: c_arp %s && cas %s BAD\n",
3032 bond->current_arp_slave->dev->name, 2947 bond->current_arp_slave->dev->name,
3033 bond->curr_active_slave->dev->name); 2948 bond->curr_active_slave->dev->name);
3034 2949
3035 if (bond->curr_active_slave) { 2950 if (bond->curr_active_slave) {
3036 bond_arp_send_all(bond, bond->curr_active_slave); 2951 bond_arp_send_all(bond, bond->curr_active_slave);
@@ -3078,9 +2993,8 @@ static void bond_ab_arp_probe(struct bonding *bond)
3078 2993
3079 bond_set_slave_inactive_flags(slave); 2994 bond_set_slave_inactive_flags(slave);
3080 2995
3081 pr_info(DRV_NAME 2996 pr_info("%s: backup interface %s is now down.\n",
3082 ": %s: backup interface %s is now down.\n", 2997 bond->dev->name, slave->dev->name);
3083 bond->dev->name, slave->dev->name);
3084 } 2998 }
3085 } 2999 }
3086} 3000}
@@ -3360,9 +3274,8 @@ static void bond_create_proc_entry(struct bonding *bond)
3360 S_IRUGO, bn->proc_dir, 3274 S_IRUGO, bn->proc_dir,
3361 &bond_info_fops, bond); 3275 &bond_info_fops, bond);
3362 if (bond->proc_entry == NULL) 3276 if (bond->proc_entry == NULL)
3363 pr_warning(DRV_NAME 3277 pr_warning("Warning: Cannot create /proc/net/%s/%s\n",
3364 ": Warning: Cannot create /proc/net/%s/%s\n", 3278 DRV_NAME, bond_dev->name);
3365 DRV_NAME, bond_dev->name);
3366 else 3279 else
3367 memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); 3280 memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
3368 } 3281 }
@@ -3388,9 +3301,8 @@ static void bond_create_proc_dir(struct bond_net *bn)
3388 if (!bn->proc_dir) { 3301 if (!bn->proc_dir) {
3389 bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); 3302 bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
3390 if (!bn->proc_dir) 3303 if (!bn->proc_dir)
3391 pr_warning(DRV_NAME 3304 pr_warning("Warning: cannot create /proc/net/%s\n",
3392 ": Warning: cannot create /proc/net/%s\n", 3305 DRV_NAME);
3393 DRV_NAME);
3394 } 3306 }
3395} 3307}
3396 3308
@@ -3539,8 +3451,8 @@ static int bond_netdev_event(struct notifier_block *this,
3539 struct net_device *event_dev = (struct net_device *)ptr; 3451 struct net_device *event_dev = (struct net_device *)ptr;
3540 3452
3541 pr_debug("event_dev: %s, event: %lx\n", 3453 pr_debug("event_dev: %s, event: %lx\n",
3542 (event_dev ? event_dev->name : "None"), 3454 event_dev ? event_dev->name : "None",
3543 event); 3455 event);
3544 3456
3545 if (!(event_dev->priv_flags & IFF_BONDING)) 3457 if (!(event_dev->priv_flags & IFF_BONDING))
3546 return NOTIFY_DONE; 3458 return NOTIFY_DONE;
@@ -3875,8 +3787,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
3875 struct mii_ioctl_data *mii = NULL; 3787 struct mii_ioctl_data *mii = NULL;
3876 int res = 0; 3788 int res = 0;
3877 3789
3878 pr_debug("bond_ioctl: master=%s, cmd=%d\n", 3790 pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd);
3879 bond_dev->name, cmd);
3880 3791
3881 switch (cmd) { 3792 switch (cmd) {
3882 case SIOCGMIIPHY: 3793 case SIOCGMIIPHY:
@@ -3945,12 +3856,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
3945 3856
3946 slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave); 3857 slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave);
3947 3858
3948 pr_debug("slave_dev=%p: \n", slave_dev); 3859 pr_debug("slave_dev=%p:\n", slave_dev);
3949 3860
3950 if (!slave_dev) 3861 if (!slave_dev)
3951 res = -ENODEV; 3862 res = -ENODEV;
3952 else { 3863 else {
3953 pr_debug("slave_dev->name=%s: \n", slave_dev->name); 3864 pr_debug("slave_dev->name=%s:\n", slave_dev->name);
3954 switch (cmd) { 3865 switch (cmd) {
3955 case BOND_ENSLAVE_OLD: 3866 case BOND_ENSLAVE_OLD:
3956 case SIOCBONDENSLAVE: 3867 case SIOCBONDENSLAVE:
@@ -4059,7 +3970,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
4059 int i; 3970 int i;
4060 3971
4061 pr_debug("bond=%p, name=%s, new_mtu=%d\n", bond, 3972 pr_debug("bond=%p, name=%s, new_mtu=%d\n", bond,
4062 (bond_dev ? bond_dev->name : "None"), new_mtu); 3973 (bond_dev ? bond_dev->name : "None"), new_mtu);
4063 3974
4064 /* Can't hold bond->lock with bh disabled here since 3975 /* Can't hold bond->lock with bh disabled here since
4065 * some base drivers panic. On the other hand we can't 3976 * some base drivers panic. On the other hand we can't
@@ -4077,8 +3988,10 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
4077 */ 3988 */
4078 3989
4079 bond_for_each_slave(bond, slave, i) { 3990 bond_for_each_slave(bond, slave, i) {
4080 pr_debug("s %p s->p %p c_m %p\n", slave, 3991 pr_debug("s %p s->p %p c_m %p\n",
4081 slave->prev, slave->dev->netdev_ops->ndo_change_mtu); 3992 slave,
3993 slave->prev,
3994 slave->dev->netdev_ops->ndo_change_mtu);
4082 3995
4083 res = dev_set_mtu(slave->dev, new_mtu); 3996 res = dev_set_mtu(slave->dev, new_mtu);
4084 3997
@@ -4108,8 +4021,8 @@ unwind:
4108 4021
4109 tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu); 4022 tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu);
4110 if (tmp_res) { 4023 if (tmp_res) {
4111 pr_debug("unwind err %d dev %s\n", tmp_res, 4024 pr_debug("unwind err %d dev %s\n",
4112 slave->dev->name); 4025 tmp_res, slave->dev->name);
4113 } 4026 }
4114 } 4027 }
4115 4028
@@ -4135,7 +4048,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
4135 return bond_alb_set_mac_address(bond_dev, addr); 4048 return bond_alb_set_mac_address(bond_dev, addr);
4136 4049
4137 4050
4138 pr_debug("bond=%p, name=%s\n", bond, (bond_dev ? bond_dev->name : "None")); 4051 pr_debug("bond=%p, name=%s\n",
4052 bond, bond_dev ? bond_dev->name : "None");
4139 4053
4140 /* 4054 /*
4141 * If fail_over_mac is set to active, do nothing and return 4055 * If fail_over_mac is set to active, do nothing and return
@@ -4200,8 +4114,8 @@ unwind:
4200 4114
4201 tmp_res = dev_set_mac_address(slave->dev, &tmp_sa); 4115 tmp_res = dev_set_mac_address(slave->dev, &tmp_sa);
4202 if (tmp_res) { 4116 if (tmp_res) {
4203 pr_debug("unwind err %d dev %s\n", tmp_res, 4117 pr_debug("unwind err %d dev %s\n",
4204 slave->dev->name); 4118 tmp_res, slave->dev->name);
4205 } 4119 }
4206 } 4120 }
4207 4121
@@ -4357,9 +4271,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
4357 if (tx_dev) { 4271 if (tx_dev) {
4358 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); 4272 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
4359 if (!skb2) { 4273 if (!skb2) {
4360 pr_err(DRV_NAME 4274 pr_err("%s: Error: bond_xmit_broadcast(): skb_clone() failed\n",
4361 ": %s: Error: bond_xmit_broadcast(): "
4362 "skb_clone() failed\n",
4363 bond_dev->name); 4275 bond_dev->name);
4364 continue; 4276 continue;
4365 } 4277 }
@@ -4425,8 +4337,8 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
4425 return bond_alb_xmit(skb, dev); 4337 return bond_alb_xmit(skb, dev);
4426 default: 4338 default:
4427 /* Should never happen, mode already checked */ 4339 /* Should never happen, mode already checked */
4428 pr_err(DRV_NAME ": %s: Error: Unknown bonding mode %d\n", 4340 pr_err("%s: Error: Unknown bonding mode %d\n",
4429 dev->name, bond->params.mode); 4341 dev->name, bond->params.mode);
4430 WARN_ON_ONCE(1); 4342 WARN_ON_ONCE(1);
4431 dev_kfree_skb(skb); 4343 dev_kfree_skb(skb);
4432 return NETDEV_TX_OK; 4344 return NETDEV_TX_OK;
@@ -4462,10 +4374,8 @@ void bond_set_mode_ops(struct bonding *bond, int mode)
4462 break; 4374 break;
4463 default: 4375 default:
4464 /* Should never happen, mode already checked */ 4376 /* Should never happen, mode already checked */
4465 pr_err(DRV_NAME 4377 pr_err("%s: Error: Unknown bonding mode %d\n",
4466 ": %s: Error: Unknown bonding mode %d\n", 4378 bond_dev->name, mode);
4467 bond_dev->name,
4468 mode);
4469 break; 4379 break;
4470 } 4380 }
4471} 4381}
@@ -4650,8 +4560,7 @@ static int bond_check_params(struct bond_params *params)
4650 if (mode) { 4560 if (mode) {
4651 bond_mode = bond_parse_parm(mode, bond_mode_tbl); 4561 bond_mode = bond_parse_parm(mode, bond_mode_tbl);
4652 if (bond_mode == -1) { 4562 if (bond_mode == -1) {
4653 pr_err(DRV_NAME 4563 pr_err("Error: Invalid bonding mode \"%s\"\n",
4654 ": Error: Invalid bonding mode \"%s\"\n",
4655 mode == NULL ? "NULL" : mode); 4564 mode == NULL ? "NULL" : mode);
4656 return -EINVAL; 4565 return -EINVAL;
4657 } 4566 }
@@ -4660,16 +4569,13 @@ static int bond_check_params(struct bond_params *params)
4660 if (xmit_hash_policy) { 4569 if (xmit_hash_policy) {
4661 if ((bond_mode != BOND_MODE_XOR) && 4570 if ((bond_mode != BOND_MODE_XOR) &&
4662 (bond_mode != BOND_MODE_8023AD)) { 4571 (bond_mode != BOND_MODE_8023AD)) {
4663 pr_info(DRV_NAME 4572 pr_info("xmit_hash_policy param is irrelevant in mode %s\n",
4664 ": xmit_hash_policy param is irrelevant in"
4665 " mode %s\n",
4666 bond_mode_name(bond_mode)); 4573 bond_mode_name(bond_mode));
4667 } else { 4574 } else {
4668 xmit_hashtype = bond_parse_parm(xmit_hash_policy, 4575 xmit_hashtype = bond_parse_parm(xmit_hash_policy,
4669 xmit_hashtype_tbl); 4576 xmit_hashtype_tbl);
4670 if (xmit_hashtype == -1) { 4577 if (xmit_hashtype == -1) {
4671 pr_err(DRV_NAME 4578 pr_err("Error: Invalid xmit_hash_policy \"%s\"\n",
4672 ": Error: Invalid xmit_hash_policy \"%s\"\n",
4673 xmit_hash_policy == NULL ? "NULL" : 4579 xmit_hash_policy == NULL ? "NULL" :
4674 xmit_hash_policy); 4580 xmit_hash_policy);
4675 return -EINVAL; 4581 return -EINVAL;
@@ -4679,14 +4585,12 @@ static int bond_check_params(struct bond_params *params)
4679 4585
4680 if (lacp_rate) { 4586 if (lacp_rate) {
4681 if (bond_mode != BOND_MODE_8023AD) { 4587 if (bond_mode != BOND_MODE_8023AD) {
4682 pr_info(DRV_NAME 4588 pr_info("lacp_rate param is irrelevant in mode %s\n",
4683 ": lacp_rate param is irrelevant in mode %s\n", 4589 bond_mode_name(bond_mode));
4684 bond_mode_name(bond_mode));
4685 } else { 4590 } else {
4686 lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); 4591 lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl);
4687 if (lacp_fast == -1) { 4592 if (lacp_fast == -1) {
4688 pr_err(DRV_NAME 4593 pr_err("Error: Invalid lacp rate \"%s\"\n",
4689 ": Error: Invalid lacp rate \"%s\"\n",
4690 lacp_rate == NULL ? "NULL" : lacp_rate); 4594 lacp_rate == NULL ? "NULL" : lacp_rate);
4691 return -EINVAL; 4595 return -EINVAL;
4692 } 4596 }
@@ -4696,82 +4600,64 @@ static int bond_check_params(struct bond_params *params)
4696 if (ad_select) { 4600 if (ad_select) {
4697 params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); 4601 params->ad_select = bond_parse_parm(ad_select, ad_select_tbl);
4698 if (params->ad_select == -1) { 4602 if (params->ad_select == -1) {
4699 pr_err(DRV_NAME 4603 pr_err("Error: Invalid ad_select \"%s\"\n",
4700 ": Error: Invalid ad_select \"%s\"\n",
4701 ad_select == NULL ? "NULL" : ad_select); 4604 ad_select == NULL ? "NULL" : ad_select);
4702 return -EINVAL; 4605 return -EINVAL;
4703 } 4606 }
4704 4607
4705 if (bond_mode != BOND_MODE_8023AD) { 4608 if (bond_mode != BOND_MODE_8023AD) {
4706 pr_warning(DRV_NAME 4609 pr_warning("ad_select param only affects 802.3ad mode\n");
4707 ": ad_select param only affects 802.3ad mode\n");
4708 } 4610 }
4709 } else { 4611 } else {
4710 params->ad_select = BOND_AD_STABLE; 4612 params->ad_select = BOND_AD_STABLE;
4711 } 4613 }
4712 4614
4713 if (max_bonds < 0) { 4615 if (max_bonds < 0) {
4714 pr_warning(DRV_NAME 4616 pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
4715 ": Warning: max_bonds (%d) not in range %d-%d, so it " 4617 max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
4716 "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
4717 max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
4718 max_bonds = BOND_DEFAULT_MAX_BONDS; 4618 max_bonds = BOND_DEFAULT_MAX_BONDS;
4719 } 4619 }
4720 4620
4721 if (miimon < 0) { 4621 if (miimon < 0) {
4722 pr_warning(DRV_NAME 4622 pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to %d\n",
4723 ": Warning: miimon module parameter (%d), " 4623 miimon, INT_MAX, BOND_LINK_MON_INTERV);
4724 "not in range 0-%d, so it was reset to %d\n",
4725 miimon, INT_MAX, BOND_LINK_MON_INTERV);
4726 miimon = BOND_LINK_MON_INTERV; 4624 miimon = BOND_LINK_MON_INTERV;
4727 } 4625 }
4728 4626
4729 if (updelay < 0) { 4627 if (updelay < 0) {
4730 pr_warning(DRV_NAME 4628 pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
4731 ": Warning: updelay module parameter (%d), " 4629 updelay, INT_MAX);
4732 "not in range 0-%d, so it was reset to 0\n",
4733 updelay, INT_MAX);
4734 updelay = 0; 4630 updelay = 0;
4735 } 4631 }
4736 4632
4737 if (downdelay < 0) { 4633 if (downdelay < 0) {
4738 pr_warning(DRV_NAME 4634 pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
4739 ": Warning: downdelay module parameter (%d), " 4635 downdelay, INT_MAX);
4740 "not in range 0-%d, so it was reset to 0\n",
4741 downdelay, INT_MAX);
4742 downdelay = 0; 4636 downdelay = 0;
4743 } 4637 }
4744 4638
4745 if ((use_carrier != 0) && (use_carrier != 1)) { 4639 if ((use_carrier != 0) && (use_carrier != 1)) {
4746 pr_warning(DRV_NAME 4640 pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
4747 ": Warning: use_carrier module parameter (%d), " 4641 use_carrier);
4748 "not of valid value (0/1), so it was set to 1\n",
4749 use_carrier);
4750 use_carrier = 1; 4642 use_carrier = 1;
4751 } 4643 }
4752 4644
4753 if (num_grat_arp < 0 || num_grat_arp > 255) { 4645 if (num_grat_arp < 0 || num_grat_arp > 255) {
4754 pr_warning(DRV_NAME 4646 pr_warning("Warning: num_grat_arp (%d) not in range 0-255 so it was reset to 1 \n",
4755 ": Warning: num_grat_arp (%d) not in range 0-255 so it " 4647 num_grat_arp);
4756 "was reset to 1 \n", num_grat_arp);
4757 num_grat_arp = 1; 4648 num_grat_arp = 1;
4758 } 4649 }
4759 4650
4760 if (num_unsol_na < 0 || num_unsol_na > 255) { 4651 if (num_unsol_na < 0 || num_unsol_na > 255) {
4761 pr_warning(DRV_NAME 4652 pr_warning("Warning: num_unsol_na (%d) not in range 0-255 so it was reset to 1 \n",
4762 ": Warning: num_unsol_na (%d) not in range 0-255 so it " 4653 num_unsol_na);
4763 "was reset to 1 \n", num_unsol_na);
4764 num_unsol_na = 1; 4654 num_unsol_na = 1;
4765 } 4655 }
4766 4656
4767 /* reset values for 802.3ad */ 4657 /* reset values for 802.3ad */
4768 if (bond_mode == BOND_MODE_8023AD) { 4658 if (bond_mode == BOND_MODE_8023AD) {
4769 if (!miimon) { 4659 if (!miimon) {
4770 pr_warning(DRV_NAME 4660 pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
4771 ": Warning: miimon must be specified, "
4772 "otherwise bonding will not detect link "
4773 "failure, speed and duplex which are "
4774 "essential for 802.3ad operation\n");
4775 pr_warning("Forcing miimon to 100msec\n"); 4661 pr_warning("Forcing miimon to 100msec\n");
4776 miimon = 100; 4662 miimon = 100;
4777 } 4663 }
@@ -4781,24 +4667,15 @@ static int bond_check_params(struct bond_params *params)
4781 if ((bond_mode == BOND_MODE_TLB) || 4667 if ((bond_mode == BOND_MODE_TLB) ||
4782 (bond_mode == BOND_MODE_ALB)) { 4668 (bond_mode == BOND_MODE_ALB)) {
4783 if (!miimon) { 4669 if (!miimon) {
4784 pr_warning(DRV_NAME 4670 pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
4785 ": Warning: miimon must be specified, "
4786 "otherwise bonding will not detect link "
4787 "failure and link speed which are essential "
4788 "for TLB/ALB load balancing\n");
4789 pr_warning("Forcing miimon to 100msec\n"); 4671 pr_warning("Forcing miimon to 100msec\n");
4790 miimon = 100; 4672 miimon = 100;
4791 } 4673 }
4792 } 4674 }
4793 4675
4794 if (bond_mode == BOND_MODE_ALB) { 4676 if (bond_mode == BOND_MODE_ALB) {
4795 pr_notice(DRV_NAME 4677 pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n",
4796 ": In ALB mode you might experience client " 4678 updelay);
4797 "disconnections upon reconnection of a link if the "
4798 "bonding module updelay parameter (%d msec) is "
4799 "incompatible with the forwarding delay time of the "
4800 "switch\n",
4801 updelay);
4802 } 4679 }
4803 4680
4804 if (!miimon) { 4681 if (!miimon) {
@@ -4806,49 +4683,37 @@ static int bond_check_params(struct bond_params *params)
4806 /* just warn the user the up/down delay will have 4683 /* just warn the user the up/down delay will have
4807 * no effect since miimon is zero... 4684 * no effect since miimon is zero...
4808 */ 4685 */
4809 pr_warning(DRV_NAME 4686 pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
4810 ": Warning: miimon module parameter not set " 4687 updelay, downdelay);
4811 "and updelay (%d) or downdelay (%d) module "
4812 "parameter is set; updelay and downdelay have "
4813 "no effect unless miimon is set\n",
4814 updelay, downdelay);
4815 } 4688 }
4816 } else { 4689 } else {
4817 /* don't allow arp monitoring */ 4690 /* don't allow arp monitoring */
4818 if (arp_interval) { 4691 if (arp_interval) {
4819 pr_warning(DRV_NAME 4692 pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n",
4820 ": Warning: miimon (%d) and arp_interval (%d) " 4693 miimon, arp_interval);
4821 "can't be used simultaneously, disabling ARP "
4822 "monitoring\n",
4823 miimon, arp_interval);
4824 arp_interval = 0; 4694 arp_interval = 0;
4825 } 4695 }
4826 4696
4827 if ((updelay % miimon) != 0) { 4697 if ((updelay % miimon) != 0) {
4828 pr_warning(DRV_NAME 4698 pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
4829 ": Warning: updelay (%d) is not a multiple " 4699 updelay, miimon,
4830 "of miimon (%d), updelay rounded to %d ms\n", 4700 (updelay / miimon) * miimon);
4831 updelay, miimon, (updelay / miimon) * miimon);
4832 } 4701 }
4833 4702
4834 updelay /= miimon; 4703 updelay /= miimon;
4835 4704
4836 if ((downdelay % miimon) != 0) { 4705 if ((downdelay % miimon) != 0) {
4837 pr_warning(DRV_NAME 4706 pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n",
4838 ": Warning: downdelay (%d) is not a multiple " 4707 downdelay, miimon,
4839 "of miimon (%d), downdelay rounded to %d ms\n", 4708 (downdelay / miimon) * miimon);
4840 downdelay, miimon,
4841 (downdelay / miimon) * miimon);
4842 } 4709 }
4843 4710
4844 downdelay /= miimon; 4711 downdelay /= miimon;
4845 } 4712 }
4846 4713
4847 if (arp_interval < 0) { 4714 if (arp_interval < 0) {
4848 pr_warning(DRV_NAME 4715 pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to %d\n",
4849 ": Warning: arp_interval module parameter (%d) " 4716 arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);
4850 ", not in range 0-%d, so it was reset to %d\n",
4851 arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);
4852 arp_interval = BOND_LINK_ARP_INTERV; 4717 arp_interval = BOND_LINK_ARP_INTERV;
4853 } 4718 }
4854 4719
@@ -4858,10 +4723,8 @@ static int bond_check_params(struct bond_params *params)
4858 /* not complete check, but should be good enough to 4723 /* not complete check, but should be good enough to
4859 catch mistakes */ 4724 catch mistakes */
4860 if (!isdigit(arp_ip_target[arp_ip_count][0])) { 4725 if (!isdigit(arp_ip_target[arp_ip_count][0])) {
4861 pr_warning(DRV_NAME 4726 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
4862 ": Warning: bad arp_ip_target module parameter " 4727 arp_ip_target[arp_ip_count]);
4863 "(%s), ARP monitoring will not be performed\n",
4864 arp_ip_target[arp_ip_count]);
4865 arp_interval = 0; 4728 arp_interval = 0;
4866 } else { 4729 } else {
4867 __be32 ip = in_aton(arp_ip_target[arp_ip_count]); 4730 __be32 ip = in_aton(arp_ip_target[arp_ip_count]);
@@ -4871,31 +4734,25 @@ static int bond_check_params(struct bond_params *params)
4871 4734
4872 if (arp_interval && !arp_ip_count) { 4735 if (arp_interval && !arp_ip_count) {
4873 /* don't allow arping if no arp_ip_target given... */ 4736 /* don't allow arping if no arp_ip_target given... */
4874 pr_warning(DRV_NAME 4737 pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
4875 ": Warning: arp_interval module parameter (%d) " 4738 arp_interval);
4876 "specified without providing an arp_ip_target "
4877 "parameter, arp_interval was reset to 0\n",
4878 arp_interval);
4879 arp_interval = 0; 4739 arp_interval = 0;
4880 } 4740 }
4881 4741
4882 if (arp_validate) { 4742 if (arp_validate) {
4883 if (bond_mode != BOND_MODE_ACTIVEBACKUP) { 4743 if (bond_mode != BOND_MODE_ACTIVEBACKUP) {
4884 pr_err(DRV_NAME 4744 pr_err("arp_validate only supported in active-backup mode\n");
4885 ": arp_validate only supported in active-backup mode\n");
4886 return -EINVAL; 4745 return -EINVAL;
4887 } 4746 }
4888 if (!arp_interval) { 4747 if (!arp_interval) {
4889 pr_err(DRV_NAME 4748 pr_err("arp_validate requires arp_interval\n");
4890 ": arp_validate requires arp_interval\n");
4891 return -EINVAL; 4749 return -EINVAL;
4892 } 4750 }
4893 4751
4894 arp_validate_value = bond_parse_parm(arp_validate, 4752 arp_validate_value = bond_parse_parm(arp_validate,
4895 arp_validate_tbl); 4753 arp_validate_tbl);
4896 if (arp_validate_value == -1) { 4754 if (arp_validate_value == -1) {
4897 pr_err(DRV_NAME 4755 pr_err("Error: invalid arp_validate \"%s\"\n",
4898 ": Error: invalid arp_validate \"%s\"\n",
4899 arp_validate == NULL ? "NULL" : arp_validate); 4756 arp_validate == NULL ? "NULL" : arp_validate);
4900 return -EINVAL; 4757 return -EINVAL;
4901 } 4758 }
@@ -4903,17 +4760,14 @@ static int bond_check_params(struct bond_params *params)
4903 arp_validate_value = 0; 4760 arp_validate_value = 0;
4904 4761
4905 if (miimon) { 4762 if (miimon) {
4906 pr_info(DRV_NAME 4763 pr_info("MII link monitoring set to %d ms\n", miimon);
4907 ": MII link monitoring set to %d ms\n",
4908 miimon);
4909 } else if (arp_interval) { 4764 } else if (arp_interval) {
4910 int i; 4765 int i;
4911 4766
4912 pr_info(DRV_NAME ": ARP monitoring set to %d ms," 4767 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
4913 " validate %s, with %d target(s):", 4768 arp_interval,
4914 arp_interval, 4769 arp_validate_tbl[arp_validate_value].modename,
4915 arp_validate_tbl[arp_validate_value].modename, 4770 arp_ip_count);
4916 arp_ip_count);
4917 4771
4918 for (i = 0; i < arp_ip_count; i++) 4772 for (i = 0; i < arp_ip_count; i++)
4919 pr_info(" %s", arp_ip_target[i]); 4773 pr_info(" %s", arp_ip_target[i]);
@@ -4924,21 +4778,15 @@ static int bond_check_params(struct bond_params *params)
4924 /* miimon and arp_interval not set, we need one so things 4778 /* miimon and arp_interval not set, we need one so things
4925 * work as expected, see bonding.txt for details 4779 * work as expected, see bonding.txt for details
4926 */ 4780 */
4927 pr_warning(DRV_NAME 4781 pr_warning("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n");
4928 ": Warning: either miimon or arp_interval and "
4929 "arp_ip_target module parameters must be specified, "
4930 "otherwise bonding will not detect link failures! see "
4931 "bonding.txt for details.\n");
4932 } 4782 }
4933 4783
4934 if (primary && !USES_PRIMARY(bond_mode)) { 4784 if (primary && !USES_PRIMARY(bond_mode)) {
4935 /* currently, using a primary only makes sense 4785 /* currently, using a primary only makes sense
4936 * in active backup, TLB or ALB modes 4786 * in active backup, TLB or ALB modes
4937 */ 4787 */
4938 pr_warning(DRV_NAME 4788 pr_warning("Warning: %s primary device specified but has no effect in %s mode\n",
4939 ": Warning: %s primary device specified but has no " 4789 primary, bond_mode_name(bond_mode));
4940 "effect in %s mode\n",
4941 primary, bond_mode_name(bond_mode));
4942 primary = NULL; 4790 primary = NULL;
4943 } 4791 }
4944 4792
@@ -4946,8 +4794,7 @@ static int bond_check_params(struct bond_params *params)
4946 primary_reselect_value = bond_parse_parm(primary_reselect, 4794 primary_reselect_value = bond_parse_parm(primary_reselect,
4947 pri_reselect_tbl); 4795 pri_reselect_tbl);
4948 if (primary_reselect_value == -1) { 4796 if (primary_reselect_value == -1) {
4949 pr_err(DRV_NAME 4797 pr_err("Error: Invalid primary_reselect \"%s\"\n",
4950 ": Error: Invalid primary_reselect \"%s\"\n",
4951 primary_reselect == 4798 primary_reselect ==
4952 NULL ? "NULL" : primary_reselect); 4799 NULL ? "NULL" : primary_reselect);
4953 return -EINVAL; 4800 return -EINVAL;
@@ -4960,16 +4807,13 @@ static int bond_check_params(struct bond_params *params)
4960 fail_over_mac_value = bond_parse_parm(fail_over_mac, 4807 fail_over_mac_value = bond_parse_parm(fail_over_mac,
4961 fail_over_mac_tbl); 4808 fail_over_mac_tbl);
4962 if (fail_over_mac_value == -1) { 4809 if (fail_over_mac_value == -1) {
4963 pr_err(DRV_NAME 4810 pr_err("Error: invalid fail_over_mac \"%s\"\n",
4964 ": Error: invalid fail_over_mac \"%s\"\n",
4965 arp_validate == NULL ? "NULL" : arp_validate); 4811 arp_validate == NULL ? "NULL" : arp_validate);
4966 return -EINVAL; 4812 return -EINVAL;
4967 } 4813 }
4968 4814
4969 if (bond_mode != BOND_MODE_ACTIVEBACKUP) 4815 if (bond_mode != BOND_MODE_ACTIVEBACKUP)
4970 pr_warning(DRV_NAME 4816 pr_warning("Warning: fail_over_mac only affects active-backup mode.\n");
4971 ": Warning: fail_over_mac only affects "
4972 "active-backup mode.\n");
4973 } else { 4817 } else {
4974 fail_over_mac_value = BOND_FOM_NONE; 4818 fail_over_mac_value = BOND_FOM_NONE;
4975 } 4819 }
@@ -5076,8 +4920,7 @@ int bond_create(struct net *net, const char *name)
5076 bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", 4920 bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
5077 bond_setup); 4921 bond_setup);
5078 if (!bond_dev) { 4922 if (!bond_dev) {
5079 pr_err(DRV_NAME ": %s: eek! can't alloc netdev!\n", 4923 pr_err("%s: eek! can't alloc netdev!\n", name);
5080 name);
5081 res = -ENOMEM; 4924 res = -ENOMEM;
5082 goto out; 4925 goto out;
5083 } 4926 }