Commit 7a575f6b authored by David S. Miller's avatar David S. Miller

Merge branch 'bonding-next'

Veaceslav Falico says:

====================
bonding: convert pr_* to netdev_*

Currently bonding uses pr_info/warn/etc. function to print something, while
it's encouraged to use netdev_info/warn/etc. in net/.

This patchset converts them where possible (i.e. where we have a working
net_device). Also, convert pr_ratelimit* to net_() and remove the pr_fmt,
to unify netdev_* and pr_* outputs.
====================

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>
parents a84bc2a9 cb252358
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -301,7 +299,7 @@ static u16 __get_link_speed(struct port *port) ...@@ -301,7 +299,7 @@ static u16 __get_link_speed(struct port *port)
} }
} }
pr_debug("Port %d Received link speed %d update from adapter\n", netdev_dbg(slave->bond->dev, "Port %d Received link speed %d update from adapter\n",
port->actor_port_number, speed); port->actor_port_number, speed);
return speed; return speed;
} }
...@@ -329,13 +327,13 @@ static u8 __get_duplex(struct port *port) ...@@ -329,13 +327,13 @@ static u8 __get_duplex(struct port *port)
switch (slave->duplex) { switch (slave->duplex) {
case DUPLEX_FULL: case DUPLEX_FULL:
retval = 0x1; retval = 0x1;
pr_debug("Port %d Received status full duplex update from adapter\n", netdev_dbg(slave->bond->dev, "Port %d Received status full duplex update from adapter\n",
port->actor_port_number); port->actor_port_number);
break; break;
case DUPLEX_HALF: case DUPLEX_HALF:
default: default:
retval = 0x0; retval = 0x0;
pr_debug("Port %d Received status NOT full duplex update from adapter\n", netdev_dbg(slave->bond->dev, "Port %d Received status NOT full duplex update from adapter\n",
port->actor_port_number); port->actor_port_number);
break; break;
} }
...@@ -1079,9 +1077,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1079,9 +1077,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
/* detect loopback situation */ /* detect loopback situation */
if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system), if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
&(port->actor_system))) { &(port->actor_system))) {
pr_err("%s: An illegal loopback occurred on adapter (%s)\n" netdev_err(port->slave->bond->dev, "An illegal loopback occurred on adapter (%s)\n"
"Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n",
port->slave->bond->dev->name,
port->slave->dev->name); port->slave->dev->name);
return; return;
} }
...@@ -1269,7 +1266,7 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1269,7 +1266,7 @@ static void ad_port_selection_logic(struct port *port)
port->next_port_in_aggregator = NULL; port->next_port_in_aggregator = NULL;
port->actor_port_aggregator_identifier = 0; port->actor_port_aggregator_identifier = 0;
pr_debug("Port %d left LAG %d\n", netdev_dbg(bond->dev, "Port %d left LAG %d\n",
port->actor_port_number, port->actor_port_number,
temp_aggregator->aggregator_identifier); temp_aggregator->aggregator_identifier);
/* if the aggregator is empty, clear its /* if the aggregator is empty, clear its
...@@ -1284,7 +1281,7 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1284,7 +1281,7 @@ static void ad_port_selection_logic(struct port *port)
/* meaning: the port was related to an aggregator /* meaning: the port was related to an aggregator
* but was not on the aggregator port list * but was not on the aggregator port list
*/ */
pr_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", net_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n",
port->slave->bond->dev->name, port->slave->bond->dev->name,
port->actor_port_number, port->actor_port_number,
port->slave->dev->name, port->slave->dev->name,
...@@ -1318,7 +1315,7 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1318,7 +1315,7 @@ static void ad_port_selection_logic(struct port *port)
port->next_port_in_aggregator = aggregator->lag_ports; port->next_port_in_aggregator = aggregator->lag_ports;
port->aggregator->num_of_ports++; port->aggregator->num_of_ports++;
aggregator->lag_ports = port; aggregator->lag_ports = port;
pr_debug("Port %d joined LAG %d(existing LAG)\n", netdev_dbg(bond->dev, "Port %d joined LAG %d(existing LAG)\n",
port->actor_port_number, port->actor_port_number,
port->aggregator->aggregator_identifier); port->aggregator->aggregator_identifier);
...@@ -1363,12 +1360,11 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1363,12 +1360,11 @@ static void ad_port_selection_logic(struct port *port)
/* mark this port as selected */ /* mark this port as selected */
port->sm_vars |= AD_PORT_SELECTED; port->sm_vars |= AD_PORT_SELECTED;
pr_debug("Port %d joined LAG %d(new LAG)\n", netdev_dbg(bond->dev, "Port %d joined LAG %d(new LAG)\n",
port->actor_port_number, port->actor_port_number,
port->aggregator->aggregator_identifier); port->aggregator->aggregator_identifier);
} else { } else {
pr_err("%s: Port %d (on %s) did not find a suitable aggregator\n", netdev_err(bond->dev, "Port %d (on %s) did not find a suitable aggregator\n",
port->slave->bond->dev->name,
port->actor_port_number, port->slave->dev->name); port->actor_port_number, port->slave->dev->name);
} }
} }
...@@ -1445,7 +1441,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, ...@@ -1445,7 +1441,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
break; break;
default: default:
pr_warn_ratelimited("%s: Impossible agg select mode %d\n", net_warn_ratelimited("%s: Impossible agg select mode %d\n",
curr->slave->bond->dev->name, curr->slave->bond->dev->name,
__get_agg_selection_mode(curr->lag_ports)); __get_agg_selection_mode(curr->lag_ports));
break; break;
...@@ -1539,19 +1535,19 @@ static void ad_agg_selection_logic(struct aggregator *agg) ...@@ -1539,19 +1535,19 @@ static void ad_agg_selection_logic(struct aggregator *agg)
/* if there is new best aggregator, activate it */ /* if there is new best aggregator, activate it */
if (best) { if (best) {
pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", netdev_dbg(bond->dev, "best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
best->aggregator_identifier, best->num_of_ports, best->aggregator_identifier, best->num_of_ports,
best->actor_oper_aggregator_key, best->actor_oper_aggregator_key,
best->partner_oper_aggregator_key, best->partner_oper_aggregator_key,
best->is_individual, best->is_active); best->is_individual, best->is_active);
pr_debug("best ports %p slave %p %s\n", netdev_dbg(bond->dev, "best ports %p slave %p %s\n",
best->lag_ports, best->slave, best->lag_ports, best->slave,
best->slave ? best->slave->dev->name : "NULL"); best->slave ? best->slave->dev->name : "NULL");
bond_for_each_slave_rcu(bond, slave, iter) { bond_for_each_slave_rcu(bond, slave, iter) {
agg = &(SLAVE_AD_INFO(slave)->aggregator); agg = &(SLAVE_AD_INFO(slave)->aggregator);
pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
agg->aggregator_identifier, agg->num_of_ports, agg->aggregator_identifier, agg->num_of_ports,
agg->actor_oper_aggregator_key, agg->actor_oper_aggregator_key,
agg->partner_oper_aggregator_key, agg->partner_oper_aggregator_key,
...@@ -1560,15 +1556,15 @@ static void ad_agg_selection_logic(struct aggregator *agg) ...@@ -1560,15 +1556,15 @@ static void ad_agg_selection_logic(struct aggregator *agg)
/* check if any partner replys */ /* check if any partner replys */
if (best->is_individual) { if (best->is_individual) {
pr_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", net_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
best->slave ? best->slave ?
best->slave->bond->dev->name : "NULL"); best->slave->bond->dev->name : "NULL");
} }
best->is_active = 1; best->is_active = 1;
pr_debug("LAG %d chosen as the active LAG\n", netdev_dbg(bond->dev, "LAG %d chosen as the active LAG\n",
best->aggregator_identifier); best->aggregator_identifier);
pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
best->aggregator_identifier, best->num_of_ports, best->aggregator_identifier, best->num_of_ports,
best->actor_oper_aggregator_key, best->actor_oper_aggregator_key,
best->partner_oper_aggregator_key, best->partner_oper_aggregator_key,
...@@ -1908,12 +1904,12 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1908,12 +1904,12 @@ void bond_3ad_unbind_slave(struct slave *slave)
/* if slave is null, the whole port is not initialized */ /* if slave is null, the whole port is not initialized */
if (!port->slave) { if (!port->slave) {
pr_warn("Warning: %s: Trying to unbind an uninitialized port on %s\n", netdev_warn(bond->dev, "Trying to unbind an uninitialized port on %s\n",
slave->bond->dev->name, slave->dev->name); slave->dev->name);
return; return;
} }
pr_debug("Unbinding Link Aggregation Group %d\n", netdev_dbg(bond->dev, "Unbinding Link Aggregation Group %d\n",
aggregator->aggregator_identifier); aggregator->aggregator_identifier);
/* Tell the partner that this port is not suitable for aggregation */ /* Tell the partner that this port is not suitable for aggregation */
...@@ -1949,14 +1945,13 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1949,14 +1945,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
* new aggregator * new aggregator
*/ */
if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
pr_debug("Some port(s) related to LAG %d - replacing with LAG %d\n", netdev_dbg(bond->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n",
aggregator->aggregator_identifier, aggregator->aggregator_identifier,
new_aggregator->aggregator_identifier); new_aggregator->aggregator_identifier);
if ((new_aggregator->lag_ports == port) && if ((new_aggregator->lag_ports == port) &&
new_aggregator->is_active) { new_aggregator->is_active) {
pr_info("%s: Removing an active aggregator\n", netdev_info(bond->dev, "Removing an active aggregator\n");
aggregator->slave->bond->dev->name);
select_new_active_agg = 1; select_new_active_agg = 1;
} }
...@@ -1986,8 +1981,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1986,8 +1981,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
if (select_new_active_agg) if (select_new_active_agg)
ad_agg_selection_logic(__get_first_agg(port)); ad_agg_selection_logic(__get_first_agg(port));
} else { } else {
pr_warn("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n", netdev_warn(bond->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n");
slave->bond->dev->name);
} }
} else { } else {
/* in case that the only port related to this /* in case that the only port related to this
...@@ -1996,8 +1990,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1996,8 +1990,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
select_new_active_agg = aggregator->is_active; select_new_active_agg = aggregator->is_active;
ad_clear_agg(aggregator); ad_clear_agg(aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
pr_info("%s: Removing an active aggregator\n", netdev_info(bond->dev, "Removing an active aggregator\n");
slave->bond->dev->name);
/* select new active aggregator */ /* select new active aggregator */
temp_aggregator = __get_first_agg(port); temp_aggregator = __get_first_agg(port);
if (temp_aggregator) if (temp_aggregator)
...@@ -2006,7 +1999,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2006,7 +1999,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
} }
} }
pr_debug("Unbinding port %d\n", port->actor_port_number); netdev_dbg(bond->dev, "Unbinding port %d\n", port->actor_port_number);
/* find the aggregator that this port is connected to */ /* find the aggregator that this port is connected to */
bond_for_each_slave(bond, slave_iter, iter) { bond_for_each_slave(bond, slave_iter, iter) {
...@@ -2029,8 +2022,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2029,8 +2022,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
select_new_active_agg = temp_aggregator->is_active; select_new_active_agg = temp_aggregator->is_active;
ad_clear_agg(temp_aggregator); ad_clear_agg(temp_aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
pr_info("%s: Removing an active aggregator\n", netdev_info(bond->dev, "Removing an active aggregator\n");
slave->bond->dev->name);
/* select new active aggregator */ /* select new active aggregator */
ad_agg_selection_logic(__get_first_agg(port)); ad_agg_selection_logic(__get_first_agg(port));
} }
...@@ -2081,7 +2073,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) ...@@ -2081,7 +2073,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
/* select the active aggregator for the bond */ /* select the active aggregator for the bond */
if (port) { if (port) {
if (!port->slave) { if (!port->slave) {
pr_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n", net_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n",
bond->dev->name); bond->dev->name);
goto re_arm; goto re_arm;
} }
...@@ -2096,7 +2088,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) ...@@ -2096,7 +2088,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
bond_for_each_slave_rcu(bond, slave, iter) { bond_for_each_slave_rcu(bond, slave, iter) {
port = &(SLAVE_AD_INFO(slave)->port); port = &(SLAVE_AD_INFO(slave)->port);
if (!port->slave) { if (!port->slave) {
pr_warn_ratelimited("%s: Warning: Found an uninitialized port\n", net_warn_ratelimited("%s: Warning: Found an uninitialized port\n",
bond->dev->name); bond->dev->name);
goto re_arm; goto re_arm;
} }
...@@ -2158,7 +2150,7 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, ...@@ -2158,7 +2150,7 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
port = &(SLAVE_AD_INFO(slave)->port); port = &(SLAVE_AD_INFO(slave)->port);
if (!port->slave) { if (!port->slave) {
pr_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n", net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n",
slave->dev->name, slave->bond->dev->name); slave->dev->name, slave->bond->dev->name);
return ret; return ret;
} }
...@@ -2166,7 +2158,7 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, ...@@ -2166,7 +2158,7 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
switch (lacpdu->subtype) { switch (lacpdu->subtype) {
case AD_TYPE_LACPDU: case AD_TYPE_LACPDU:
ret = RX_HANDLER_CONSUMED; ret = RX_HANDLER_CONSUMED;
pr_debug("Received LACPDU on port %d\n", netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n",
port->actor_port_number); port->actor_port_number);
/* Protect against concurrent state machines */ /* Protect against concurrent state machines */
__get_state_machine_lock(port); __get_state_machine_lock(port);
...@@ -2182,19 +2174,19 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, ...@@ -2182,19 +2174,19 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
switch (((struct bond_marker *)lacpdu)->tlv_type) { switch (((struct bond_marker *)lacpdu)->tlv_type) {
case AD_MARKER_INFORMATION_SUBTYPE: case AD_MARKER_INFORMATION_SUBTYPE:
pr_debug("Received Marker Information on port %d\n", netdev_dbg(slave->bond->dev, "Received Marker Information on port %d\n",
port->actor_port_number); port->actor_port_number);
ad_marker_info_received((struct bond_marker *)lacpdu, port); ad_marker_info_received((struct bond_marker *)lacpdu, port);
break; break;
case AD_MARKER_RESPONSE_SUBTYPE: case AD_MARKER_RESPONSE_SUBTYPE:
pr_debug("Received Marker Response on port %d\n", netdev_dbg(slave->bond->dev, "Received Marker Response on port %d\n",
port->actor_port_number); port->actor_port_number);
ad_marker_response_received((struct bond_marker *)lacpdu, port); ad_marker_response_received((struct bond_marker *)lacpdu, port);
break; break;
default: default:
pr_debug("Received an unknown Marker subtype on slot %d\n", netdev_dbg(slave->bond->dev, "Received an unknown Marker subtype on slot %d\n",
port->actor_port_number); port->actor_port_number);
} }
} }
...@@ -2216,8 +2208,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) ...@@ -2216,8 +2208,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave)
/* if slave is null, the whole port is not initialized */ /* if slave is null, the whole port is not initialized */
if (!port->slave) { if (!port->slave) {
pr_warn("Warning: %s: speed changed for uninitialized port on %s\n", netdev_warn(slave->bond->dev, "speed changed for uninitialized port on %s\n",
slave->bond->dev->name, slave->dev->name); slave->dev->name);
return; return;
} }
...@@ -2226,7 +2218,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) ...@@ -2226,7 +2218,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave)
port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS;
port->actor_oper_port_key = port->actor_admin_port_key |= port->actor_oper_port_key = port->actor_admin_port_key |=
(__get_link_speed(port) << 1); (__get_link_speed(port) << 1);
pr_debug("Port %d changed speed\n", port->actor_port_number); netdev_dbg(slave->bond->dev, "Port %d changed speed\n", port->actor_port_number);
/* there is no need to reselect a new aggregator, just signal the /* there is no need to reselect a new aggregator, just signal the
* state machines to reinitialize * state machines to reinitialize
*/ */
...@@ -2249,8 +2241,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) ...@@ -2249,8 +2241,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
/* if slave is null, the whole port is not initialized */ /* if slave is null, the whole port is not initialized */
if (!port->slave) { if (!port->slave) {
pr_warn("%s: Warning: duplex changed for uninitialized port on %s\n", netdev_warn(slave->bond->dev, "duplex changed for uninitialized port on %s\n",
slave->bond->dev->name, slave->dev->name); slave->dev->name);
return; return;
} }
...@@ -2259,7 +2251,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) ...@@ -2259,7 +2251,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS;
port->actor_oper_port_key = port->actor_admin_port_key |= port->actor_oper_port_key = port->actor_admin_port_key |=
__get_duplex(port); __get_duplex(port);
pr_debug("Port %d changed duplex\n", port->actor_port_number); netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number);
/* there is no need to reselect a new aggregator, just signal the /* there is no need to reselect a new aggregator, just signal the
* state machines to reinitialize * state machines to reinitialize
*/ */
...@@ -2283,8 +2275,8 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) ...@@ -2283,8 +2275,8 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
/* if slave is null, the whole port is not initialized */ /* if slave is null, the whole port is not initialized */
if (!port->slave) { if (!port->slave) {
pr_warn("Warning: %s: link status changed for uninitialized port on %s\n", netdev_warn(slave->bond->dev, "link status changed for uninitialized port on %s\n",
slave->bond->dev->name, slave->dev->name); slave->dev->name);
return; return;
} }
...@@ -2311,7 +2303,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) ...@@ -2311,7 +2303,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
port->actor_oper_port_key = (port->actor_admin_port_key &= port->actor_oper_port_key = (port->actor_admin_port_key &=
~AD_SPEED_KEY_BITS); ~AD_SPEED_KEY_BITS);
} }
pr_debug("Port %d changed link status to %s\n", netdev_dbg(slave->bond->dev, "Port %d changed link status to %s\n",
port->actor_port_number, port->actor_port_number,
link == BOND_LINK_UP ? "UP" : "DOWN"); link == BOND_LINK_UP ? "UP" : "DOWN");
/* there is no need to reselect a new aggregator, just signal the /* there is no need to reselect a new aggregator, just signal the
...@@ -2427,8 +2419,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2427,8 +2419,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
int agg_id; int agg_id;
if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
pr_debug("%s: Error: __bond_3ad_get_active_agg_info failed\n", netdev_dbg(dev, "__bond_3ad_get_active_agg_info failed\n");
dev->name);
goto err_free; goto err_free;
} }
...@@ -2436,7 +2427,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2436,7 +2427,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
agg_id = ad_info.aggregator_id; agg_id = ad_info.aggregator_id;
if (slaves_in_agg == 0) { if (slaves_in_agg == 0) {
pr_debug("%s: Error: active aggregator is empty\n", dev->name); netdev_dbg(dev, "active aggregator is empty\n");
goto err_free; goto err_free;
} }
...@@ -2462,8 +2453,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2462,8 +2453,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
} }
if (slave_agg_no >= 0) { if (slave_agg_no >= 0) {
pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n", netdev_err(dev, "Couldn't find a slave to tx on for aggregator ID %d\n",
dev->name, agg_id); agg_id);
goto err_free; goto err_free;
} }
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
...@@ -369,7 +367,7 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond, ...@@ -369,7 +367,7 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond,
if (arp->op_code == htons(ARPOP_REPLY)) { if (arp->op_code == htons(ARPOP_REPLY)) {
/* update rx hash table for this ARP */ /* update rx hash table for this ARP */
rlb_update_entry_from_arp(bond, arp); rlb_update_entry_from_arp(bond, arp);
pr_debug("Server received an ARP Reply from client\n"); netdev_dbg(bond->dev, "Server received an ARP Reply from client\n");
} }
out: out:
return RX_HANDLER_ANOTHER; return RX_HANDLER_ANOTHER;
...@@ -535,8 +533,8 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -535,8 +533,8 @@ static void rlb_update_client(struct rlb_client_info *client_info)
client_info->slave->dev->dev_addr, client_info->slave->dev->dev_addr,
client_info->mac_dst); client_info->mac_dst);
if (!skb) { if (!skb) {
pr_err("%s: Error: failed to create an ARP packet\n", netdev_err(client_info->slave->bond->dev,
client_info->slave->bond->dev->name); "failed to create an ARP packet\n");
continue; continue;
} }
...@@ -545,8 +543,8 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -545,8 +543,8 @@ static void rlb_update_client(struct rlb_client_info *client_info)
if (client_info->vlan_id) { if (client_info->vlan_id) {
skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id); skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id);
if (!skb) { if (!skb) {
pr_err("%s: Error: failed to insert VLAN tag\n", netdev_err(client_info->slave->bond->dev,
client_info->slave->bond->dev->name); "failed to insert VLAN tag\n");
continue; continue;
} }
} }
...@@ -630,8 +628,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) ...@@ -630,8 +628,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
client_info = &(bond_info->rx_hashtbl[hash_index]); client_info = &(bond_info->rx_hashtbl[hash_index]);
if (!client_info->slave) { if (!client_info->slave) {
pr_err("%s: Error: found a client with no channel in the client's hash table\n", netdev_err(bond->dev, "found a client with no channel in the client's hash table\n");
bond->dev->name);
continue; continue;
} }
/*update all clients using this src_ip, that are not assigned /*update all clients using this src_ip, that are not assigned
...@@ -767,7 +764,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) ...@@ -767,7 +764,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
tx_slave = rlb_choose_channel(skb, bond); tx_slave = rlb_choose_channel(skb, bond);
if (tx_slave) if (tx_slave)
ether_addr_copy(arp->mac_src, tx_slave->dev->dev_addr); ether_addr_copy(arp->mac_src, tx_slave->dev->dev_addr);
pr_debug("Server sent ARP Reply packet\n"); netdev_dbg(bond->dev, "Server sent ARP Reply packet\n");
} else if (arp->op_code == htons(ARPOP_REQUEST)) { } else if (arp->op_code == htons(ARPOP_REQUEST)) {
/* Create an entry in the rx_hashtbl for this client as a /* Create an entry in the rx_hashtbl for this client as a
* place holder. * place holder.
...@@ -787,7 +784,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) ...@@ -787,7 +784,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
* updated with their assigned mac. * updated with their assigned mac.
*/ */
rlb_req_update_subnet_clients(bond, arp->ip_src); rlb_req_update_subnet_clients(bond, arp->ip_src);
pr_debug("Server sent ARP Request packet\n"); netdev_dbg(bond->dev, "Server sent ARP Request packet\n");
} }
return tx_slave; return tx_slave;
...@@ -1026,8 +1023,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], ...@@ -1026,8 +1023,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
if (vid) { if (vid) {
skb = vlan_put_tag(skb, vlan_proto, vid); skb = vlan_put_tag(skb, vlan_proto, vid);
if (!skb) { if (!skb) {
pr_err("%s: Error: failed to insert VLAN tag\n", netdev_err(slave->bond->dev, "failed to insert VLAN tag\n");
slave->bond->dev->name);
return; return;
} }
} }
...@@ -1093,9 +1089,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[]) ...@@ -1093,9 +1089,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
memcpy(s_addr.sa_data, addr, dev->addr_len); memcpy(s_addr.sa_data, addr, dev->addr_len);
s_addr.sa_family = dev->type; s_addr.sa_family = dev->type;
if (dev_set_mac_address(dev, &s_addr)) { if (dev_set_mac_address(dev, &s_addr)) {
pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n" netdev_err(slave->bond->dev, "dev_set_mac_address of dev %s failed! ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n",
"ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", dev->name);
slave->bond->dev->name, dev->name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
return 0; return 0;
...@@ -1269,13 +1264,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -1269,13 +1264,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
if (free_mac_slave) { if (free_mac_slave) {
alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr); alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr);
pr_warn("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", netdev_warn(bond->dev, "the hw address of slave %s is in use by the bond; giving it the hw address of %s\n",
bond->dev->name, slave->dev->name, slave->dev->name, free_mac_slave->dev->name);
free_mac_slave->dev->name);
} else if (has_bond_addr) { } else if (has_bond_addr) {
pr_err("%s: Error: the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n", netdev_err(bond->dev, "the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n",
bond->dev->name, slave->dev->name); slave->dev->name);
return -EFAULT; return -EFAULT;
} }
......
...@@ -69,8 +69,7 @@ void bond_debug_register(struct bonding *bond) ...@@ -69,8 +69,7 @@ void bond_debug_register(struct bonding *bond)
debugfs_create_dir(bond->dev->name, bonding_debug_root); debugfs_create_dir(bond->dev->name, bonding_debug_root);
if (!bond->debug_dir) { if (!bond->debug_dir) {
pr_warn("%s: Warning: failed to register to debugfs\n", netdev_warn(bond->dev, "failed to register to debugfs\n");
bond->dev->name);
return; return;
} }
...@@ -98,8 +97,7 @@ void bond_debug_reregister(struct bonding *bond) ...@@ -98,8 +97,7 @@ void bond_debug_reregister(struct bonding *bond)
if (d) { if (d) {
bond->debug_dir = d; bond->debug_dir = d;
} else { } else {
pr_warn("%s: Warning: failed to reregister, so just unregister old one\n", netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n");
bond->dev->name);
bond_debug_unregister(bond); bond_debug_unregister(bond);
} }
} }
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -629,7 +627,7 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, ...@@ -629,7 +627,7 @@ 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;
...@@ -684,8 +682,8 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -684,8 +682,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 +695,14 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -697,14 +695,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 +763,8 @@ static bool bond_should_notify_peers(struct bonding *bond) ...@@ -765,8 +763,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,8 +804,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -806,8 +804,8 @@ 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);
} }
...@@ -821,8 +819,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -821,8 +819,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 +909,9 @@ void bond_select_active_slave(struct bonding *bond) ...@@ -911,11 +909,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 +1208,38 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1212,36 +1208,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,7 +1249,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1251,7 +1249,7 @@ 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 +1264,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1266,16 +1264,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 +1291,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1295,24 +1291,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 +1338,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1345,7 +1338,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 +1359,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1366,7 +1359,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 +1367,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1374,7 +1367,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 +1417,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1424,8 +1417,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 +1447,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1454,12 +1447,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,7 +1477,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1484,7 +1477,7 @@ 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"));
...@@ -1527,7 +1520,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1527,7 +1520,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 +1540,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1547,8 +1540,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 +1550,19 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1558,19 +1550,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,8 +1578,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1586,8 +1578,8 @@ 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");
...@@ -1674,8 +1666,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1674,8 +1666,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 +1676,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1684,8 +1676,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,8 +1697,7 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1705,8 +1697,7 @@ 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);
...@@ -1718,9 +1709,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1718,9 +1709,8 @@ 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);
} }
...@@ -1774,8 +1764,8 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1774,8 +1764,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 +1832,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev, ...@@ -1842,8 +1832,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,8 +1897,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1907,8 +1897,7 @@ 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) ?
...@@ -1924,8 +1913,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1924,8 +1913,7 @@ 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);
...@@ -1949,8 +1937,8 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1949,8 +1937,8 @@ 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);
...@@ -1959,8 +1947,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -1959,8 +1947,7 @@ static int bond_miimon_inspect(struct bonding *bond)
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);
...@@ -2011,8 +1998,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2011,8 +1998,8 @@ 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");
...@@ -2041,8 +2028,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2041,8 +2028,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 +2045,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2058,9 +2045,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,7 +2149,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2163,7 +2149,7 @@ 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,
...@@ -2179,7 +2165,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2179,7 +2165,7 @@ 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);
...@@ -2190,7 +2176,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2190,7 +2176,7 @@ 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) {
...@@ -2245,7 +2231,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) ...@@ -2245,7 +2231,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 +2262,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) ...@@ -2276,9 +2262,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 +2281,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 ...@@ -2296,13 +2281,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 +2316,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, ...@@ -2329,8 +2316,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,8 +2341,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, ...@@ -2354,8 +2341,8 @@ 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);
...@@ -2447,13 +2434,11 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2447,13 +2434,11 @@ 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);
} }
} }
...@@ -2473,8 +2458,8 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2473,8 +2458,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 +2612,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2627,8 +2612,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 +2631,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2646,8 +2631,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 +2642,8 @@ static void bond_ab_arp_commit(struct bonding *bond) ...@@ -2657,9 +2642,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,7 +2674,7 @@ static bool bond_ab_arp_probe(struct bonding *bond) ...@@ -2690,7 +2674,7 @@ 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);
...@@ -2733,8 +2717,8 @@ static bool bond_ab_arp_probe(struct bonding *bond) ...@@ -2733,8 +2717,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,8 +2914,7 @@ static int bond_slave_netdev_event(unsigned long event, ...@@ -2930,8 +2914,7 @@ 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();
...@@ -2967,19 +2950,18 @@ static int bond_netdev_event(struct notifier_block *this, ...@@ -2967,19 +2950,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 +3203,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3221,7 +3203,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 +3273,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3291,12 +3273,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 +3405,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3423,8 +3405,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,7 +3423,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3442,7 +3423,7 @@ 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 +3437,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3456,7 +3437,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,7 +3457,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -3475,7 +3457,7 @@ 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 +3484,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3502,8 +3484,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 +3512,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3531,7 +3512,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 +3521,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3540,7 +3521,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,7 +3543,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -3562,7 +3543,7 @@ 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 +3791,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev ...@@ -3810,8 +3791,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 +3971,7 @@ static void bond_uninit(struct net_device *bond_dev) ...@@ -3991,7 +3971,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 +4360,7 @@ static int bond_init(struct net_device *bond_dev) ...@@ -4380,7 +4360,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
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -181,8 +179,7 @@ static int bond_changelink(struct net_device *bond_dev, ...@@ -181,8 +179,7 @@ static int bond_changelink(struct net_device *bond_dev,
int arp_interval = nla_get_u32(data[IFLA_BOND_ARP_INTERVAL]); int arp_interval = nla_get_u32(data[IFLA_BOND_ARP_INTERVAL]);
if (arp_interval && miimon) { if (arp_interval && miimon) {
pr_err("%s: ARP monitoring cannot be used with MII monitoring\n", netdev_err(bond->dev, "ARP monitoring cannot be used with MII monitoring\n");
bond->dev->name);
return -EINVAL; return -EINVAL;
} }
...@@ -207,8 +204,7 @@ static int bond_changelink(struct net_device *bond_dev, ...@@ -207,8 +204,7 @@ static int bond_changelink(struct net_device *bond_dev,
i++; i++;
} }
if (i == 0 && bond->params.arp_interval) if (i == 0 && bond->params.arp_interval)
pr_warn("%s: Removing last arp target with arp_interval on\n", netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
bond->dev->name);
if (err) if (err)
return err; return err;
} }
...@@ -216,8 +212,7 @@ static int bond_changelink(struct net_device *bond_dev, ...@@ -216,8 +212,7 @@ static int bond_changelink(struct net_device *bond_dev,
int arp_validate = nla_get_u32(data[IFLA_BOND_ARP_VALIDATE]); int arp_validate = nla_get_u32(data[IFLA_BOND_ARP_VALIDATE]);
if (arp_validate && miimon) { if (arp_validate && miimon) {
pr_err("%s: ARP validating cannot be used with MII monitoring\n", netdev_err(bond->dev, "ARP validating cannot be used with MII monitoring\n");
bond->dev->name);
return -EINVAL; return -EINVAL;
} }
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -544,9 +542,8 @@ static void bond_opt_dep_print(struct bonding *bond, ...@@ -544,9 +542,8 @@ static void bond_opt_dep_print(struct bonding *bond,
params = &bond->params; params = &bond->params;
modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode); modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode);
if (test_bit(params->mode, &opt->unsuppmodes)) if (test_bit(params->mode, &opt->unsuppmodes))
pr_err("%s: option %s: mode dependency failed, not supported in mode %s(%llu)\n", netdev_err(bond->dev, "option %s: mode dependency failed, not supported in mode %s(%llu)\n",
bond->dev->name, opt->name, opt->name, modeval->string, modeval->value);
modeval->string, modeval->value);
} }
static void bond_opt_error_interpret(struct bonding *bond, static void bond_opt_error_interpret(struct bonding *bond,
...@@ -564,31 +561,30 @@ static void bond_opt_error_interpret(struct bonding *bond, ...@@ -564,31 +561,30 @@ static void bond_opt_error_interpret(struct bonding *bond,
p = strchr(val->string, '\n'); p = strchr(val->string, '\n');
if (p) if (p)
*p = '\0'; *p = '\0';
pr_err("%s: option %s: invalid value (%s)\n", netdev_err(bond->dev, "option %s: invalid value (%s)\n",
bond->dev->name, opt->name, val->string); opt->name, val->string);
} else { } else {
pr_err("%s: option %s: invalid value (%llu)\n", netdev_err(bond->dev, "option %s: invalid value (%llu)\n",
bond->dev->name, opt->name, val->value); opt->name, val->value);
} }
} }
minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN);
maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX);
if (!maxval) if (!maxval)
break; break;
pr_err("%s: option %s: allowed values %llu - %llu\n", netdev_err(bond->dev, "option %s: allowed values %llu - %llu\n",
bond->dev->name, opt->name, minval ? minval->value : 0, opt->name, minval ? minval->value : 0, maxval->value);
maxval->value);
break; break;
case -EACCES: case -EACCES:
bond_opt_dep_print(bond, opt); bond_opt_dep_print(bond, opt);
break; break;
case -ENOTEMPTY: case -ENOTEMPTY:
pr_err("%s: option %s: unable to set because the bond device has slaves\n", netdev_err(bond->dev, "option %s: unable to set because the bond device has slaves\n",
bond->dev->name, opt->name); opt->name);
break; break;
case -EBUSY: case -EBUSY:
pr_err("%s: option %s: unable to set because the bond device is up\n", netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n",
bond->dev->name, opt->name); opt->name);
break; break;
default: default:
break; break;
...@@ -675,14 +671,14 @@ static int bond_option_mode_set(struct bonding *bond, ...@@ -675,14 +671,14 @@ static int bond_option_mode_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
bond->dev->name, newval->string); newval->string);
/* disable arp monitoring */ /* disable arp monitoring */
bond->params.arp_interval = 0; bond->params.arp_interval = 0;
/* set miimon to default value */ /* set miimon to default value */
bond->params.miimon = BOND_DEFAULT_MIIMON; bond->params.miimon = BOND_DEFAULT_MIIMON;
pr_info("%s: Setting MII monitoring interval to %d\n", netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
bond->dev->name, bond->params.miimon); bond->params.miimon);
} }
/* don't cache arp_validate between modes */ /* don't cache arp_validate between modes */
...@@ -723,14 +719,14 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -723,14 +719,14 @@ static int bond_option_active_slave_set(struct bonding *bond,
if (slave_dev) { if (slave_dev) {
if (!netif_is_bond_slave(slave_dev)) { if (!netif_is_bond_slave(slave_dev)) {
pr_err("Device %s is not bonding slave\n", netdev_err(bond->dev, "Device %s is not bonding slave\n",
slave_dev->name); slave_dev->name);
return -EINVAL; return -EINVAL;
} }
if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { if (bond->dev != netdev_master_upper_dev_get(slave_dev)) {
pr_err("%s: Device %s is not our slave\n", netdev_err(bond->dev, "Device %s is not our slave\n",
bond->dev->name, slave_dev->name); slave_dev->name);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -740,7 +736,7 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -740,7 +736,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
/* check to see if we are clearing active */ /* check to see if we are clearing active */
if (!slave_dev) { if (!slave_dev) {
pr_info("%s: Clearing current active slave\n", bond->dev->name); netdev_info(bond->dev, "Clearing current active slave\n");
RCU_INIT_POINTER(bond->curr_active_slave, NULL); RCU_INIT_POINTER(bond->curr_active_slave, NULL);
bond_select_active_slave(bond); bond_select_active_slave(bond);
} else { } else {
...@@ -751,17 +747,17 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -751,17 +747,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
if (new_active == old_active) { if (new_active == old_active) {
/* do nothing */ /* do nothing */
pr_info("%s: %s is already the current active slave\n", netdev_info(bond->dev, "%s is already the current active slave\n",
bond->dev->name, new_active->dev->name); new_active->dev->name);
} else { } else {
if (old_active && (new_active->link == BOND_LINK_UP) && if (old_active && (new_active->link == BOND_LINK_UP) &&
bond_slave_is_up(new_active)) { bond_slave_is_up(new_active)) {
pr_info("%s: Setting %s as active slave\n", netdev_info(bond->dev, "Setting %s as active slave\n",
bond->dev->name, new_active->dev->name); new_active->dev->name);
bond_change_active_slave(bond, new_active); bond_change_active_slave(bond, new_active);
} else { } else {
pr_err("%s: Could not set %s as active slave; either %s is down or the link is down\n", netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
bond->dev->name, new_active->dev->name, new_active->dev->name,
new_active->dev->name); new_active->dev->name);
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -781,20 +777,17 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -781,20 +777,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
static int bond_option_miimon_set(struct bonding *bond, static int bond_option_miimon_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting MII monitoring interval to %llu\n", netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.miimon = newval->value; bond->params.miimon = newval->value;
if (bond->params.updelay) if (bond->params.updelay)
pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value\n", netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
bond->dev->name,
bond->params.updelay * bond->params.miimon); bond->params.updelay * bond->params.miimon);
if (bond->params.downdelay) if (bond->params.downdelay)
pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n", netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
bond->dev->name,
bond->params.downdelay * bond->params.miimon); bond->params.downdelay * bond->params.miimon);
if (newval->value && bond->params.arp_interval) { if (newval->value && bond->params.arp_interval) {
pr_info("%s: MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n", netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
bond->dev->name);
bond->params.arp_interval = 0; bond->params.arp_interval = 0;
if (bond->params.arp_validate) if (bond->params.arp_validate)
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
...@@ -826,20 +819,18 @@ static int bond_option_updelay_set(struct bonding *bond, ...@@ -826,20 +819,18 @@ static int bond_option_updelay_set(struct bonding *bond,
int value = newval->value; int value = newval->value;
if (!bond->params.miimon) { if (!bond->params.miimon) {
pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", netdev_err(bond->dev, "Unable to set up delay as MII monitoring is disabled\n");
bond->dev->name);
return -EPERM; return -EPERM;
} }
if ((value % bond->params.miimon) != 0) { if ((value % bond->params.miimon) != 0) {
pr_warn("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", netdev_warn(bond->dev, "up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
bond->dev->name, value, value, bond->params.miimon,
bond->params.miimon,
(value / bond->params.miimon) * (value / bond->params.miimon) *
bond->params.miimon); bond->params.miimon);
} }
bond->params.updelay = value / bond->params.miimon; bond->params.updelay = value / bond->params.miimon;
pr_info("%s: Setting up delay to %d\n", netdev_info(bond->dev, "Setting up delay to %d\n",
bond->dev->name, bond->params.updelay * bond->params.miimon); bond->params.updelay * bond->params.miimon);
return 0; return 0;
} }
...@@ -850,20 +841,18 @@ static int bond_option_downdelay_set(struct bonding *bond, ...@@ -850,20 +841,18 @@ static int bond_option_downdelay_set(struct bonding *bond,
int value = newval->value; int value = newval->value;
if (!bond->params.miimon) { if (!bond->params.miimon) {
pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", netdev_err(bond->dev, "Unable to set down delay as MII monitoring is disabled\n");
bond->dev->name);
return -EPERM; return -EPERM;
} }
if ((value % bond->params.miimon) != 0) { if ((value % bond->params.miimon) != 0) {
pr_warn("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", netdev_warn(bond->dev, "down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
bond->dev->name, value, value, bond->params.miimon,
bond->params.miimon,
(value / bond->params.miimon) * (value / bond->params.miimon) *
bond->params.miimon); bond->params.miimon);
} }
bond->params.downdelay = value / bond->params.miimon; bond->params.downdelay = value / bond->params.miimon;
pr_info("%s: Setting down delay to %d\n", netdev_info(bond->dev, "Setting down delay to %d\n",
bond->dev->name, bond->params.downdelay * bond->params.miimon); bond->params.downdelay * bond->params.miimon);
return 0; return 0;
} }
...@@ -871,8 +860,8 @@ static int bond_option_downdelay_set(struct bonding *bond, ...@@ -871,8 +860,8 @@ static int bond_option_downdelay_set(struct bonding *bond,
static int bond_option_use_carrier_set(struct bonding *bond, static int bond_option_use_carrier_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting use_carrier to %llu\n", netdev_info(bond->dev, "Setting use_carrier to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.use_carrier = newval->value; bond->params.use_carrier = newval->value;
return 0; return 0;
...@@ -885,18 +874,16 @@ static int bond_option_use_carrier_set(struct bonding *bond, ...@@ -885,18 +874,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
static int bond_option_arp_interval_set(struct bonding *bond, static int bond_option_arp_interval_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting ARP monitoring interval to %llu\n", netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.arp_interval = newval->value; bond->params.arp_interval = newval->value;
if (newval->value) { if (newval->value) {
if (bond->params.miimon) { if (bond->params.miimon) {
pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring\n", netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
bond->dev->name, bond->dev->name);
bond->params.miimon = 0; bond->params.miimon = 0;
} }
if (!bond->params.arp_targets[0]) if (!bond->params.arp_targets[0])
pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified\n", netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
bond->dev->name);
} }
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
/* If the interface is up, we may need to fire off /* If the interface is up, we may need to fire off
...@@ -940,24 +927,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target) ...@@ -940,24 +927,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
int ind; int ind;
if (!bond_is_ip_target_ok(target)) { if (!bond_is_ip_target_ok(target)) {
pr_err("%s: invalid ARP target %pI4 specified for addition\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified for addition\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
if (bond_get_targets_ip(targets, target) != -1) { /* dup */ if (bond_get_targets_ip(targets, target) != -1) { /* dup */
pr_err("%s: ARP target %pI4 is already present\n", netdev_err(bond->dev, "ARP target %pI4 is already present\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
ind = bond_get_targets_ip(targets, 0); /* first free slot */ ind = bond_get_targets_ip(targets, 0); /* first free slot */
if (ind == -1) { if (ind == -1) {
pr_err("%s: ARP target table is full!\n", bond->dev->name); netdev_err(bond->dev, "ARP target table is full!\n");
return -EINVAL; return -EINVAL;
} }
pr_info("%s: Adding ARP target %pI4\n", bond->dev->name, &target); netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
_bond_options_arp_ip_target_set(bond, ind, target, jiffies); _bond_options_arp_ip_target_set(bond, ind, target, jiffies);
...@@ -985,23 +972,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target) ...@@ -985,23 +972,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
int ind, i; int ind, i;
if (!bond_is_ip_target_ok(target)) { if (!bond_is_ip_target_ok(target)) {
pr_err("%s: invalid ARP target %pI4 specified for removal\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified for removal\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
ind = bond_get_targets_ip(targets, target); ind = bond_get_targets_ip(targets, target);
if (ind == -1) { if (ind == -1) {
pr_err("%s: unable to remove nonexistent ARP target %pI4\n", netdev_err(bond->dev, "unable to remove nonexistent ARP target %pI4\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
if (ind == 0 && !targets[1] && bond->params.arp_interval) if (ind == 0 && !targets[1] && bond->params.arp_interval)
pr_warn("%s: Removing last arp target with arp_interval on\n", netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
bond->dev->name);
pr_info("%s: Removing ARP target %pI4\n", bond->dev->name, &target); netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
/* not to race with bond_arp_rcv */ /* not to race with bond_arp_rcv */
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
...@@ -1040,8 +1026,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1040,8 +1026,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
if (newval->string) { if (newval->string) {
if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) { if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) {
pr_err("%s: invalid ARP target %pI4 specified\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified\n",
bond->dev->name, &target); &target);
return ret; return ret;
} }
if (newval->string[0] == '+') if (newval->string[0] == '+')
...@@ -1049,8 +1035,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1049,8 +1035,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
else if (newval->string[0] == '-') else if (newval->string[0] == '-')
ret = bond_option_arp_ip_target_rem(bond, target); ret = bond_option_arp_ip_target_rem(bond, target);
else else
pr_err("no command found in arp_ip_targets file for bond %s - use +<addr> or -<addr>\n", netdev_err(bond->dev, "no command found in arp_ip_targets file - use +<addr> or -<addr>\n");
bond->dev->name);
} else { } else {
target = newval->value; target = newval->value;
ret = bond_option_arp_ip_target_add(bond, target); ret = bond_option_arp_ip_target_add(bond, target);
...@@ -1062,8 +1047,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1062,8 +1047,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
static int bond_option_arp_validate_set(struct bonding *bond, static int bond_option_arp_validate_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting arp_validate to %s (%llu)\n", netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
if (!newval->value) if (!newval->value)
...@@ -1079,8 +1064,8 @@ static int bond_option_arp_validate_set(struct bonding *bond, ...@@ -1079,8 +1064,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
static int bond_option_arp_all_targets_set(struct bonding *bond, static int bond_option_arp_all_targets_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting arp_all_targets to %s (%llu)\n", netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.arp_all_targets = newval->value; bond->params.arp_all_targets = newval->value;
return 0; return 0;
...@@ -1102,7 +1087,7 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1102,7 +1087,7 @@ static int bond_option_primary_set(struct bonding *bond,
*p = '\0'; *p = '\0';
/* check to see if we are clearing primary */ /* check to see if we are clearing primary */
if (!strlen(primary)) { if (!strlen(primary)) {
pr_info("%s: Setting primary slave to None\n", bond->dev->name); netdev_info(bond->dev, "Setting primary slave to None\n");
bond->primary_slave = NULL; bond->primary_slave = NULL;
memset(bond->params.primary, 0, sizeof(bond->params.primary)); memset(bond->params.primary, 0, sizeof(bond->params.primary));
bond_select_active_slave(bond); bond_select_active_slave(bond);
...@@ -1111,8 +1096,8 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1111,8 +1096,8 @@ static int bond_option_primary_set(struct bonding *bond,
bond_for_each_slave(bond, slave, iter) { bond_for_each_slave(bond, slave, iter) {
if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) { if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
pr_info("%s: Setting %s as primary slave\n", netdev_info(bond->dev, "Setting %s as primary slave\n",
bond->dev->name, slave->dev->name); slave->dev->name);
bond->primary_slave = slave; bond->primary_slave = slave;
strcpy(bond->params.primary, slave->dev->name); strcpy(bond->params.primary, slave->dev->name);
bond_select_active_slave(bond); bond_select_active_slave(bond);
...@@ -1121,15 +1106,15 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1121,15 +1106,15 @@ static int bond_option_primary_set(struct bonding *bond,
} }
if (bond->primary_slave) { if (bond->primary_slave) {
pr_info("%s: Setting primary slave to None\n", bond->dev->name); netdev_info(bond->dev, "Setting primary slave to None\n");
bond->primary_slave = NULL; bond->primary_slave = NULL;
bond_select_active_slave(bond); bond_select_active_slave(bond);
} }
strncpy(bond->params.primary, primary, IFNAMSIZ); strncpy(bond->params.primary, primary, IFNAMSIZ);
bond->params.primary[IFNAMSIZ - 1] = 0; bond->params.primary[IFNAMSIZ - 1] = 0;
pr_info("%s: Recording %s as primary, but it has not been enslaved to %s yet\n", netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
bond->dev->name, primary, bond->dev->name); primary, bond->dev->name);
out: out:
write_unlock_bh(&bond->curr_slave_lock); write_unlock_bh(&bond->curr_slave_lock);
...@@ -1142,8 +1127,8 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1142,8 +1127,8 @@ static int bond_option_primary_set(struct bonding *bond,
static int bond_option_primary_reselect_set(struct bonding *bond, static int bond_option_primary_reselect_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting primary_reselect to %s (%llu)\n", netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.primary_reselect = newval->value; bond->params.primary_reselect = newval->value;
block_netpoll_tx(); block_netpoll_tx();
...@@ -1158,8 +1143,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond, ...@@ -1158,8 +1143,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
static int bond_option_fail_over_mac_set(struct bonding *bond, static int bond_option_fail_over_mac_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting fail_over_mac to %s (%llu)\n", netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.fail_over_mac = newval->value; bond->params.fail_over_mac = newval->value;
return 0; return 0;
...@@ -1168,8 +1153,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond, ...@@ -1168,8 +1153,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
static int bond_option_xmit_hash_policy_set(struct bonding *bond, static int bond_option_xmit_hash_policy_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting xmit hash policy to %s (%llu)\n", netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.xmit_policy = newval->value; bond->params.xmit_policy = newval->value;
return 0; return 0;
...@@ -1178,8 +1163,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond, ...@@ -1178,8 +1163,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
static int bond_option_resend_igmp_set(struct bonding *bond, static int bond_option_resend_igmp_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting resend_igmp to %llu\n", netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.resend_igmp = newval->value; bond->params.resend_igmp = newval->value;
return 0; return 0;
...@@ -1217,8 +1202,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond, ...@@ -1217,8 +1202,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
static int bond_option_min_links_set(struct bonding *bond, static int bond_option_min_links_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting min links value to %llu\n", netdev_info(bond->dev, "Setting min links value to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.min_links = newval->value; bond->params.min_links = newval->value;
return 0; return 0;
...@@ -1253,8 +1238,8 @@ static int bond_option_pps_set(struct bonding *bond, ...@@ -1253,8 +1238,8 @@ static int bond_option_pps_set(struct bonding *bond,
static int bond_option_lacp_rate_set(struct bonding *bond, static int bond_option_lacp_rate_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting LACP rate to %s (%llu)\n", netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.lacp_fast = newval->value; bond->params.lacp_fast = newval->value;
bond_3ad_update_lacp_rate(bond); bond_3ad_update_lacp_rate(bond);
...@@ -1264,8 +1249,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond, ...@@ -1264,8 +1249,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
static int bond_option_ad_select_set(struct bonding *bond, static int bond_option_ad_select_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting ad_select to %s (%llu)\n", netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.ad_select = newval->value; bond->params.ad_select = newval->value;
return 0; return 0;
...@@ -1326,7 +1311,7 @@ static int bond_option_queue_id_set(struct bonding *bond, ...@@ -1326,7 +1311,7 @@ static int bond_option_queue_id_set(struct bonding *bond,
return ret; return ret;
err_no_cmd: err_no_cmd:
pr_info("invalid input for queue_id set for %s\n", bond->dev->name); netdev_info(bond->dev, "invalid input for queue_id set\n");
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -1348,20 +1333,20 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1348,20 +1333,20 @@ static int bond_option_slaves_set(struct bonding *bond,
dev = __dev_get_by_name(dev_net(bond->dev), ifname); dev = __dev_get_by_name(dev_net(bond->dev), ifname);
if (!dev) { if (!dev) {
pr_info("%s: interface %s does not exist!\n", netdev_info(bond->dev, "interface %s does not exist!\n",
bond->dev->name, ifname); ifname);
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
switch (command[0]) { switch (command[0]) {
case '+': case '+':
pr_info("%s: Adding slave %s\n", bond->dev->name, dev->name); netdev_info(bond->dev, "Adding slave %s\n", dev->name);
ret = bond_enslave(bond->dev, dev); ret = bond_enslave(bond->dev, dev);
break; break;
case '-': case '-':
pr_info("%s: Removing slave %s\n", bond->dev->name, dev->name); netdev_info(bond->dev, "Removing slave %s\n", dev->name);
ret = bond_release(bond->dev, dev); ret = bond_release(bond->dev, dev);
break; break;
...@@ -1373,8 +1358,7 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1373,8 +1358,7 @@ static int bond_option_slaves_set(struct bonding *bond,
return ret; return ret;
err_no_cmd: err_no_cmd:
pr_err("no command found in slaves file for bond %s - use +ifname or -ifname\n", netdev_err(bond->dev, "no command found in slaves file - use +ifname or -ifname\n");
bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
...@@ -1382,8 +1366,8 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1382,8 +1366,8 @@ static int bond_option_slaves_set(struct bonding *bond,
static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting dynamic-lb to %s (%llu)\n", netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.tlb_dynamic_lb = newval->value; bond->params.tlb_dynamic_lb = newval->value;
return 0; return 0;
......
...@@ -252,7 +252,7 @@ void bond_create_proc_entry(struct bonding *bond) ...@@ -252,7 +252,7 @@ void bond_create_proc_entry(struct bonding *bond)
S_IRUGO, bn->proc_dir, S_IRUGO, bn->proc_dir,
&bond_info_fops, bond); &bond_info_fops, bond);
if (bond->proc_entry == NULL) if (bond->proc_entry == NULL)
pr_warn("Warning: Cannot create /proc/net/%s/%s\n", netdev_warn(bond_dev, "Cannot create /proc/net/%s/%s\n",
DRV_NAME, bond_dev->name); DRV_NAME, bond_dev->name);
else else
memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
......
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