Commit 76444f50 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

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: default avatarVeaceslav Falico <vfalico@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a84bc2a9
...@@ -629,8 +629,8 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, ...@@ -629,8 +629,8 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
static void bond_set_dev_addr(struct net_device *bond_dev, static void bond_set_dev_addr(struct net_device *bond_dev,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
pr_debug("bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n",
bond_dev, slave_dev, slave_dev->addr_len); bond_dev, slave_dev, slave_dev->addr_len);
memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
bond_dev->addr_assign_type = NET_ADDR_STOLEN; bond_dev->addr_assign_type = NET_ADDR_STOLEN;
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev); call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
...@@ -684,8 +684,8 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -684,8 +684,8 @@ static void bond_do_fail_over_mac(struct bonding *bond,
rv = dev_set_mac_address(new_active->dev, &saddr); rv = dev_set_mac_address(new_active->dev, &saddr);
if (rv) { if (rv) {
pr_err("%s: Error %d setting MAC of slave %s\n", netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name); -rv, new_active->dev->name);
goto out; goto out;
} }
...@@ -697,14 +697,14 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -697,14 +697,14 @@ static void bond_do_fail_over_mac(struct bonding *bond,
rv = dev_set_mac_address(old_active->dev, &saddr); rv = dev_set_mac_address(old_active->dev, &saddr);
if (rv) if (rv)
pr_err("%s: Error %d setting MAC of slave %s\n", netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name); -rv, new_active->dev->name);
out: out:
write_lock_bh(&bond->curr_slave_lock); write_lock_bh(&bond->curr_slave_lock);
break; break;
default: default:
pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n", netdev_err(bond->dev, "bond_do_fail_over_mac impossible: bad policy %d\n",
bond->dev->name, bond->params.fail_over_mac); bond->params.fail_over_mac);
break; break;
} }
...@@ -765,8 +765,8 @@ static bool bond_should_notify_peers(struct bonding *bond) ...@@ -765,8 +765,8 @@ static bool bond_should_notify_peers(struct bonding *bond)
slave = rcu_dereference(bond->curr_active_slave); slave = rcu_dereference(bond->curr_active_slave);
rcu_read_unlock(); rcu_read_unlock();
pr_debug("bond_should_notify_peers: bond %s slave %s\n", netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n",
bond->dev->name, slave ? slave->dev->name : "NULL"); slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_peer_notif || if (!slave || !bond->send_peer_notif ||
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) 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,9 +806,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
if (new_active->link == BOND_LINK_BACK) { if (new_active->link == BOND_LINK_BACK) {
if (bond_uses_primary(bond)) { if (bond_uses_primary(bond)) {
pr_info("%s: making interface %s the new active one %d ms earlier\n", netdev_info(bond->dev, "making interface %s the new active one %d ms earlier\n",
bond->dev->name, new_active->dev->name, new_active->dev->name,
(bond->params.updelay - new_active->delay) * bond->params.miimon); (bond->params.updelay - new_active->delay) * bond->params.miimon);
} }
new_active->delay = 0; new_active->delay = 0;
...@@ -821,8 +821,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -821,8 +821,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP);
} else { } else {
if (bond_uses_primary(bond)) { if (bond_uses_primary(bond)) {
pr_info("%s: making interface %s the new active one\n", netdev_info(bond->dev, "making interface %s the new active one\n",
bond->dev->name, new_active->dev->name); new_active->dev->name);
} }
} }
} }
...@@ -911,11 +911,9 @@ void bond_select_active_slave(struct bonding *bond) ...@@ -911,11 +911,9 @@ void bond_select_active_slave(struct bonding *bond)
return; return;
if (netif_carrier_ok(bond->dev)) { if (netif_carrier_ok(bond->dev)) {
pr_info("%s: first active interface up!\n", netdev_info(bond->dev, "first active interface up!\n");
bond->dev->name);
} else { } else {
pr_info("%s: now running without any active interface!\n", netdev_info(bond->dev, "now running without any active interface!\n");
bond->dev->name);
} }
} }
} }
...@@ -1212,36 +1210,38 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1212,36 +1210,38 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.use_carrier && if (!bond->params.use_carrier &&
slave_dev->ethtool_ops->get_link == NULL && slave_dev->ethtool_ops->get_link == NULL &&
slave_ops->ndo_do_ioctl == NULL) { slave_ops->ndo_do_ioctl == NULL) {
pr_warn("%s: Warning: no link monitoring support for %s\n", netdev_warn(bond_dev, "no link monitoring support for %s\n",
bond_dev->name, slave_dev->name); slave_dev->name);
} }
/* already enslaved */ /* already enslaved */
if (slave_dev->flags & IFF_SLAVE) { if (slave_dev->flags & IFF_SLAVE) {
pr_debug("Error: Device was already enslaved\n"); netdev_dbg(bond_dev, "Error: Device was already enslaved\n");
return -EBUSY; return -EBUSY;
} }
if (bond_dev == slave_dev) { if (bond_dev == slave_dev) {
pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name); netdev_err(bond_dev, "cannot enslave bond to itself.\n");
return -EPERM; return -EPERM;
} }
/* vlan challenged mutual exclusion */ /* vlan challenged mutual exclusion */
/* no need to lock since we're protected by rtnl_lock */ /* no need to lock since we're protected by rtnl_lock */
if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); netdev_dbg(bond_dev, "%s is NETIF_F_VLAN_CHALLENGED\n",
slave_dev->name);
if (vlan_uses_dev(bond_dev)) { if (vlan_uses_dev(bond_dev)) {
pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n", netdev_err(bond_dev, "Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
bond_dev->name, slave_dev->name, bond_dev->name); slave_dev->name, bond_dev->name);
return -EPERM; return -EPERM;
} else { } else {
pr_warn("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", netdev_warn(bond_dev, "enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
bond_dev->name, slave_dev->name, slave_dev->name, slave_dev->name,
slave_dev->name, bond_dev->name); bond_dev->name);
} }
} else { } else {
pr_debug("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); netdev_dbg(bond_dev, "%s is !NETIF_F_VLAN_CHALLENGED\n",
slave_dev->name);
} }
/* /*
...@@ -1251,8 +1251,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1251,8 +1251,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
* enslaving it; the old ifenslave will not. * enslaving it; the old ifenslave will not.
*/ */
if ((slave_dev->flags & IFF_UP)) { if ((slave_dev->flags & IFF_UP)) {
pr_err("%s is up - this may be due to an out of date ifenslave\n", netdev_err(bond_dev, "%s is up - this may be due to an out of date ifenslave\n",
slave_dev->name); slave_dev->name);
res = -EPERM; res = -EPERM;
goto err_undo_flags; goto err_undo_flags;
} }
...@@ -1266,16 +1266,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1266,16 +1266,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
*/ */
if (!bond_has_slaves(bond)) { if (!bond_has_slaves(bond)) {
if (bond_dev->type != slave_dev->type) { if (bond_dev->type != slave_dev->type) {
pr_debug("%s: change device type from %d to %d\n", netdev_dbg(bond_dev, "change device type from %d to %d\n",
bond_dev->name, bond_dev->type, slave_dev->type);
bond_dev->type, slave_dev->type);
res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
bond_dev); bond_dev);
res = notifier_to_errno(res); res = notifier_to_errno(res);
if (res) { if (res) {
pr_err("%s: refused to change device type\n", netdev_err(bond_dev, "refused to change device type\n");
bond_dev->name);
res = -EBUSY; res = -EBUSY;
goto err_undo_flags; goto err_undo_flags;
} }
...@@ -1295,24 +1293,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1295,24 +1293,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_dev); bond_dev);
} }
} else if (bond_dev->type != slave_dev->type) { } else if (bond_dev->type != slave_dev->type) {
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it\n", netdev_err(bond_dev, "%s ether type (%d) is different from other slaves (%d), can not enslave it\n",
slave_dev->name, slave_dev->type, bond_dev->type); slave_dev->name, slave_dev->type, bond_dev->type);
res = -EINVAL; res = -EINVAL;
goto err_undo_flags; goto err_undo_flags;
} }
if (slave_ops->ndo_set_mac_address == NULL) { if (slave_ops->ndo_set_mac_address == NULL) {
pr_warn("%s: Warning: The slave device specified does not support setting the MAC address\n", netdev_warn(bond_dev, "The slave device specified does not support setting the MAC address\n");
bond_dev->name);
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP &&
bond->params.fail_over_mac != BOND_FOM_ACTIVE) { bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
if (!bond_has_slaves(bond)) { if (!bond_has_slaves(bond)) {
bond->params.fail_over_mac = BOND_FOM_ACTIVE; bond->params.fail_over_mac = BOND_FOM_ACTIVE;
pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", netdev_warn(bond_dev, "Setting fail_over_mac to active for active-backup mode\n");
bond_dev->name);
} else { } else {
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", 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");
bond_dev->name);
res = -EOPNOTSUPP; res = -EOPNOTSUPP;
goto err_undo_flags; goto err_undo_flags;
} }
...@@ -1345,7 +1340,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1345,7 +1340,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
new_slave->original_mtu = slave_dev->mtu; new_slave->original_mtu = slave_dev->mtu;
res = dev_set_mtu(slave_dev, bond->dev->mtu); res = dev_set_mtu(slave_dev, bond->dev->mtu);
if (res) { if (res) {
pr_debug("Error %d calling dev_set_mtu\n", res); netdev_dbg(bond_dev, "Error %d calling dev_set_mtu\n", res);
goto err_free; goto err_free;
} }
...@@ -1366,7 +1361,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1366,7 +1361,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
addr.sa_family = slave_dev->type; addr.sa_family = slave_dev->type;
res = dev_set_mac_address(slave_dev, &addr); res = dev_set_mac_address(slave_dev, &addr);
if (res) { if (res) {
pr_debug("Error %d calling set_mac_address\n", res); netdev_dbg(bond_dev, "Error %d calling set_mac_address\n", res);
goto err_restore_mtu; goto err_restore_mtu;
} }
} }
...@@ -1374,7 +1369,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1374,7 +1369,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
/* open the slave since the application closed it */ /* open the slave since the application closed it */
res = dev_open(slave_dev); res = dev_open(slave_dev);
if (res) { if (res) {
pr_debug("Opening slave %s failed\n", slave_dev->name); netdev_dbg(bond_dev, "Opening slave %s failed\n", slave_dev->name);
goto err_restore_mac; goto err_restore_mac;
} }
...@@ -1424,8 +1419,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1424,8 +1419,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
res = vlan_vids_add_by_dev(slave_dev, bond_dev); res = vlan_vids_add_by_dev(slave_dev, bond_dev);
if (res) { if (res) {
pr_err("%s: Error: Couldn't add bond vlan ids to %s\n", netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n",
bond_dev->name, slave_dev->name); slave_dev->name);
goto err_close; goto err_close;
} }
...@@ -1454,12 +1449,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1454,12 +1449,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
* supported); thus, we don't need to change * supported); thus, we don't need to change
* the messages for netif_carrier. * the messages for netif_carrier.
*/ */
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", 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",
bond_dev->name, slave_dev->name); slave_dev->name);
} else if (link_reporting == -1) { } else if (link_reporting == -1) {
/* unable get link status using mii/ethtool */ /* unable get link status using mii/ethtool */
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", 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",
bond_dev->name, slave_dev->name); slave_dev->name);
} }
} }
...@@ -1484,9 +1479,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1484,9 +1479,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (new_slave->link != BOND_LINK_DOWN) if (new_slave->link != BOND_LINK_DOWN)
new_slave->last_link_up = jiffies; new_slave->last_link_up = jiffies;
pr_debug("Initial state of slave_dev is BOND_LINK_%s\n", netdev_dbg(bond_dev, "Initial state of slave_dev is BOND_LINK_%s\n",
new_slave->link == BOND_LINK_DOWN ? "DOWN" : new_slave->link == BOND_LINK_DOWN ? "DOWN" :
(new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); (new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
if (bond_uses_primary(bond) && bond->params.primary[0]) { if (bond_uses_primary(bond) && bond->params.primary[0]) {
/* if there is a primary slave, remember it */ /* 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,7 +1522,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW); bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
break; break;
default: default:
pr_debug("This slave is always active in trunk mode\n"); netdev_dbg(bond_dev, "This slave is always active in trunk mode\n");
/* always active in trunk mode */ /* always active in trunk mode */
bond_set_active_slave(new_slave); bond_set_active_slave(new_slave);
...@@ -1547,8 +1542,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1547,8 +1542,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
slave_dev->npinfo = bond->dev->npinfo; slave_dev->npinfo = bond->dev->npinfo;
if (slave_dev->npinfo) { if (slave_dev->npinfo) {
if (slave_enable_netpoll(new_slave)) { if (slave_enable_netpoll(new_slave)) {
pr_info("Error, %s: master_dev is using netpoll, but new slave device does not support netpoll\n", netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n");
bond_dev->name);
res = -EBUSY; res = -EBUSY;
goto err_detach; goto err_detach;
} }
...@@ -1558,19 +1552,19 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1558,19 +1552,19 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
res = netdev_rx_handler_register(slave_dev, bond_handle_frame, res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
new_slave); new_slave);
if (res) { if (res) {
pr_debug("Error %d calling netdev_rx_handler_register\n", res); netdev_dbg(bond_dev, "Error %d calling netdev_rx_handler_register\n", res);
goto err_detach; goto err_detach;
} }
res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave); res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave);
if (res) { if (res) {
pr_debug("Error %d calling bond_master_upper_dev_link\n", res); netdev_dbg(bond_dev, "Error %d calling bond_master_upper_dev_link\n", res);
goto err_unregister; goto err_unregister;
} }
res = bond_sysfs_slave_add(new_slave); res = bond_sysfs_slave_add(new_slave);
if (res) { if (res) {
pr_debug("Error %d calling bond_sysfs_slave_add\n", res); netdev_dbg(bond_dev, "Error %d calling bond_sysfs_slave_add\n", res);
goto err_upper_unlink; goto err_upper_unlink;
} }
...@@ -1586,10 +1580,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1586,10 +1580,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
unblock_netpoll_tx(); unblock_netpoll_tx();
} }
pr_info("%s: Enslaving %s as %s interface with %s link\n", netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n",
bond_dev->name, slave_dev->name, slave_dev->name,
bond_is_active_slave(new_slave) ? "an active" : "a backup", bond_is_active_slave(new_slave) ? "an active" : "a backup",
new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); new_slave->link != BOND_LINK_DOWN ? "an up" : "a down");
/* enslave is successful */ /* enslave is successful */
return 0; return 0;
...@@ -1674,8 +1668,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1674,8 +1668,8 @@ static int __bond_release_one(struct net_device *bond_dev,
/* slave is not a slave or master is not master of this slave */ /* slave is not a slave or master is not master of this slave */
if (!(slave_dev->flags & IFF_SLAVE) || if (!(slave_dev->flags & IFF_SLAVE) ||
!netdev_has_upper_dev(slave_dev, bond_dev)) { !netdev_has_upper_dev(slave_dev, bond_dev)) {
pr_err("%s: Error: cannot release %s\n", netdev_err(bond_dev, "cannot release %s\n",
bond_dev->name, slave_dev->name); slave_dev->name);
return -EINVAL; return -EINVAL;
} }
...@@ -1684,8 +1678,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1684,8 +1678,8 @@ static int __bond_release_one(struct net_device *bond_dev,
slave = bond_get_slave_by_dev(bond, slave_dev); slave = bond_get_slave_by_dev(bond, slave_dev);
if (!slave) { if (!slave) {
/* not a slave of this bond */ /* not a slave of this bond */
pr_info("%s: %s not enslaved\n", netdev_info(bond_dev, "%s not enslaved\n",
bond_dev->name, slave_dev->name); slave_dev->name);
unblock_netpoll_tx(); unblock_netpoll_tx();
return -EINVAL; return -EINVAL;
} }
...@@ -1705,10 +1699,9 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1705,10 +1699,9 @@ static int __bond_release_one(struct net_device *bond_dev,
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
pr_info("%s: Releasing %s interface %s\n", netdev_info(bond_dev, "Releasing %s interface %s\n",
bond_dev->name, bond_is_active_slave(slave) ? "active" : "backup",
bond_is_active_slave(slave) ? "active" : "backup", slave_dev->name);
slave_dev->name);
oldcurrent = rcu_access_pointer(bond->curr_active_slave); oldcurrent = rcu_access_pointer(bond->curr_active_slave);
...@@ -1718,10 +1711,9 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1718,10 +1711,9 @@ static int __bond_release_one(struct net_device *bond_dev,
BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) { BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) {
if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) &&
bond_has_slaves(bond)) bond_has_slaves(bond))
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", 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",
bond_dev->name, slave_dev->name, slave_dev->name, slave->perm_hwaddr,
slave->perm_hwaddr, bond_dev->name, slave_dev->name);
bond_dev->name, slave_dev->name);
} }
if (bond->primary_slave == slave) if (bond->primary_slave == slave)
...@@ -1774,8 +1766,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1774,8 +1766,8 @@ static int __bond_release_one(struct net_device *bond_dev,
bond_compute_features(bond); bond_compute_features(bond);
if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
(old_features & NETIF_F_VLAN_CHALLENGED)) (old_features & NETIF_F_VLAN_CHALLENGED))
pr_info("%s: last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n", netdev_info(bond_dev, "last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n",
bond_dev->name, slave_dev->name, bond_dev->name); slave_dev->name, bond_dev->name);
/* must do this from outside any spinlocks */ /* must do this from outside any spinlocks */
vlan_vids_del_by_dev(slave_dev, bond_dev); 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,8 +1834,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
ret = bond_release(bond_dev, slave_dev); ret = bond_release(bond_dev, slave_dev);
if (ret == 0 && !bond_has_slaves(bond)) { if (ret == 0 && !bond_has_slaves(bond)) {
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
pr_info("%s: Destroying bond %s\n", netdev_info(bond_dev, "Destroying bond %s\n",
bond_dev->name, bond_dev->name); bond_dev->name);
unregister_netdevice(bond_dev); unregister_netdevice(bond_dev);
} }
return ret; return ret;
...@@ -1907,14 +1899,13 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1907,14 +1899,13 @@ static int bond_miimon_inspect(struct bonding *bond)
slave->link = BOND_LINK_FAIL; slave->link = BOND_LINK_FAIL;
slave->delay = bond->params.downdelay; slave->delay = bond->params.downdelay;
if (slave->delay) { if (slave->delay) {
pr_info("%s: link status down for %sinterface %s, disabling it in %d ms\n", netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n",
bond->dev->name, (BOND_MODE(bond) ==
(BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) ?
BOND_MODE_ACTIVEBACKUP) ? (bond_is_active_slave(slave) ?
(bond_is_active_slave(slave) ? "active " : "backup ") : "",
"active " : "backup ") : "", slave->dev->name,
slave->dev->name, bond->params.downdelay * bond->params.miimon);
bond->params.downdelay * bond->params.miimon);
} }
/*FALLTHRU*/ /*FALLTHRU*/
case BOND_LINK_FAIL: case BOND_LINK_FAIL:
...@@ -1924,11 +1915,10 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1924,11 +1915,10 @@ static int bond_miimon_inspect(struct bonding *bond)
*/ */
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
slave->last_link_up = jiffies; slave->last_link_up = jiffies;
pr_info("%s: link status up again after %d ms for interface %s\n", netdev_info(bond->dev, "link status up again after %d ms for interface %s\n",
bond->dev->name, (bond->params.downdelay - slave->delay) *
(bond->params.downdelay - slave->delay) * bond->params.miimon,
bond->params.miimon, slave->dev->name);
slave->dev->name);
continue; continue;
} }
...@@ -1949,21 +1939,20 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1949,21 +1939,20 @@ static int bond_miimon_inspect(struct bonding *bond)
slave->delay = bond->params.updelay; slave->delay = bond->params.updelay;
if (slave->delay) { if (slave->delay) {
pr_info("%s: link status up for interface %s, enabling it in %d ms\n", netdev_info(bond->dev, "link status up for interface %s, enabling it in %d ms\n",
bond->dev->name, slave->dev->name, slave->dev->name,
ignore_updelay ? 0 : ignore_updelay ? 0 :
bond->params.updelay * bond->params.updelay *
bond->params.miimon); bond->params.miimon);
} }
/*FALLTHRU*/ /*FALLTHRU*/
case BOND_LINK_BACK: case BOND_LINK_BACK:
if (!link_state) { if (!link_state) {
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
pr_info("%s: link status down again after %d ms for interface %s\n", netdev_info(bond->dev, "link status down again after %d ms for interface %s\n",
bond->dev->name, (bond->params.updelay - slave->delay) *
(bond->params.updelay - slave->delay) * bond->params.miimon,
bond->params.miimon, slave->dev->name);
slave->dev->name);
continue; continue;
} }
...@@ -2011,10 +2000,10 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2011,10 +2000,10 @@ static void bond_miimon_commit(struct bonding *bond)
bond_set_backup_slave(slave); bond_set_backup_slave(slave);
} }
pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex\n", netdev_info(bond->dev, "link status definitely up for interface %s, %u Mbps %s duplex\n",
bond->dev->name, slave->dev->name, slave->dev->name,
slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, slave->speed == SPEED_UNKNOWN ? 0 : slave->speed,
slave->duplex ? "full" : "half"); slave->duplex ? "full" : "half");
/* notify ad that the link status has changed */ /* notify ad that the link status has changed */
if (BOND_MODE(bond) == BOND_MODE_8023AD) if (BOND_MODE(bond) == BOND_MODE_8023AD)
...@@ -2041,8 +2030,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2041,8 +2030,8 @@ static void bond_miimon_commit(struct bonding *bond)
bond_set_slave_inactive_flags(slave, bond_set_slave_inactive_flags(slave,
BOND_SLAVE_NOTIFY_NOW); BOND_SLAVE_NOTIFY_NOW);
pr_info("%s: link status definitely down for interface %s, disabling it\n", netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n",
bond->dev->name, slave->dev->name); slave->dev->name);
if (BOND_MODE(bond) == BOND_MODE_8023AD) if (BOND_MODE(bond) == BOND_MODE_8023AD)
bond_3ad_handle_link_change(slave, bond_3ad_handle_link_change(slave,
...@@ -2058,9 +2047,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2058,9 +2047,8 @@ static void bond_miimon_commit(struct bonding *bond)
continue; continue;
default: default:
pr_err("%s: invalid new link %d on slave %s\n", netdev_err(bond->dev, "invalid new link %d on slave %s\n",
bond->dev->name, slave->new_link, slave->new_link, slave->dev->name);
slave->dev->name);
slave->new_link = BOND_LINK_NOCHANGE; slave->new_link = BOND_LINK_NOCHANGE;
continue; continue;
...@@ -2163,8 +2151,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2163,8 +2151,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
struct sk_buff *skb; struct sk_buff *skb;
int i; int i;
pr_debug("arp %d on slave %s: dst %pI4 src %pI4\n", netdev_dbg(slave_dev, "arp %d on slave %s: dst %pI4 src %pI4\n",
arp_op, slave_dev->name, &dest_ip, &src_ip); arp_op, slave_dev->name, &dest_ip, &src_ip);
skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip,
NULL, slave_dev->dev_addr, NULL); NULL, slave_dev->dev_addr, NULL);
...@@ -2179,8 +2167,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2179,8 +2167,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
if (!tags[i].vlan_id) if (!tags[i].vlan_id)
continue; continue;
pr_debug("inner tag: proto %X vid %X\n", netdev_dbg(slave_dev, "inner tag: proto %X vid %X\n",
ntohs(tags[i].vlan_proto), tags[i].vlan_id); ntohs(tags[i].vlan_proto), tags[i].vlan_id);
skb = __vlan_put_tag(skb, tags[i].vlan_proto, skb = __vlan_put_tag(skb, tags[i].vlan_proto,
tags[i].vlan_id); tags[i].vlan_id);
if (!skb) { if (!skb) {
...@@ -2190,8 +2178,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2190,8 +2178,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
} }
/* Set the outer tag */ /* Set the outer tag */
if (tags[0].vlan_id) { if (tags[0].vlan_id) {
pr_debug("outer tag: proto %X vid %X\n", netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n",
ntohs(tags[0].vlan_proto), tags[0].vlan_id); ntohs(tags[0].vlan_proto), tags[0].vlan_id);
skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id); skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id);
if (!skb) { if (!skb) {
net_err_ratelimited("failed to insert outer VLAN tag\n"); 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,7 +2233,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
bool ret; bool ret;
for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) { for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) {
pr_debug("basa: target %pI4\n", &targets[i]); netdev_dbg(bond->dev, "basa: target %pI4\n", &targets[i]);
memset(tags, 0, sizeof(tags)); memset(tags, 0, sizeof(tags));
/* Find out through which dev should the packet go */ /* 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,9 +2264,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
goto found; goto found;
/* Not our device - skip */ /* Not our device - skip */
pr_debug("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", netdev_dbg(bond->dev, "no path to arp_ip_target %pI4 via rt.dev %s\n",
bond->dev->name, &targets[i], &targets[i], rt->dst.dev ? rt->dst.dev->name : "NULL");
rt->dst.dev ? rt->dst.dev->name : "NULL");
ip_rt_put(rt); ip_rt_put(rt);
continue; continue;
...@@ -2296,13 +2283,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 ...@@ -2296,13 +2283,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
int i; int i;
if (!sip || !bond_has_this_ip(bond, tip)) { if (!sip || !bond_has_this_ip(bond, tip)) {
pr_debug("bva: sip %pI4 tip %pI4 not found\n", &sip, &tip); netdev_dbg(bond->dev, "bva: sip %pI4 tip %pI4 not found\n",
&sip, &tip);
return; return;
} }
i = bond_get_targets_ip(bond->params.arp_targets, sip); i = bond_get_targets_ip(bond->params.arp_targets, sip);
if (i == -1) { if (i == -1) {
pr_debug("bva: sip %pI4 not found in targets\n", &sip); netdev_dbg(bond->dev, "bva: sip %pI4 not found in targets\n",
&sip);
return; return;
} }
slave->last_rx = jiffies; slave->last_rx = jiffies;
...@@ -2329,8 +2318,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, ...@@ -2329,8 +2318,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
alen = arp_hdr_len(bond->dev); alen = arp_hdr_len(bond->dev);
pr_debug("bond_arp_rcv: bond %s skb->dev %s\n", netdev_dbg(bond->dev, "bond_arp_rcv: skb->dev %s\n",
bond->dev->name, skb->dev->name); skb->dev->name);
if (alen > skb_headlen(skb)) { if (alen > skb_headlen(skb)) {
arp = kmalloc(alen, GFP_ATOMIC); arp = kmalloc(alen, GFP_ATOMIC);
...@@ -2354,10 +2343,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, ...@@ -2354,10 +2343,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
arp_ptr += 4 + bond->dev->addr_len; arp_ptr += 4 + bond->dev->addr_len;
memcpy(&tip, arp_ptr, 4); memcpy(&tip, arp_ptr, 4);
pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", netdev_dbg(bond->dev, "bond_arp_rcv: %s/%d av %d sv %d sip %pI4 tip %pI4\n",
bond->dev->name, slave->dev->name, bond_slave_state(slave), slave->dev->name, bond_slave_state(slave),
bond->params.arp_validate, slave_do_arp_validate(bond, slave), bond->params.arp_validate, slave_do_arp_validate(bond, slave),
&sip, &tip); &sip, &tip);
curr_active_slave = rcu_dereference(bond->curr_active_slave); curr_active_slave = rcu_dereference(bond->curr_active_slave);
...@@ -2447,14 +2436,12 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2447,14 +2436,12 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
* is closed. * is closed.
*/ */
if (!oldcurrent) { if (!oldcurrent) {
pr_info("%s: link status definitely up for interface %s\n", netdev_info(bond->dev, "link status definitely up for interface %s\n",
bond->dev->name, slave->dev->name);
slave->dev->name);
do_failover = 1; do_failover = 1;
} else { } else {
pr_info("%s: interface %s is now up\n", netdev_info(bond->dev, "interface %s is now up\n",
bond->dev->name, slave->dev->name);
slave->dev->name);
} }
} }
} else { } else {
...@@ -2473,8 +2460,8 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2473,8 +2460,8 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
if (slave->link_failure_count < UINT_MAX) if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++; slave->link_failure_count++;
pr_info("%s: interface %s is now down\n", netdev_info(bond->dev, "interface %s is now down\n",
bond->dev->name, slave->dev->name); slave->dev->name);
if (slave == oldcurrent) if (slave == oldcurrent)
do_failover = 1; do_failover = 1;
...@@ -2627,8 +2614,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2627,8 +2614,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
RCU_INIT_POINTER(bond->current_arp_slave, NULL); RCU_INIT_POINTER(bond->current_arp_slave, NULL);
} }
pr_info("%s: link status definitely up for interface %s\n", netdev_info(bond->dev, "link status definitely up for interface %s\n",
bond->dev->name, slave->dev->name); slave->dev->name);
if (!rtnl_dereference(bond->curr_active_slave) || if (!rtnl_dereference(bond->curr_active_slave) ||
(slave == bond->primary_slave)) (slave == bond->primary_slave))
...@@ -2646,8 +2633,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2646,8 +2633,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
bond_set_slave_inactive_flags(slave, bond_set_slave_inactive_flags(slave,
BOND_SLAVE_NOTIFY_NOW); BOND_SLAVE_NOTIFY_NOW);
pr_info("%s: link status definitely down for interface %s, disabling it\n", netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n",
bond->dev->name, slave->dev->name); slave->dev->name);
if (slave == rtnl_dereference(bond->curr_active_slave)) { if (slave == rtnl_dereference(bond->curr_active_slave)) {
RCU_INIT_POINTER(bond->current_arp_slave, NULL); RCU_INIT_POINTER(bond->current_arp_slave, NULL);
...@@ -2657,9 +2644,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2657,9 +2644,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
continue; continue;
default: default:
pr_err("%s: impossible: new_link %d on slave %s\n", netdev_err(bond->dev, "impossible: new_link %d on slave %s\n",
bond->dev->name, slave->new_link, slave->new_link, slave->dev->name);
slave->dev->name);
continue; continue;
} }
...@@ -2690,9 +2676,9 @@ static bool bond_ab_arp_probe(struct bonding *bond) ...@@ -2690,9 +2676,9 @@ static bool bond_ab_arp_probe(struct bonding *bond)
bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER; bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
if (curr_arp_slave && curr_active_slave) if (curr_arp_slave && curr_active_slave)
pr_info("PROBE: c_arp %s && cas %s BAD\n", netdev_info(bond->dev, "PROBE: c_arp %s && cas %s BAD\n",
curr_arp_slave->dev->name, curr_arp_slave->dev->name,
curr_active_slave->dev->name); curr_active_slave->dev->name);
if (curr_active_slave) { if (curr_active_slave) {
bond_arp_send_all(bond, curr_active_slave); bond_arp_send_all(bond, curr_active_slave);
...@@ -2733,8 +2719,8 @@ static bool bond_ab_arp_probe(struct bonding *bond) ...@@ -2733,8 +2719,8 @@ static bool bond_ab_arp_probe(struct bonding *bond)
bond_set_slave_inactive_flags(slave, bond_set_slave_inactive_flags(slave,
BOND_SLAVE_NOTIFY_LATER); BOND_SLAVE_NOTIFY_LATER);
pr_info("%s: backup interface %s is now down\n", netdev_info(bond->dev, "backup interface %s is now down\n",
bond->dev->name, slave->dev->name); slave->dev->name);
} }
if (slave == curr_arp_slave) if (slave == curr_arp_slave)
found = true; found = true;
...@@ -2930,9 +2916,8 @@ static int bond_slave_netdev_event(unsigned long event, ...@@ -2930,9 +2916,8 @@ static int bond_slave_netdev_event(unsigned long event,
break; break;
} }
pr_info("%s: Primary slave changed to %s, reselecting active slave\n", netdev_info(bond->dev, "Primary slave changed to %s, reselecting active slave\n",
bond->dev->name, bond->primary_slave ? slave_dev->name : "none");
bond->primary_slave ? slave_dev->name : "none");
block_netpoll_tx(); block_netpoll_tx();
write_lock_bh(&bond->curr_slave_lock); write_lock_bh(&bond->curr_slave_lock);
...@@ -2967,19 +2952,18 @@ static int bond_netdev_event(struct notifier_block *this, ...@@ -2967,19 +2952,18 @@ static int bond_netdev_event(struct notifier_block *this,
{ {
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
pr_debug("event_dev: %s, event: %lx\n", netdev_dbg(event_dev, "event: %lx\n", event);
event_dev ? event_dev->name : "None", event);
if (!(event_dev->priv_flags & IFF_BONDING)) if (!(event_dev->priv_flags & IFF_BONDING))
return NOTIFY_DONE; return NOTIFY_DONE;
if (event_dev->flags & IFF_MASTER) { if (event_dev->flags & IFF_MASTER) {
pr_debug("IFF_MASTER\n"); netdev_dbg(event_dev, "IFF_MASTER\n");
return bond_master_netdev_event(event, event_dev); return bond_master_netdev_event(event, event_dev);
} }
if (event_dev->flags & IFF_SLAVE) { if (event_dev->flags & IFF_SLAVE) {
pr_debug("IFF_SLAVE\n"); netdev_dbg(event_dev, "IFF_SLAVE\n");
return bond_slave_netdev_event(event, event_dev); return bond_slave_netdev_event(event, event_dev);
} }
...@@ -3221,7 +3205,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3221,7 +3205,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
struct net *net; struct net *net;
int res = 0; int res = 0;
pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd); netdev_dbg(bond_dev, "bond_ioctl: cmd=%d\n", cmd);
switch (cmd) { switch (cmd) {
case SIOCGMIIPHY: case SIOCGMIIPHY:
...@@ -3291,12 +3275,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3291,12 +3275,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
slave_dev = __dev_get_by_name(net, ifr->ifr_slave); slave_dev = __dev_get_by_name(net, ifr->ifr_slave);
pr_debug("slave_dev=%p:\n", slave_dev); netdev_dbg(bond_dev, "slave_dev=%p:\n", slave_dev);
if (!slave_dev) if (!slave_dev)
return -ENODEV; return -ENODEV;
pr_debug("slave_dev->name=%s:\n", slave_dev->name); netdev_dbg(bond_dev, "slave_dev->name=%s:\n", slave_dev->name);
switch (cmd) { switch (cmd) {
case BOND_ENSLAVE_OLD: case BOND_ENSLAVE_OLD:
case SIOCBONDENSLAVE: case SIOCBONDENSLAVE:
...@@ -3423,8 +3407,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3423,8 +3407,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
struct list_head *iter; struct list_head *iter;
int res = 0; int res = 0;
pr_debug("bond=%p, name=%s, new_mtu=%d\n", netdev_dbg(bond_dev, "bond=%p, new_mtu=%d\n", bond, new_mtu);
bond, bond_dev ? bond_dev->name : "None", new_mtu);
/* Can't hold bond->lock with bh disabled here since /* Can't hold bond->lock with bh disabled here since
* some base drivers panic. On the other hand we can't * 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,8 +3425,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
*/ */
bond_for_each_slave(bond, slave, iter) { bond_for_each_slave(bond, slave, iter) {
pr_debug("s %p c_m %p\n", netdev_dbg(bond_dev, "s %p c_m %p\n",
slave, slave->dev->netdev_ops->ndo_change_mtu); slave, slave->dev->netdev_ops->ndo_change_mtu);
res = dev_set_mtu(slave->dev, new_mtu); res = dev_set_mtu(slave->dev, new_mtu);
...@@ -3456,7 +3439,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3456,7 +3439,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
* means changing their mtu from timer context, which * means changing their mtu from timer context, which
* is probably not a good idea. * is probably not a good idea.
*/ */
pr_debug("err %d %s\n", res, slave->dev->name); netdev_dbg(bond_dev, "err %d %s\n", res,
slave->dev->name);
goto unwind; goto unwind;
} }
} }
...@@ -3475,8 +3459,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3475,8 +3459,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu); tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu);
if (tmp_res) { if (tmp_res) {
pr_debug("unwind err %d dev %s\n", netdev_dbg(bond_dev, "unwind err %d dev %s\n",
tmp_res, rollback_slave->dev->name); tmp_res, rollback_slave->dev->name);
} }
} }
...@@ -3502,8 +3486,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3502,8 +3486,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
return bond_alb_set_mac_address(bond_dev, addr); return bond_alb_set_mac_address(bond_dev, addr);
pr_debug("bond=%p, name=%s\n", netdev_dbg(bond_dev, "bond=%p\n", bond);
bond, bond_dev ? bond_dev->name : "None");
/* If fail_over_mac is enabled, do nothing and return success. /* If fail_over_mac is enabled, do nothing and return success.
* Returning an error causes ifenslave to fail. * 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,7 +3514,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
*/ */
bond_for_each_slave(bond, slave, iter) { bond_for_each_slave(bond, slave, iter) {
pr_debug("slave %p %s\n", slave, slave->dev->name); netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name);
res = dev_set_mac_address(slave->dev, addr); res = dev_set_mac_address(slave->dev, addr);
if (res) { if (res) {
/* TODO: consider downing the slave /* TODO: consider downing the slave
...@@ -3540,7 +3523,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3540,7 +3523,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
* breakage anyway until ARP finish * breakage anyway until ARP finish
* updating, so... * updating, so...
*/ */
pr_debug("err %d %s\n", res, slave->dev->name); netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name);
goto unwind; goto unwind;
} }
} }
...@@ -3562,8 +3545,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3562,8 +3545,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa); tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa);
if (tmp_res) { if (tmp_res) {
pr_debug("unwind err %d dev %s\n", netdev_dbg(bond_dev, "unwind err %d dev %s\n",
tmp_res, rollback_slave->dev->name); tmp_res, rollback_slave->dev->name);
} }
} }
...@@ -3810,8 +3793,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev ...@@ -3810,8 +3793,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev
return bond_tlb_xmit(skb, dev); return bond_tlb_xmit(skb, dev);
default: default:
/* Should never happen, mode already checked */ /* Should never happen, mode already checked */
pr_err("%s: Error: Unknown bonding mode %d\n", netdev_err(dev, "Unknown bonding mode %d\n", BOND_MODE(bond));
dev->name, BOND_MODE(bond));
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -3991,7 +3973,7 @@ static void bond_uninit(struct net_device *bond_dev) ...@@ -3991,7 +3973,7 @@ static void bond_uninit(struct net_device *bond_dev)
/* Release the bonded slaves */ /* Release the bonded slaves */
bond_for_each_slave(bond, slave, iter) bond_for_each_slave(bond, slave, iter)
__bond_release_one(bond_dev, slave->dev, true); __bond_release_one(bond_dev, slave->dev, true);
pr_info("%s: Released all slaves\n", bond_dev->name); netdev_info(bond_dev, "Released all slaves\n");
list_del(&bond->bond_list); list_del(&bond->bond_list);
...@@ -4380,7 +4362,7 @@ static int bond_init(struct net_device *bond_dev) ...@@ -4380,7 +4362,7 @@ static int bond_init(struct net_device *bond_dev)
struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id); struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
pr_debug("Begin bond_init for %s\n", bond_dev->name); netdev_dbg(bond_dev, "Begin bond_init\n");
/* /*
* Initialize locks that may be required during * Initialize locks that may be required during
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment