aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-07-15 13:35:58 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-16 02:15:57 -0400
commit76444f5052edf6683a735c3bc307e11c121654c5 (patch)
tree3f3300b26b8b1629b21b199522e477343ad833ba /drivers/net/bonding/bond_main.c
parenta84bc2a9013fb123deeca7283480955d021503fb (diff)
bonding: convert bond_main.c to use netdev_printk instead of pr_
Converted only the parts where we've had a valid net_device, skipping the init/deinit and options verification. 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.c342
1 files changed, 162 insertions, 180 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d643807a8e6a..3b96867e99de 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -629,8 +629,8 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
629static void bond_set_dev_addr(struct net_device *bond_dev, 629static void bond_set_dev_addr(struct net_device *bond_dev,
630 struct net_device *slave_dev) 630 struct net_device *slave_dev)
631{ 631{
632 pr_debug("bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", 632 netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n",
633 bond_dev, slave_dev, slave_dev->addr_len); 633 bond_dev, slave_dev, slave_dev->addr_len);
634 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); 634 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
635 bond_dev->addr_assign_type = NET_ADDR_STOLEN; 635 bond_dev->addr_assign_type = NET_ADDR_STOLEN;
636 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev); 636 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
@@ -684,8 +684,8 @@ static void bond_do_fail_over_mac(struct bonding *bond,
684 684
685 rv = dev_set_mac_address(new_active->dev, &saddr); 685 rv = dev_set_mac_address(new_active->dev, &saddr);
686 if (rv) { 686 if (rv) {
687 pr_err("%s: Error %d setting MAC of slave %s\n", 687 netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
688 bond->dev->name, -rv, new_active->dev->name); 688 -rv, new_active->dev->name);
689 goto out; 689 goto out;
690 } 690 }
691 691
@@ -697,14 +697,14 @@ static void bond_do_fail_over_mac(struct bonding *bond,
697 697
698 rv = dev_set_mac_address(old_active->dev, &saddr); 698 rv = dev_set_mac_address(old_active->dev, &saddr);
699 if (rv) 699 if (rv)
700 pr_err("%s: Error %d setting MAC of slave %s\n", 700 netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
701 bond->dev->name, -rv, new_active->dev->name); 701 -rv, new_active->dev->name);
702out: 702out:
703 write_lock_bh(&bond->curr_slave_lock); 703 write_lock_bh(&bond->curr_slave_lock);
704 break; 704 break;
705 default: 705 default:
706 pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n", 706 netdev_err(bond->dev, "bond_do_fail_over_mac impossible: bad policy %d\n",
707 bond->dev->name, bond->params.fail_over_mac); 707 bond->params.fail_over_mac);
708 break; 708 break;
709 } 709 }
710 710
@@ -765,8 +765,8 @@ static bool bond_should_notify_peers(struct bonding *bond)
765 slave = rcu_dereference(bond->curr_active_slave); 765 slave = rcu_dereference(bond->curr_active_slave);
766 rcu_read_unlock(); 766 rcu_read_unlock();
767 767
768 pr_debug("bond_should_notify_peers: bond %s slave %s\n", 768 netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n",
769 bond->dev->name, slave ? slave->dev->name : "NULL"); 769 slave ? slave->dev->name : "NULL");
770 770
771 if (!slave || !bond->send_peer_notif || 771 if (!slave || !bond->send_peer_notif ||
772 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) 772 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
@@ -806,9 +806,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
806 806
807 if (new_active->link == BOND_LINK_BACK) { 807 if (new_active->link == BOND_LINK_BACK) {
808 if (bond_uses_primary(bond)) { 808 if (bond_uses_primary(bond)) {
809 pr_info("%s: making interface %s the new active one %d ms earlier\n", 809 netdev_info(bond->dev, "making interface %s the new active one %d ms earlier\n",
810 bond->dev->name, new_active->dev->name, 810 new_active->dev->name,
811 (bond->params.updelay - new_active->delay) * bond->params.miimon); 811 (bond->params.updelay - new_active->delay) * bond->params.miimon);
812 } 812 }
813 813
814 new_active->delay = 0; 814 new_active->delay = 0;
@@ -821,8 +821,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
821 bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); 821 bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP);
822 } else { 822 } else {
823 if (bond_uses_primary(bond)) { 823 if (bond_uses_primary(bond)) {
824 pr_info("%s: making interface %s the new active one\n", 824 netdev_info(bond->dev, "making interface %s the new active one\n",
825 bond->dev->name, new_active->dev->name); 825 new_active->dev->name);
826 } 826 }
827 } 827 }
828 } 828 }
@@ -911,11 +911,9 @@ void bond_select_active_slave(struct bonding *bond)
911 return; 911 return;
912 912
913 if (netif_carrier_ok(bond->dev)) { 913 if (netif_carrier_ok(bond->dev)) {
914 pr_info("%s: first active interface up!\n", 914 netdev_info(bond->dev, "first active interface up!\n");
915 bond->dev->name);
916 } else { 915 } else {
917 pr_info("%s: now running without any active interface!\n", 916 netdev_info(bond->dev, "now running without any active interface!\n");
918 bond->dev->name);
919 } 917 }
920 } 918 }
921} 919}
@@ -1212,36 +1210,38 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1212 if (!bond->params.use_carrier && 1210 if (!bond->params.use_carrier &&
1213 slave_dev->ethtool_ops->get_link == NULL && 1211 slave_dev->ethtool_ops->get_link == NULL &&
1214 slave_ops->ndo_do_ioctl == NULL) { 1212 slave_ops->ndo_do_ioctl == NULL) {
1215 pr_warn("%s: Warning: no link monitoring support for %s\n", 1213 netdev_warn(bond_dev, "no link monitoring support for %s\n",
1216 bond_dev->name, slave_dev->name); 1214 slave_dev->name);
1217 } 1215 }
1218 1216
1219 /* already enslaved */ 1217 /* already enslaved */
1220 if (slave_dev->flags & IFF_SLAVE) { 1218 if (slave_dev->flags & IFF_SLAVE) {
1221 pr_debug("Error: Device was already enslaved\n"); 1219 netdev_dbg(bond_dev, "Error: Device was already enslaved\n");
1222 return -EBUSY; 1220 return -EBUSY;
1223 } 1221 }
1224 1222
1225 if (bond_dev == slave_dev) { 1223 if (bond_dev == slave_dev) {
1226 pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name); 1224 netdev_err(bond_dev, "cannot enslave bond to itself.\n");
1227 return -EPERM; 1225 return -EPERM;
1228 } 1226 }
1229 1227
1230 /* vlan challenged mutual exclusion */ 1228 /* vlan challenged mutual exclusion */
1231 /* no need to lock since we're protected by rtnl_lock */ 1229 /* no need to lock since we're protected by rtnl_lock */
1232 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { 1230 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
1233 pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); 1231 netdev_dbg(bond_dev, "%s is NETIF_F_VLAN_CHALLENGED\n",
1232 slave_dev->name);
1234 if (vlan_uses_dev(bond_dev)) { 1233 if (vlan_uses_dev(bond_dev)) {
1235 pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n", 1234 netdev_err(bond_dev, "Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
1236 bond_dev->name, slave_dev->name, bond_dev->name); 1235 slave_dev->name, bond_dev->name);
1237 return -EPERM; 1236 return -EPERM;
1238 } else { 1237 } else {
1239 pr_warn("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", 1238 netdev_warn(bond_dev, "enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
1240 bond_dev->name, slave_dev->name, 1239 slave_dev->name, slave_dev->name,
1241 slave_dev->name, bond_dev->name); 1240 bond_dev->name);
1242 } 1241 }
1243 } else { 1242 } else {
1244 pr_debug("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); 1243 netdev_dbg(bond_dev, "%s is !NETIF_F_VLAN_CHALLENGED\n",
1244 slave_dev->name);
1245 } 1245 }
1246 1246
1247 /* 1247 /*
@@ -1251,8 +1251,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1251 * enslaving it; the old ifenslave will not. 1251 * enslaving it; the old ifenslave will not.
1252 */ 1252 */
1253 if ((slave_dev->flags & IFF_UP)) { 1253 if ((slave_dev->flags & IFF_UP)) {
1254 pr_err("%s is up - this may be due to an out of date ifenslave\n", 1254 netdev_err(bond_dev, "%s is up - this may be due to an out of date ifenslave\n",
1255 slave_dev->name); 1255 slave_dev->name);
1256 res = -EPERM; 1256 res = -EPERM;
1257 goto err_undo_flags; 1257 goto err_undo_flags;
1258 } 1258 }
@@ -1266,16 +1266,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1266 */ 1266 */
1267 if (!bond_has_slaves(bond)) { 1267 if (!bond_has_slaves(bond)) {
1268 if (bond_dev->type != slave_dev->type) { 1268 if (bond_dev->type != slave_dev->type) {
1269 pr_debug("%s: change device type from %d to %d\n", 1269 netdev_dbg(bond_dev, "change device type from %d to %d\n",
1270 bond_dev->name, 1270 bond_dev->type, slave_dev->type);
1271 bond_dev->type, slave_dev->type);
1272 1271
1273 res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, 1272 res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
1274 bond_dev); 1273 bond_dev);
1275 res = notifier_to_errno(res); 1274 res = notifier_to_errno(res);
1276 if (res) { 1275 if (res) {
1277 pr_err("%s: refused to change device type\n", 1276 netdev_err(bond_dev, "refused to change device type\n");
1278 bond_dev->name);
1279 res = -EBUSY; 1277 res = -EBUSY;
1280 goto err_undo_flags; 1278 goto err_undo_flags;
1281 } 1279 }
@@ -1295,24 +1293,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1295 bond_dev); 1293 bond_dev);
1296 } 1294 }
1297 } else if (bond_dev->type != slave_dev->type) { 1295 } else if (bond_dev->type != slave_dev->type) {
1298 pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it\n", 1296 netdev_err(bond_dev, "%s ether type (%d) is different from other slaves (%d), can not enslave it\n",
1299 slave_dev->name, slave_dev->type, bond_dev->type); 1297 slave_dev->name, slave_dev->type, bond_dev->type);
1300 res = -EINVAL; 1298 res = -EINVAL;
1301 goto err_undo_flags; 1299 goto err_undo_flags;
1302 } 1300 }
1303 1301
1304 if (slave_ops->ndo_set_mac_address == NULL) { 1302 if (slave_ops->ndo_set_mac_address == NULL) {
1305 pr_warn("%s: Warning: The slave device specified does not support setting the MAC address\n", 1303 netdev_warn(bond_dev, "The slave device specified does not support setting the MAC address\n");
1306 bond_dev->name);
1307 if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && 1304 if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP &&
1308 bond->params.fail_over_mac != BOND_FOM_ACTIVE) { 1305 bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
1309 if (!bond_has_slaves(bond)) { 1306 if (!bond_has_slaves(bond)) {
1310 bond->params.fail_over_mac = BOND_FOM_ACTIVE; 1307 bond->params.fail_over_mac = BOND_FOM_ACTIVE;
1311 pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", 1308 netdev_warn(bond_dev, "Setting fail_over_mac to active for active-backup mode\n");
1312 bond_dev->name);
1313 } else { 1309 } else {
1314 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", 1310 netdev_err(bond_dev, "The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active\n");
1315 bond_dev->name);
1316 res = -EOPNOTSUPP; 1311 res = -EOPNOTSUPP;
1317 goto err_undo_flags; 1312 goto err_undo_flags;
1318 } 1313 }
@@ -1345,7 +1340,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1345 new_slave->original_mtu = slave_dev->mtu; 1340 new_slave->original_mtu = slave_dev->mtu;
1346 res = dev_set_mtu(slave_dev, bond->dev->mtu); 1341 res = dev_set_mtu(slave_dev, bond->dev->mtu);
1347 if (res) { 1342 if (res) {
1348 pr_debug("Error %d calling dev_set_mtu\n", res); 1343 netdev_dbg(bond_dev, "Error %d calling dev_set_mtu\n", res);
1349 goto err_free; 1344 goto err_free;
1350 } 1345 }
1351 1346
@@ -1366,7 +1361,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1366 addr.sa_family = slave_dev->type; 1361 addr.sa_family = slave_dev->type;
1367 res = dev_set_mac_address(slave_dev, &addr); 1362 res = dev_set_mac_address(slave_dev, &addr);
1368 if (res) { 1363 if (res) {
1369 pr_debug("Error %d calling set_mac_address\n", res); 1364 netdev_dbg(bond_dev, "Error %d calling set_mac_address\n", res);
1370 goto err_restore_mtu; 1365 goto err_restore_mtu;
1371 } 1366 }
1372 } 1367 }
@@ -1374,7 +1369,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1374 /* open the slave since the application closed it */ 1369 /* open the slave since the application closed it */
1375 res = dev_open(slave_dev); 1370 res = dev_open(slave_dev);
1376 if (res) { 1371 if (res) {
1377 pr_debug("Opening slave %s failed\n", slave_dev->name); 1372 netdev_dbg(bond_dev, "Opening slave %s failed\n", slave_dev->name);
1378 goto err_restore_mac; 1373 goto err_restore_mac;
1379 } 1374 }
1380 1375
@@ -1424,8 +1419,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1424 1419
1425 res = vlan_vids_add_by_dev(slave_dev, bond_dev); 1420 res = vlan_vids_add_by_dev(slave_dev, bond_dev);
1426 if (res) { 1421 if (res) {
1427 pr_err("%s: Error: Couldn't add bond vlan ids to %s\n", 1422 netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n",
1428 bond_dev->name, slave_dev->name); 1423 slave_dev->name);
1429 goto err_close; 1424 goto err_close;
1430 } 1425 }
1431 1426
@@ -1454,12 +1449,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1454 * supported); thus, we don't need to change 1449 * supported); thus, we don't need to change
1455 * the messages for netif_carrier. 1450 * the messages for netif_carrier.
1456 */ 1451 */
1457 pr_warn("%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", 1452 netdev_warn(bond_dev, "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",
1458 bond_dev->name, slave_dev->name); 1453 slave_dev->name);
1459 } else if (link_reporting == -1) { 1454 } else if (link_reporting == -1) {
1460 /* unable get link status using mii/ethtool */ 1455 /* unable get link status using mii/ethtool */
1461 pr_warn("%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", 1456 netdev_warn(bond_dev, "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",
1462 bond_dev->name, slave_dev->name); 1457 slave_dev->name);
1463 } 1458 }
1464 } 1459 }
1465 1460
@@ -1484,9 +1479,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1484 1479
1485 if (new_slave->link != BOND_LINK_DOWN) 1480 if (new_slave->link != BOND_LINK_DOWN)
1486 new_slave->last_link_up = jiffies; 1481 new_slave->last_link_up = jiffies;
1487 pr_debug("Initial state of slave_dev is BOND_LINK_%s\n", 1482 netdev_dbg(bond_dev, "Initial state of slave_dev is BOND_LINK_%s\n",
1488 new_slave->link == BOND_LINK_DOWN ? "DOWN" : 1483 new_slave->link == BOND_LINK_DOWN ? "DOWN" :
1489 (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); 1484 (new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
1490 1485
1491 if (bond_uses_primary(bond) && bond->params.primary[0]) { 1486 if (bond_uses_primary(bond) && bond->params.primary[0]) {
1492 /* if there is a primary slave, remember it */ 1487 /* if there is a primary slave, remember it */
@@ -1527,7 +1522,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1527 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW); 1522 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
1528 break; 1523 break;
1529 default: 1524 default:
1530 pr_debug("This slave is always active in trunk mode\n"); 1525 netdev_dbg(bond_dev, "This slave is always active in trunk mode\n");
1531 1526
1532 /* always active in trunk mode */ 1527 /* always active in trunk mode */
1533 bond_set_active_slave(new_slave); 1528 bond_set_active_slave(new_slave);
@@ -1547,8 +1542,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1547 slave_dev->npinfo = bond->dev->npinfo; 1542 slave_dev->npinfo = bond->dev->npinfo;
1548 if (slave_dev->npinfo) { 1543 if (slave_dev->npinfo) {
1549 if (slave_enable_netpoll(new_slave)) { 1544 if (slave_enable_netpoll(new_slave)) {
1550 pr_info("Error, %s: master_dev is using netpoll, but new slave device does not support netpoll\n", 1545 netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n");
1551 bond_dev->name);
1552 res = -EBUSY; 1546 res = -EBUSY;
1553 goto err_detach; 1547 goto err_detach;
1554 } 1548 }
@@ -1558,19 +1552,19 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1558 res = netdev_rx_handler_register(slave_dev, bond_handle_frame, 1552 res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
1559 new_slave); 1553 new_slave);
1560 if (res) { 1554 if (res) {
1561 pr_debug("Error %d calling netdev_rx_handler_register\n", res); 1555 netdev_dbg(bond_dev, "Error %d calling netdev_rx_handler_register\n", res);
1562 goto err_detach; 1556 goto err_detach;
1563 } 1557 }
1564 1558
1565 res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave); 1559 res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave);
1566 if (res) { 1560 if (res) {
1567 pr_debug("Error %d calling bond_master_upper_dev_link\n", res); 1561 netdev_dbg(bond_dev, "Error %d calling bond_master_upper_dev_link\n", res);
1568 goto err_unregister; 1562 goto err_unregister;
1569 } 1563 }
1570 1564
1571 res = bond_sysfs_slave_add(new_slave); 1565 res = bond_sysfs_slave_add(new_slave);
1572 if (res) { 1566 if (res) {
1573 pr_debug("Error %d calling bond_sysfs_slave_add\n", res); 1567 netdev_dbg(bond_dev, "Error %d calling bond_sysfs_slave_add\n", res);
1574 goto err_upper_unlink; 1568 goto err_upper_unlink;
1575 } 1569 }
1576 1570
@@ -1586,10 +1580,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1586 unblock_netpoll_tx(); 1580 unblock_netpoll_tx();
1587 } 1581 }
1588 1582
1589 pr_info("%s: Enslaving %s as %s interface with %s link\n", 1583 netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n",
1590 bond_dev->name, slave_dev->name, 1584 slave_dev->name,
1591 bond_is_active_slave(new_slave) ? "an active" : "a backup", 1585 bond_is_active_slave(new_slave) ? "an active" : "a backup",
1592 new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); 1586 new_slave->link != BOND_LINK_DOWN ? "an up" : "a down");
1593 1587
1594 /* enslave is successful */ 1588 /* enslave is successful */
1595 return 0; 1589 return 0;
@@ -1674,8 +1668,8 @@ static int __bond_release_one(struct net_device *bond_dev,
1674 /* slave is not a slave or master is not master of this slave */ 1668 /* slave is not a slave or master is not master of this slave */
1675 if (!(slave_dev->flags & IFF_SLAVE) || 1669 if (!(slave_dev->flags & IFF_SLAVE) ||
1676 !netdev_has_upper_dev(slave_dev, bond_dev)) { 1670 !netdev_has_upper_dev(slave_dev, bond_dev)) {
1677 pr_err("%s: Error: cannot release %s\n", 1671 netdev_err(bond_dev, "cannot release %s\n",
1678 bond_dev->name, slave_dev->name); 1672 slave_dev->name);
1679 return -EINVAL; 1673 return -EINVAL;
1680 } 1674 }
1681 1675
@@ -1684,8 +1678,8 @@ static int __bond_release_one(struct net_device *bond_dev,
1684 slave = bond_get_slave_by_dev(bond, slave_dev); 1678 slave = bond_get_slave_by_dev(bond, slave_dev);
1685 if (!slave) { 1679 if (!slave) {
1686 /* not a slave of this bond */ 1680 /* not a slave of this bond */
1687 pr_info("%s: %s not enslaved\n", 1681 netdev_info(bond_dev, "%s not enslaved\n",
1688 bond_dev->name, slave_dev->name); 1682 slave_dev->name);
1689 unblock_netpoll_tx(); 1683 unblock_netpoll_tx();
1690 return -EINVAL; 1684 return -EINVAL;
1691 } 1685 }
@@ -1705,10 +1699,9 @@ static int __bond_release_one(struct net_device *bond_dev,
1705 1699
1706 write_unlock_bh(&bond->lock); 1700 write_unlock_bh(&bond->lock);
1707 1701
1708 pr_info("%s: Releasing %s interface %s\n", 1702 netdev_info(bond_dev, "Releasing %s interface %s\n",
1709 bond_dev->name, 1703 bond_is_active_slave(slave) ? "active" : "backup",
1710 bond_is_active_slave(slave) ? "active" : "backup", 1704 slave_dev->name);
1711 slave_dev->name);
1712 1705
1713 oldcurrent = rcu_access_pointer(bond->curr_active_slave); 1706 oldcurrent = rcu_access_pointer(bond->curr_active_slave);
1714 1707
@@ -1718,10 +1711,9 @@ static int __bond_release_one(struct net_device *bond_dev,
1718 BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) { 1711 BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) {
1719 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && 1712 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) &&
1720 bond_has_slaves(bond)) 1713 bond_has_slaves(bond))
1721 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", 1714 netdev_warn(bond_dev, "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",
1722 bond_dev->name, slave_dev->name, 1715 slave_dev->name, slave->perm_hwaddr,
1723 slave->perm_hwaddr, 1716 bond_dev->name, slave_dev->name);
1724 bond_dev->name, slave_dev->name);
1725 } 1717 }
1726 1718
1727 if (bond->primary_slave == slave) 1719 if (bond->primary_slave == slave)
@@ -1774,8 +1766,8 @@ static int __bond_release_one(struct net_device *bond_dev,
1774 bond_compute_features(bond); 1766 bond_compute_features(bond);
1775 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && 1767 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
1776 (old_features & NETIF_F_VLAN_CHALLENGED)) 1768 (old_features & NETIF_F_VLAN_CHALLENGED))
1777 pr_info("%s: last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n", 1769 netdev_info(bond_dev, "last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n",
1778 bond_dev->name, slave_dev->name, bond_dev->name); 1770 slave_dev->name, bond_dev->name);
1779 1771
1780 /* must do this from outside any spinlocks */ 1772 /* must do this from outside any spinlocks */
1781 vlan_vids_del_by_dev(slave_dev, bond_dev); 1773 vlan_vids_del_by_dev(slave_dev, bond_dev);
@@ -1842,8 +1834,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
1842 ret = bond_release(bond_dev, slave_dev); 1834 ret = bond_release(bond_dev, slave_dev);
1843 if (ret == 0 && !bond_has_slaves(bond)) { 1835 if (ret == 0 && !bond_has_slaves(bond)) {
1844 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; 1836 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
1845 pr_info("%s: Destroying bond %s\n", 1837 netdev_info(bond_dev, "Destroying bond %s\n",
1846 bond_dev->name, bond_dev->name); 1838 bond_dev->name);
1847 unregister_netdevice(bond_dev); 1839 unregister_netdevice(bond_dev);
1848 } 1840 }
1849 return ret; 1841 return ret;
@@ -1907,14 +1899,13 @@ static int bond_miimon_inspect(struct bonding *bond)
1907 slave->link = BOND_LINK_FAIL; 1899 slave->link = BOND_LINK_FAIL;
1908 slave->delay = bond->params.downdelay; 1900 slave->delay = bond->params.downdelay;
1909 if (slave->delay) { 1901 if (slave->delay) {
1910 pr_info("%s: link status down for %sinterface %s, disabling it in %d ms\n", 1902 netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n",
1911 bond->dev->name, 1903 (BOND_MODE(bond) ==
1912 (BOND_MODE(bond) == 1904 BOND_MODE_ACTIVEBACKUP) ?
1913 BOND_MODE_ACTIVEBACKUP) ? 1905 (bond_is_active_slave(slave) ?
1914 (bond_is_active_slave(slave) ? 1906 "active " : "backup ") : "",
1915 "active " : "backup ") : "", 1907 slave->dev->name,
1916 slave->dev->name, 1908 bond->params.downdelay * bond->params.miimon);
1917 bond->params.downdelay * bond->params.miimon);
1918 } 1909 }
1919 /*FALLTHRU*/ 1910 /*FALLTHRU*/
1920 case BOND_LINK_FAIL: 1911 case BOND_LINK_FAIL:
@@ -1924,11 +1915,10 @@ static int bond_miimon_inspect(struct bonding *bond)
1924 */ 1915 */
1925 slave->link = BOND_LINK_UP; 1916 slave->link = BOND_LINK_UP;
1926 slave->last_link_up = jiffies; 1917 slave->last_link_up = jiffies;
1927 pr_info("%s: link status up again after %d ms for interface %s\n", 1918 netdev_info(bond->dev, "link status up again after %d ms for interface %s\n",
1928 bond->dev->name, 1919 (bond->params.downdelay - slave->delay) *
1929 (bond->params.downdelay - slave->delay) * 1920 bond->params.miimon,
1930 bond->params.miimon, 1921 slave->dev->name);
1931 slave->dev->name);
1932 continue; 1922 continue;
1933 } 1923 }
1934 1924
@@ -1949,21 +1939,20 @@ static int bond_miimon_inspect(struct bonding *bond)
1949 slave->delay = bond->params.updelay; 1939 slave->delay = bond->params.updelay;
1950 1940
1951 if (slave->delay) { 1941 if (slave->delay) {
1952 pr_info("%s: link status up for interface %s, enabling it in %d ms\n", 1942 netdev_info(bond->dev, "link status up for interface %s, enabling it in %d ms\n",
1953 bond->dev->name, slave->dev->name, 1943 slave->dev->name,
1954 ignore_updelay ? 0 : 1944 ignore_updelay ? 0 :
1955 bond->params.updelay * 1945 bond->params.updelay *
1956 bond->params.miimon); 1946 bond->params.miimon);
1957 } 1947 }
1958 /*FALLTHRU*/ 1948 /*FALLTHRU*/
1959 case BOND_LINK_BACK: 1949 case BOND_LINK_BACK:
1960 if (!link_state) { 1950 if (!link_state) {
1961 slave->link = BOND_LINK_DOWN; 1951 slave->link = BOND_LINK_DOWN;
1962 pr_info("%s: link status down again after %d ms for interface %s\n", 1952 netdev_info(bond->dev, "link status down again after %d ms for interface %s\n",
1963 bond->dev->name, 1953 (bond->params.updelay - slave->delay) *
1964 (bond->params.updelay - slave->delay) * 1954 bond->params.miimon,
1965 bond->params.miimon, 1955 slave->dev->name);
1966 slave->dev->name);
1967 1956
1968 continue; 1957 continue;
1969 } 1958 }
@@ -2011,10 +2000,10 @@ static void bond_miimon_commit(struct bonding *bond)
2011 bond_set_backup_slave(slave); 2000 bond_set_backup_slave(slave);
2012 } 2001 }
2013 2002
2014 pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex\n", 2003 netdev_info(bond->dev, "link status definitely up for interface %s, %u Mbps %s duplex\n",
2015 bond->dev->name, slave->dev->name, 2004 slave->dev->name,
2016 slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, 2005 slave->speed == SPEED_UNKNOWN ? 0 : slave->speed,
2017 slave->duplex ? "full" : "half"); 2006 slave->duplex ? "full" : "half");
2018 2007
2019 /* notify ad that the link status has changed */ 2008 /* notify ad that the link status has changed */
2020 if (BOND_MODE(bond) == BOND_MODE_8023AD) 2009 if (BOND_MODE(bond) == BOND_MODE_8023AD)
@@ -2041,8 +2030,8 @@ static void bond_miimon_commit(struct bonding *bond)
2041 bond_set_slave_inactive_flags(slave, 2030 bond_set_slave_inactive_flags(slave,
2042 BOND_SLAVE_NOTIFY_NOW); 2031 BOND_SLAVE_NOTIFY_NOW);
2043 2032
2044 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2033 netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n",
2045 bond->dev->name, slave->dev->name); 2034 slave->dev->name);
2046 2035
2047 if (BOND_MODE(bond) == BOND_MODE_8023AD) 2036 if (BOND_MODE(bond) == BOND_MODE_8023AD)
2048 bond_3ad_handle_link_change(slave, 2037 bond_3ad_handle_link_change(slave,
@@ -2058,9 +2047,8 @@ static void bond_miimon_commit(struct bonding *bond)
2058 continue; 2047 continue;
2059 2048
2060 default: 2049 default:
2061 pr_err("%s: invalid new link %d on slave %s\n", 2050 netdev_err(bond->dev, "invalid new link %d on slave %s\n",
2062 bond->dev->name, slave->new_link, 2051 slave->new_link, slave->dev->name);
2063 slave->dev->name);
2064 slave->new_link = BOND_LINK_NOCHANGE; 2052 slave->new_link = BOND_LINK_NOCHANGE;
2065 2053
2066 continue; 2054 continue;
@@ -2163,8 +2151,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
2163 struct sk_buff *skb; 2151 struct sk_buff *skb;
2164 int i; 2152 int i;
2165 2153
2166 pr_debug("arp %d on slave %s: dst %pI4 src %pI4\n", 2154 netdev_dbg(slave_dev, "arp %d on slave %s: dst %pI4 src %pI4\n",
2167 arp_op, slave_dev->name, &dest_ip, &src_ip); 2155 arp_op, slave_dev->name, &dest_ip, &src_ip);
2168 2156
2169 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, 2157 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip,
2170 NULL, slave_dev->dev_addr, NULL); 2158 NULL, slave_dev->dev_addr, NULL);
@@ -2179,8 +2167,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
2179 if (!tags[i].vlan_id) 2167 if (!tags[i].vlan_id)
2180 continue; 2168 continue;
2181 2169
2182 pr_debug("inner tag: proto %X vid %X\n", 2170 netdev_dbg(slave_dev, "inner tag: proto %X vid %X\n",
2183 ntohs(tags[i].vlan_proto), tags[i].vlan_id); 2171 ntohs(tags[i].vlan_proto), tags[i].vlan_id);
2184 skb = __vlan_put_tag(skb, tags[i].vlan_proto, 2172 skb = __vlan_put_tag(skb, tags[i].vlan_proto,
2185 tags[i].vlan_id); 2173 tags[i].vlan_id);
2186 if (!skb) { 2174 if (!skb) {
@@ -2190,8 +2178,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
2190 } 2178 }
2191 /* Set the outer tag */ 2179 /* Set the outer tag */
2192 if (tags[0].vlan_id) { 2180 if (tags[0].vlan_id) {
2193 pr_debug("outer tag: proto %X vid %X\n", 2181 netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n",
2194 ntohs(tags[0].vlan_proto), tags[0].vlan_id); 2182 ntohs(tags[0].vlan_proto), tags[0].vlan_id);
2195 skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id); 2183 skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id);
2196 if (!skb) { 2184 if (!skb) {
2197 net_err_ratelimited("failed to insert outer VLAN tag\n"); 2185 net_err_ratelimited("failed to insert outer VLAN tag\n");
@@ -2245,7 +2233,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2245 bool ret; 2233 bool ret;
2246 2234
2247 for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) { 2235 for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) {
2248 pr_debug("basa: target %pI4\n", &targets[i]); 2236 netdev_dbg(bond->dev, "basa: target %pI4\n", &targets[i]);
2249 memset(tags, 0, sizeof(tags)); 2237 memset(tags, 0, sizeof(tags));
2250 2238
2251 /* Find out through which dev should the packet go */ 2239 /* Find out through which dev should the packet go */
@@ -2276,9 +2264,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2276 goto found; 2264 goto found;
2277 2265
2278 /* Not our device - skip */ 2266 /* Not our device - skip */
2279 pr_debug("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", 2267 netdev_dbg(bond->dev, "no path to arp_ip_target %pI4 via rt.dev %s\n",
2280 bond->dev->name, &targets[i], 2268 &targets[i], rt->dst.dev ? rt->dst.dev->name : "NULL");
2281 rt->dst.dev ? rt->dst.dev->name : "NULL");
2282 2269
2283 ip_rt_put(rt); 2270 ip_rt_put(rt);
2284 continue; 2271 continue;
@@ -2296,13 +2283,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2296 int i; 2283 int i;
2297 2284
2298 if (!sip || !bond_has_this_ip(bond, tip)) { 2285 if (!sip || !bond_has_this_ip(bond, tip)) {
2299 pr_debug("bva: sip %pI4 tip %pI4 not found\n", &sip, &tip); 2286 netdev_dbg(bond->dev, "bva: sip %pI4 tip %pI4 not found\n",
2287 &sip, &tip);
2300 return; 2288 return;
2301 } 2289 }
2302 2290
2303 i = bond_get_targets_ip(bond->params.arp_targets, sip); 2291 i = bond_get_targets_ip(bond->params.arp_targets, sip);
2304 if (i == -1) { 2292 if (i == -1) {
2305 pr_debug("bva: sip %pI4 not found in targets\n", &sip); 2293 netdev_dbg(bond->dev, "bva: sip %pI4 not found in targets\n",
2294 &sip);
2306 return; 2295 return;
2307 } 2296 }
2308 slave->last_rx = jiffies; 2297 slave->last_rx = jiffies;
@@ -2329,8 +2318,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
2329 2318
2330 alen = arp_hdr_len(bond->dev); 2319 alen = arp_hdr_len(bond->dev);
2331 2320
2332 pr_debug("bond_arp_rcv: bond %s skb->dev %s\n", 2321 netdev_dbg(bond->dev, "bond_arp_rcv: skb->dev %s\n",
2333 bond->dev->name, skb->dev->name); 2322 skb->dev->name);
2334 2323
2335 if (alen > skb_headlen(skb)) { 2324 if (alen > skb_headlen(skb)) {
2336 arp = kmalloc(alen, GFP_ATOMIC); 2325 arp = kmalloc(alen, GFP_ATOMIC);
@@ -2354,10 +2343,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
2354 arp_ptr += 4 + bond->dev->addr_len; 2343 arp_ptr += 4 + bond->dev->addr_len;
2355 memcpy(&tip, arp_ptr, 4); 2344 memcpy(&tip, arp_ptr, 4);
2356 2345
2357 pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", 2346 netdev_dbg(bond->dev, "bond_arp_rcv: %s/%d av %d sv %d sip %pI4 tip %pI4\n",
2358 bond->dev->name, slave->dev->name, bond_slave_state(slave), 2347 slave->dev->name, bond_slave_state(slave),
2359 bond->params.arp_validate, slave_do_arp_validate(bond, slave), 2348 bond->params.arp_validate, slave_do_arp_validate(bond, slave),
2360 &sip, &tip); 2349 &sip, &tip);
2361 2350
2362 curr_active_slave = rcu_dereference(bond->curr_active_slave); 2351 curr_active_slave = rcu_dereference(bond->curr_active_slave);
2363 2352
@@ -2447,14 +2436,12 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
2447 * is closed. 2436 * is closed.
2448 */ 2437 */
2449 if (!oldcurrent) { 2438 if (!oldcurrent) {
2450 pr_info("%s: link status definitely up for interface %s\n", 2439 netdev_info(bond->dev, "link status definitely up for interface %s\n",
2451 bond->dev->name, 2440 slave->dev->name);
2452 slave->dev->name);
2453 do_failover = 1; 2441 do_failover = 1;
2454 } else { 2442 } else {
2455 pr_info("%s: interface %s is now up\n", 2443 netdev_info(bond->dev, "interface %s is now up\n",
2456 bond->dev->name, 2444 slave->dev->name);
2457 slave->dev->name);
2458 } 2445 }
2459 } 2446 }
2460 } else { 2447 } else {
@@ -2473,8 +2460,8 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
2473 if (slave->link_failure_count < UINT_MAX) 2460 if (slave->link_failure_count < UINT_MAX)
2474 slave->link_failure_count++; 2461 slave->link_failure_count++;
2475 2462
2476 pr_info("%s: interface %s is now down\n", 2463 netdev_info(bond->dev, "interface %s is now down\n",
2477 bond->dev->name, slave->dev->name); 2464 slave->dev->name);
2478 2465
2479 if (slave == oldcurrent) 2466 if (slave == oldcurrent)
2480 do_failover = 1; 2467 do_failover = 1;
@@ -2627,8 +2614,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2627 RCU_INIT_POINTER(bond->current_arp_slave, NULL); 2614 RCU_INIT_POINTER(bond->current_arp_slave, NULL);
2628 } 2615 }
2629 2616
2630 pr_info("%s: link status definitely up for interface %s\n", 2617 netdev_info(bond->dev, "link status definitely up for interface %s\n",
2631 bond->dev->name, slave->dev->name); 2618 slave->dev->name);
2632 2619
2633 if (!rtnl_dereference(bond->curr_active_slave) || 2620 if (!rtnl_dereference(bond->curr_active_slave) ||
2634 (slave == bond->primary_slave)) 2621 (slave == bond->primary_slave))
@@ -2646,8 +2633,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2646 bond_set_slave_inactive_flags(slave, 2633 bond_set_slave_inactive_flags(slave,
2647 BOND_SLAVE_NOTIFY_NOW); 2634 BOND_SLAVE_NOTIFY_NOW);
2648 2635
2649 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2636 netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n",
2650 bond->dev->name, slave->dev->name); 2637 slave->dev->name);
2651 2638
2652 if (slave == rtnl_dereference(bond->curr_active_slave)) { 2639 if (slave == rtnl_dereference(bond->curr_active_slave)) {
2653 RCU_INIT_POINTER(bond->current_arp_slave, NULL); 2640 RCU_INIT_POINTER(bond->current_arp_slave, NULL);
@@ -2657,9 +2644,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2657 continue; 2644 continue;
2658 2645
2659 default: 2646 default:
2660 pr_err("%s: impossible: new_link %d on slave %s\n", 2647 netdev_err(bond->dev, "impossible: new_link %d on slave %s\n",
2661 bond->dev->name, slave->new_link, 2648 slave->new_link, slave->dev->name);
2662 slave->dev->name);
2663 continue; 2649 continue;
2664 } 2650 }
2665 2651
@@ -2690,9 +2676,9 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2690 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER; 2676 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2691 2677
2692 if (curr_arp_slave && curr_active_slave) 2678 if (curr_arp_slave && curr_active_slave)
2693 pr_info("PROBE: c_arp %s && cas %s BAD\n", 2679 netdev_info(bond->dev, "PROBE: c_arp %s && cas %s BAD\n",
2694 curr_arp_slave->dev->name, 2680 curr_arp_slave->dev->name,
2695 curr_active_slave->dev->name); 2681 curr_active_slave->dev->name);
2696 2682
2697 if (curr_active_slave) { 2683 if (curr_active_slave) {
2698 bond_arp_send_all(bond, curr_active_slave); 2684 bond_arp_send_all(bond, curr_active_slave);
@@ -2733,8 +2719,8 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2733 bond_set_slave_inactive_flags(slave, 2719 bond_set_slave_inactive_flags(slave,
2734 BOND_SLAVE_NOTIFY_LATER); 2720 BOND_SLAVE_NOTIFY_LATER);
2735 2721
2736 pr_info("%s: backup interface %s is now down\n", 2722 netdev_info(bond->dev, "backup interface %s is now down\n",
2737 bond->dev->name, slave->dev->name); 2723 slave->dev->name);
2738 } 2724 }
2739 if (slave == curr_arp_slave) 2725 if (slave == curr_arp_slave)
2740 found = true; 2726 found = true;
@@ -2930,9 +2916,8 @@ static int bond_slave_netdev_event(unsigned long event,
2930 break; 2916 break;
2931 } 2917 }
2932 2918
2933 pr_info("%s: Primary slave changed to %s, reselecting active slave\n", 2919 netdev_info(bond->dev, "Primary slave changed to %s, reselecting active slave\n",
2934 bond->dev->name, 2920 bond->primary_slave ? slave_dev->name : "none");
2935 bond->primary_slave ? slave_dev->name : "none");
2936 2921
2937 block_netpoll_tx(); 2922 block_netpoll_tx();
2938 write_lock_bh(&bond->curr_slave_lock); 2923 write_lock_bh(&bond->curr_slave_lock);
@@ -2967,19 +2952,18 @@ static int bond_netdev_event(struct notifier_block *this,
2967{ 2952{
2968 struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); 2953 struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
2969 2954
2970 pr_debug("event_dev: %s, event: %lx\n", 2955 netdev_dbg(event_dev, "event: %lx\n", event);
2971 event_dev ? event_dev->name : "None", event);
2972 2956
2973 if (!(event_dev->priv_flags & IFF_BONDING)) 2957 if (!(event_dev->priv_flags & IFF_BONDING))
2974 return NOTIFY_DONE; 2958 return NOTIFY_DONE;
2975 2959
2976 if (event_dev->flags & IFF_MASTER) { 2960 if (event_dev->flags & IFF_MASTER) {
2977 pr_debug("IFF_MASTER\n"); 2961 netdev_dbg(event_dev, "IFF_MASTER\n");
2978 return bond_master_netdev_event(event, event_dev); 2962 return bond_master_netdev_event(event, event_dev);
2979 } 2963 }
2980 2964
2981 if (event_dev->flags & IFF_SLAVE) { 2965 if (event_dev->flags & IFF_SLAVE) {
2982 pr_debug("IFF_SLAVE\n"); 2966 netdev_dbg(event_dev, "IFF_SLAVE\n");
2983 return bond_slave_netdev_event(event, event_dev); 2967 return bond_slave_netdev_event(event, event_dev);
2984 } 2968 }
2985 2969
@@ -3221,7 +3205,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
3221 struct net *net; 3205 struct net *net;
3222 int res = 0; 3206 int res = 0;
3223 3207
3224 pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd); 3208 netdev_dbg(bond_dev, "bond_ioctl: cmd=%d\n", cmd);
3225 3209
3226 switch (cmd) { 3210 switch (cmd) {
3227 case SIOCGMIIPHY: 3211 case SIOCGMIIPHY:
@@ -3291,12 +3275,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
3291 3275
3292 slave_dev = __dev_get_by_name(net, ifr->ifr_slave); 3276 slave_dev = __dev_get_by_name(net, ifr->ifr_slave);
3293 3277
3294 pr_debug("slave_dev=%p:\n", slave_dev); 3278 netdev_dbg(bond_dev, "slave_dev=%p:\n", slave_dev);
3295 3279
3296 if (!slave_dev) 3280 if (!slave_dev)
3297 return -ENODEV; 3281 return -ENODEV;
3298 3282
3299 pr_debug("slave_dev->name=%s:\n", slave_dev->name); 3283 netdev_dbg(bond_dev, "slave_dev->name=%s:\n", slave_dev->name);
3300 switch (cmd) { 3284 switch (cmd) {
3301 case BOND_ENSLAVE_OLD: 3285 case BOND_ENSLAVE_OLD:
3302 case SIOCBONDENSLAVE: 3286 case SIOCBONDENSLAVE:
@@ -3423,8 +3407,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
3423 struct list_head *iter; 3407 struct list_head *iter;
3424 int res = 0; 3408 int res = 0;
3425 3409
3426 pr_debug("bond=%p, name=%s, new_mtu=%d\n", 3410 netdev_dbg(bond_dev, "bond=%p, new_mtu=%d\n", bond, new_mtu);
3427 bond, bond_dev ? bond_dev->name : "None", new_mtu);
3428 3411
3429 /* Can't hold bond->lock with bh disabled here since 3412 /* Can't hold bond->lock with bh disabled here since
3430 * some base drivers panic. On the other hand we can't 3413 * some base drivers panic. On the other hand we can't
@@ -3442,8 +3425,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
3442 */ 3425 */
3443 3426
3444 bond_for_each_slave(bond, slave, iter) { 3427 bond_for_each_slave(bond, slave, iter) {
3445 pr_debug("s %p c_m %p\n", 3428 netdev_dbg(bond_dev, "s %p c_m %p\n",
3446 slave, slave->dev->netdev_ops->ndo_change_mtu); 3429 slave, slave->dev->netdev_ops->ndo_change_mtu);
3447 3430
3448 res = dev_set_mtu(slave->dev, new_mtu); 3431 res = dev_set_mtu(slave->dev, new_mtu);
3449 3432
@@ -3456,7 +3439,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
3456 * means changing their mtu from timer context, which 3439 * means changing their mtu from timer context, which
3457 * is probably not a good idea. 3440 * is probably not a good idea.
3458 */ 3441 */
3459 pr_debug("err %d %s\n", res, slave->dev->name); 3442 netdev_dbg(bond_dev, "err %d %s\n", res,
3443 slave->dev->name);
3460 goto unwind; 3444 goto unwind;
3461 } 3445 }
3462 } 3446 }
@@ -3475,8 +3459,8 @@ unwind:
3475 3459
3476 tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu); 3460 tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu);
3477 if (tmp_res) { 3461 if (tmp_res) {
3478 pr_debug("unwind err %d dev %s\n", 3462 netdev_dbg(bond_dev, "unwind err %d dev %s\n",
3479 tmp_res, rollback_slave->dev->name); 3463 tmp_res, rollback_slave->dev->name);
3480 } 3464 }
3481 } 3465 }
3482 3466
@@ -3502,8 +3486,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
3502 return bond_alb_set_mac_address(bond_dev, addr); 3486 return bond_alb_set_mac_address(bond_dev, addr);
3503 3487
3504 3488
3505 pr_debug("bond=%p, name=%s\n", 3489 netdev_dbg(bond_dev, "bond=%p\n", bond);
3506 bond, bond_dev ? bond_dev->name : "None");
3507 3490
3508 /* If fail_over_mac is enabled, do nothing and return success. 3491 /* If fail_over_mac is enabled, do nothing and return success.
3509 * Returning an error causes ifenslave to fail. 3492 * Returning an error causes ifenslave to fail.
@@ -3531,7 +3514,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
3531 */ 3514 */
3532 3515
3533 bond_for_each_slave(bond, slave, iter) { 3516 bond_for_each_slave(bond, slave, iter) {
3534 pr_debug("slave %p %s\n", slave, slave->dev->name); 3517 netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name);
3535 res = dev_set_mac_address(slave->dev, addr); 3518 res = dev_set_mac_address(slave->dev, addr);
3536 if (res) { 3519 if (res) {
3537 /* TODO: consider downing the slave 3520 /* TODO: consider downing the slave
@@ -3540,7 +3523,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
3540 * breakage anyway until ARP finish 3523 * breakage anyway until ARP finish
3541 * updating, so... 3524 * updating, so...
3542 */ 3525 */
3543 pr_debug("err %d %s\n", res, slave->dev->name); 3526 netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name);
3544 goto unwind; 3527 goto unwind;
3545 } 3528 }
3546 } 3529 }
@@ -3562,8 +3545,8 @@ unwind:
3562 3545
3563 tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa); 3546 tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa);
3564 if (tmp_res) { 3547 if (tmp_res) {
3565 pr_debug("unwind err %d dev %s\n", 3548 netdev_dbg(bond_dev, "unwind err %d dev %s\n",
3566 tmp_res, rollback_slave->dev->name); 3549 tmp_res, rollback_slave->dev->name);
3567 } 3550 }
3568 } 3551 }
3569 3552
@@ -3810,8 +3793,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev
3810 return bond_tlb_xmit(skb, dev); 3793 return bond_tlb_xmit(skb, dev);
3811 default: 3794 default:
3812 /* Should never happen, mode already checked */ 3795 /* Should never happen, mode already checked */
3813 pr_err("%s: Error: Unknown bonding mode %d\n", 3796 netdev_err(dev, "Unknown bonding mode %d\n", BOND_MODE(bond));
3814 dev->name, BOND_MODE(bond));
3815 WARN_ON_ONCE(1); 3797 WARN_ON_ONCE(1);
3816 dev_kfree_skb_any(skb); 3798 dev_kfree_skb_any(skb);
3817 return NETDEV_TX_OK; 3799 return NETDEV_TX_OK;
@@ -3991,7 +3973,7 @@ static void bond_uninit(struct net_device *bond_dev)
3991 /* Release the bonded slaves */ 3973 /* Release the bonded slaves */
3992 bond_for_each_slave(bond, slave, iter) 3974 bond_for_each_slave(bond, slave, iter)
3993 __bond_release_one(bond_dev, slave->dev, true); 3975 __bond_release_one(bond_dev, slave->dev, true);
3994 pr_info("%s: Released all slaves\n", bond_dev->name); 3976 netdev_info(bond_dev, "Released all slaves\n");
3995 3977
3996 list_del(&bond->bond_list); 3978 list_del(&bond->bond_list);
3997 3979
@@ -4380,7 +4362,7 @@ static int bond_init(struct net_device *bond_dev)
4380 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id); 4362 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
4381 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); 4363 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
4382 4364
4383 pr_debug("Begin bond_init for %s\n", bond_dev->name); 4365 netdev_dbg(bond_dev, "Begin bond_init\n");
4384 4366
4385 /* 4367 /*
4386 * Initialize locks that may be required during 4368 * Initialize locks that may be required during