Commit a4aee5c8 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/bonding/: : use pr_fmt

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove DRV_NAME from pr_<level>s
Consolidate long format strings
Remove some extra tab indents
Remove some unnecessary ()s from pr_<level>s arguments
Align pr_<level> arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 231d52a7
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
*/ */
#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>
...@@ -352,7 +354,8 @@ static u16 __get_link_speed(struct port *port) ...@@ -352,7 +354,8 @@ static u16 __get_link_speed(struct port *port)
} }
} }
pr_debug("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed); pr_debug("Port %d Received link speed %d update from adapter\n",
port->actor_port_number, speed);
return speed; return speed;
} }
...@@ -378,12 +381,14 @@ static u8 __get_duplex(struct port *port) ...@@ -378,12 +381,14 @@ 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", port->actor_port_number); pr_debug("Port %d Received status full duplex update from adapter\n",
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", port->actor_port_number); pr_debug("Port %d Received status NOT full duplex update from adapter\n",
port->actor_port_number);
break; break;
} }
} }
...@@ -980,7 +985,9 @@ static void ad_mux_machine(struct port *port) ...@@ -980,7 +985,9 @@ static void ad_mux_machine(struct port *port)
// check if the state machine was changed // check if the state machine was changed
if (port->sm_mux_state != last_state) { if (port->sm_mux_state != last_state) {
pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state); pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->actor_port_number, last_state,
port->sm_mux_state);
switch (port->sm_mux_state) { switch (port->sm_mux_state) {
case AD_MUX_DETACHED: case AD_MUX_DETACHED:
__detach_bond_from_agg(port); __detach_bond_from_agg(port);
...@@ -1079,7 +1086,9 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1079,7 +1086,9 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
// check if the State machine was changed or new lacpdu arrived // check if the State machine was changed or new lacpdu arrived
if ((port->sm_rx_state != last_state) || (lacpdu)) { if ((port->sm_rx_state != last_state) || (lacpdu)) {
pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state); pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->actor_port_number, last_state,
port->sm_rx_state);
switch (port->sm_rx_state) { switch (port->sm_rx_state) {
case AD_RX_INITIALIZE: case AD_RX_INITIALIZE:
if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) { if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) {
...@@ -1126,9 +1135,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1126,9 +1135,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
// detect loopback situation // detect loopback situation
if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) {
// INFO_RECEIVED_LOOPBACK_FRAMES // INFO_RECEIVED_LOOPBACK_FRAMES
pr_err(DRV_NAME ": %s: An illegal loopback occurred on " pr_err("%s: An illegal loopback occurred on adapter (%s).\n"
"adapter (%s). Check the configuration to verify that all " "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n",
"Adapters are connected to 802.3ad compliant switch ports\n",
port->slave->dev->master->name, port->slave->dev->name); port->slave->dev->master->name, port->slave->dev->name);
__release_rx_machine_lock(port); __release_rx_machine_lock(port);
return; return;
...@@ -1166,7 +1174,8 @@ static void ad_tx_machine(struct port *port) ...@@ -1166,7 +1174,8 @@ static void ad_tx_machine(struct port *port)
__update_lacpdu_from_port(port); __update_lacpdu_from_port(port);
if (ad_lacpdu_send(port) >= 0) { if (ad_lacpdu_send(port) >= 0) {
pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); pr_debug("Sent LACPDU on port %d\n",
port->actor_port_number);
/* mark ntt as false, so it will not be sent again until /* mark ntt as false, so it will not be sent again until
demanded */ demanded */
...@@ -1241,7 +1250,9 @@ static void ad_periodic_machine(struct port *port) ...@@ -1241,7 +1250,9 @@ static void ad_periodic_machine(struct port *port)
// check if the state machine was changed // check if the state machine was changed
if (port->sm_periodic_state != last_state) { if (port->sm_periodic_state != last_state) {
pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state); pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->actor_port_number, last_state,
port->sm_periodic_state);
switch (port->sm_periodic_state) { switch (port->sm_periodic_state) {
case AD_NO_PERIODIC: case AD_NO_PERIODIC:
port->sm_periodic_timer_counter = 0; // zero timer port->sm_periodic_timer_counter = 0; // zero timer
...@@ -1298,7 +1309,9 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1298,7 +1309,9 @@ 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", port->actor_port_number, temp_aggregator->aggregator_identifier); pr_debug("Port %d left LAG %d\n",
port->actor_port_number,
temp_aggregator->aggregator_identifier);
// if the aggregator is empty, clear its parameters, and set it ready to be attached // if the aggregator is empty, clear its parameters, and set it ready to be attached
if (!temp_aggregator->lag_ports) { if (!temp_aggregator->lag_ports) {
ad_clear_agg(temp_aggregator); ad_clear_agg(temp_aggregator);
...@@ -1307,9 +1320,7 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1307,9 +1320,7 @@ static void ad_port_selection_logic(struct port *port)
} }
} }
if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list
pr_warning(DRV_NAME ": %s: Warning: Port %d (on %s) " pr_warning("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n",
"was related to aggregator %d but was not "
"on its port list\n",
port->slave->dev->master->name, port->slave->dev->master->name,
port->actor_port_number, port->actor_port_number,
port->slave->dev->name, port->slave->dev->name,
...@@ -1343,7 +1354,9 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1343,7 +1354,9 @@ 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", port->actor_port_number, port->aggregator->aggregator_identifier); pr_debug("Port %d joined LAG %d(existing LAG)\n",
port->actor_port_number,
port->aggregator->aggregator_identifier);
// mark this port as selected // mark this port as selected
port->sm_vars |= AD_PORT_SELECTED; port->sm_vars |= AD_PORT_SELECTED;
...@@ -1380,10 +1393,11 @@ static void ad_port_selection_logic(struct port *port) ...@@ -1380,10 +1393,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", port->actor_port_number, port->aggregator->aggregator_identifier); pr_debug("Port %d joined LAG %d(new LAG)\n",
port->actor_port_number,
port->aggregator->aggregator_identifier);
} else { } else {
pr_err(DRV_NAME ": %s: Port %d (on %s) did not find " pr_err("%s: Port %d (on %s) did not find a suitable aggregator\n",
"a suitable aggregator\n",
port->slave->dev->master->name, port->slave->dev->master->name,
port->actor_port_number, port->slave->dev->name); port->actor_port_number, port->slave->dev->name);
} }
...@@ -1460,8 +1474,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, ...@@ -1460,8 +1474,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
break; break;
default: default:
pr_warning(DRV_NAME pr_warning("%s: Impossible agg select mode %d\n",
": %s: Impossible agg select mode %d\n",
curr->slave->dev->master->name, curr->slave->dev->master->name,
__get_agg_selection_mode(curr->lag_ports)); __get_agg_selection_mode(curr->lag_ports));
break; break;
...@@ -1566,9 +1579,7 @@ static void ad_agg_selection_logic(struct aggregator *agg) ...@@ -1566,9 +1579,7 @@ 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_warning(DRV_NAME ": %s: Warning: No 802.3ad" pr_warning("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
" response from the link partner for any"
" adapters in the bond\n",
best->slave->dev->master->name); best->slave->dev->master->name);
} }
...@@ -1633,7 +1644,8 @@ static void ad_clear_agg(struct aggregator *aggregator) ...@@ -1633,7 +1644,8 @@ static void ad_clear_agg(struct aggregator *aggregator)
aggregator->lag_ports = NULL; aggregator->lag_ports = NULL;
aggregator->is_active = 0; aggregator->is_active = 0;
aggregator->num_of_ports = 0; aggregator->num_of_ports = 0;
pr_debug("LAG %d was cleared\n", aggregator->aggregator_identifier); pr_debug("LAG %d was cleared\n",
aggregator->aggregator_identifier);
} }
} }
...@@ -1728,7 +1740,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast) ...@@ -1728,7 +1740,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast)
static void ad_enable_collecting_distributing(struct port *port) static void ad_enable_collecting_distributing(struct port *port)
{ {
if (port->aggregator->is_active) { if (port->aggregator->is_active) {
pr_debug("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); pr_debug("Enabling port %d(LAG %d)\n",
port->actor_port_number,
port->aggregator->aggregator_identifier);
__enable_port(port); __enable_port(port);
} }
} }
...@@ -1741,7 +1755,9 @@ static void ad_enable_collecting_distributing(struct port *port) ...@@ -1741,7 +1755,9 @@ static void ad_enable_collecting_distributing(struct port *port)
static void ad_disable_collecting_distributing(struct port *port) static void ad_disable_collecting_distributing(struct port *port)
{ {
if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) {
pr_debug("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); pr_debug("Disabling port %d(LAG %d)\n",
port->actor_port_number,
port->aggregator->aggregator_identifier);
__disable_port(port); __disable_port(port);
} }
} }
...@@ -1779,7 +1795,8 @@ static void ad_marker_info_send(struct port *port) ...@@ -1779,7 +1795,8 @@ static void ad_marker_info_send(struct port *port)
// send the marker information // send the marker information
if (ad_marker_send(port, &marker) >= 0) { if (ad_marker_send(port, &marker) >= 0) {
pr_debug("Sent Marker Information on port %d\n", port->actor_port_number); pr_debug("Sent Marker Information on port %d\n",
port->actor_port_number);
} }
} }
#endif #endif
...@@ -1803,7 +1820,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info, ...@@ -1803,7 +1820,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info,
// send the marker response // send the marker response
if (ad_marker_send(port, &marker) >= 0) { if (ad_marker_send(port, &marker) >= 0) {
pr_debug("Sent Marker Response on port %d\n", port->actor_port_number); pr_debug("Sent Marker Response on port %d\n",
port->actor_port_number);
} }
} }
...@@ -1889,8 +1907,7 @@ int bond_3ad_bind_slave(struct slave *slave) ...@@ -1889,8 +1907,7 @@ int bond_3ad_bind_slave(struct slave *slave)
struct aggregator *aggregator; struct aggregator *aggregator;
if (bond == NULL) { if (bond == NULL) {
pr_err(DRV_NAME ": %s: The slave %s is not attached to " pr_err("%s: The slave %s is not attached to its bond\n",
"its bond\n",
slave->dev->master->name, slave->dev->name); slave->dev->master->name, slave->dev->name);
return -1; return -1;
} }
...@@ -1966,13 +1983,13 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1966,13 +1983,13 @@ 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_warning(DRV_NAME ": Warning: %s: Trying to " pr_warning("Warning: %s: Trying to unbind an uninitialized port on %s\n",
"unbind an uninitialized port on %s\n",
slave->dev->master->name, slave->dev->name); slave->dev->master->name, slave->dev->name);
return; return;
} }
pr_debug("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier); pr_debug("Unbinding Link Aggregation Group %d\n",
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 */
port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;
...@@ -1996,10 +2013,12 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1996,10 +2013,12 @@ void bond_3ad_unbind_slave(struct slave *slave)
// if new aggregator found, copy the aggregator's parameters // if new aggregator found, copy the aggregator's parameters
// and connect the related lag_ports to the new aggregator // and connect the related lag_ports to the 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 - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n",
aggregator->aggregator_identifier,
new_aggregator->aggregator_identifier);
if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {
pr_info(DRV_NAME ": %s: Removing an active aggregator\n", pr_info("%s: Removing an active aggregator\n",
aggregator->slave->dev->master->name); aggregator->slave->dev->master->name);
// select new active aggregator // select new active aggregator
select_new_active_agg = 1; select_new_active_agg = 1;
...@@ -2030,8 +2049,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2030,8 +2049,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
ad_agg_selection_logic(__get_first_agg(port)); ad_agg_selection_logic(__get_first_agg(port));
} }
} else { } else {
pr_warning(DRV_NAME ": %s: Warning: unbinding aggregator, " pr_warning("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n",
"and could not find a new aggregator for its ports\n",
slave->dev->master->name); slave->dev->master->name);
} }
} else { // in case that the only port related to this aggregator is the one we want to remove } else { // in case that the only port related to this aggregator is the one we want to remove
...@@ -2039,7 +2057,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2039,7 +2057,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
// clear the aggregator // clear the aggregator
ad_clear_agg(aggregator); ad_clear_agg(aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
pr_info(DRV_NAME ": %s: Removing an active aggregator\n", pr_info("%s: Removing an active aggregator\n",
slave->dev->master->name); slave->dev->master->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));
...@@ -2066,7 +2084,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2066,7 +2084,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
// clear the aggregator // clear the aggregator
ad_clear_agg(temp_aggregator); ad_clear_agg(temp_aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
pr_info(DRV_NAME ": %s: Removing an active aggregator\n", pr_info("%s: Removing an active aggregator\n",
slave->dev->master->name); slave->dev->master->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));
...@@ -2115,8 +2133,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) ...@@ -2115,8 +2133,8 @@ 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 = __get_first_port(bond))) { if ((port = __get_first_port(bond))) {
if (!port->slave) { if (!port->slave) {
pr_warning(DRV_NAME ": %s: Warning: bond's first port is " pr_warning("%s: Warning: bond's first port is uninitialized\n",
"uninitialized\n", bond->dev->name); bond->dev->name);
goto re_arm; goto re_arm;
} }
...@@ -2129,8 +2147,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) ...@@ -2129,8 +2147,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
// for each port run the state machines // for each port run the state machines
for (port = __get_first_port(bond); port; port = __get_next_port(port)) { for (port = __get_first_port(bond); port; port = __get_next_port(port)) {
if (!port->slave) { if (!port->slave) {
pr_warning(DRV_NAME ": %s: Warning: Found an uninitialized " pr_warning("%s: Warning: Found an uninitialized port\n",
"port\n", bond->dev->name); bond->dev->name);
goto re_arm; goto re_arm;
} }
...@@ -2171,15 +2189,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u ...@@ -2171,15 +2189,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
port = &(SLAVE_AD_INFO(slave).port); port = &(SLAVE_AD_INFO(slave).port);
if (!port->slave) { if (!port->slave) {
pr_warning(DRV_NAME ": %s: Warning: port of slave %s " pr_warning("%s: Warning: port of slave %s is uninitialized\n",
"is uninitialized\n",
slave->dev->name, slave->dev->master->name); slave->dev->name, slave->dev->master->name);
return; return;
} }
switch (lacpdu->subtype) { switch (lacpdu->subtype) {
case AD_TYPE_LACPDU: case AD_TYPE_LACPDU:
pr_debug("Received LACPDU on port %d\n", port->actor_port_number); pr_debug("Received LACPDU on port %d\n",
port->actor_port_number);
ad_rx_machine(lacpdu, port); ad_rx_machine(lacpdu, port);
break; break;
...@@ -2188,17 +2206,20 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u ...@@ -2188,17 +2206,20 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
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", port->actor_port_number); pr_debug("Received Marker Information on port %d\n",
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", port->actor_port_number); pr_debug("Received Marker Response on port %d\n",
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", port->actor_port_number); pr_debug("Received an unknown Marker subtype on slot %d\n",
port->actor_port_number);
} }
} }
} }
...@@ -2218,8 +2239,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) ...@@ -2218,8 +2239,7 @@ 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_warning(DRV_NAME ": Warning: %s: speed " pr_warning("Warning: %s: speed changed for uninitialized port on %s\n",
"changed for uninitialized port on %s\n",
slave->dev->master->name, slave->dev->name); slave->dev->master->name, slave->dev->name);
return; return;
} }
...@@ -2246,8 +2266,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) ...@@ -2246,8 +2266,7 @@ 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_warning(DRV_NAME ": %s: Warning: duplex changed " pr_warning("%s: Warning: duplex changed for uninitialized port on %s\n",
"for uninitialized port on %s\n",
slave->dev->master->name, slave->dev->name); slave->dev->master->name, slave->dev->name);
return; return;
} }
...@@ -2275,8 +2294,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) ...@@ -2275,8 +2294,7 @@ 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_warning(DRV_NAME ": Warning: %s: link status changed for " pr_warning("Warning: %s: link status changed for uninitialized port on %s\n",
"uninitialized port on %s\n",
slave->dev->master->name, slave->dev->name); slave->dev->master->name, slave->dev->name);
return; return;
} }
...@@ -2381,8 +2399,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2381,8 +2399,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
} }
if (bond_3ad_get_active_agg_info(bond, &ad_info)) { if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
pr_debug(DRV_NAME ": %s: Error: " pr_debug("%s: Error: bond_3ad_get_active_agg_info failed\n",
"bond_3ad_get_active_agg_info failed\n", dev->name); dev->name);
goto out; goto out;
} }
...@@ -2391,8 +2409,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2391,8 +2409,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
if (slaves_in_agg == 0) { if (slaves_in_agg == 0) {
/*the aggregator is empty*/ /*the aggregator is empty*/
pr_debug(DRV_NAME ": %s: Error: active aggregator is empty\n", pr_debug("%s: Error: active aggregator is empty\n", dev->name);
dev->name);
goto out; goto out;
} }
...@@ -2410,8 +2427,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2410,8 +2427,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(DRV_NAME ": %s: Error: Couldn't find a slave to tx on " pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n",
"for aggregator ID %d\n", dev->name, agg_id); dev->name, agg_id);
goto out; goto out;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
*/ */
#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>
...@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond) ...@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond)
new_hashtbl = kzalloc(size, GFP_KERNEL); new_hashtbl = kzalloc(size, GFP_KERNEL);
if (!new_hashtbl) { if (!new_hashtbl) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to allocate TLB hash table\n",
": %s: Error: Failed to allocate TLB hash table\n",
bond->dev->name); bond->dev->name);
return -1; return -1;
} }
...@@ -514,8 +515,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -514,8 +515,7 @@ 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(DRV_NAME pr_err("%s: Error: failed to create an ARP packet\n",
": %s: Error: failed to create an ARP packet\n",
client_info->slave->dev->master->name); client_info->slave->dev->master->name);
continue; continue;
} }
...@@ -525,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -525,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
if (client_info->tag) { if (client_info->tag) {
skb = vlan_put_tag(skb, client_info->vlan_id); skb = vlan_put_tag(skb, client_info->vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME pr_err("%s: Error: failed to insert VLAN tag\n",
": %s: Error: failed to insert VLAN tag\n",
client_info->slave->dev->master->name); client_info->slave->dev->master->name);
continue; continue;
} }
...@@ -609,9 +608,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) ...@@ -609,9 +608,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(DRV_NAME pr_err("%s: Error: found a client with no channel in the client's hash table\n",
": %s: Error: found a client with no channel in "
"the client's hash table\n",
bond->dev->name); bond->dev->name);
continue; continue;
} }
...@@ -806,8 +803,7 @@ static int rlb_initialize(struct bonding *bond) ...@@ -806,8 +803,7 @@ static int rlb_initialize(struct bonding *bond)
new_hashtbl = kmalloc(size, GFP_KERNEL); new_hashtbl = kmalloc(size, GFP_KERNEL);
if (!new_hashtbl) { if (!new_hashtbl) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to allocate RLB hash table\n",
": %s: Error: Failed to allocate RLB hash table\n",
bond->dev->name); bond->dev->name);
return -1; return -1;
} }
...@@ -928,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) ...@@ -928,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
skb = vlan_put_tag(skb, vlan->vlan_id); skb = vlan_put_tag(skb, vlan->vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME pr_err("%s: Error: failed to insert VLAN tag\n",
": %s: Error: failed to insert VLAN tag\n",
bond->dev->name); bond->dev->name);
continue; continue;
} }
...@@ -958,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) ...@@ -958,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
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(DRV_NAME pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n"
": %s: Error: dev_set_mac_address of dev %s failed! ALB " "ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n",
"mode requires that the base driver support setting "
"the hw address also when the network device's "
"interface is open\n",
dev->master->name, dev->name); dev->master->name, dev->name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -1169,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -1169,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr,
bond->alb_info.rlb_enabled); bond->alb_info.rlb_enabled);
pr_warning(DRV_NAME pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n",
": %s: Warning: 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, bond->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(DRV_NAME 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",
": %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",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
return -EFAULT; return -EFAULT;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h> #include <linux/types.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <net/ipv6.h> #include <net/ipv6.h>
...@@ -80,14 +82,14 @@ static void bond_na_send(struct net_device *slave_dev, ...@@ -80,14 +82,14 @@ static void bond_na_send(struct net_device *slave_dev,
ND_OPT_TARGET_LL_ADDR); ND_OPT_TARGET_LL_ADDR);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": NA packet allocation failed\n"); pr_err("NA packet allocation failed\n");
return; return;
} }
if (vlan_id) { if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id); skb = vlan_put_tag(skb, vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": failed to insert VLAN tag\n"); pr_err("failed to insert VLAN tag\n");
return; return;
} }
} }
...@@ -109,8 +111,8 @@ void bond_send_unsolicited_na(struct bonding *bond) ...@@ -109,8 +111,8 @@ void bond_send_unsolicited_na(struct bonding *bond)
struct inet6_dev *idev; struct inet6_dev *idev;
int is_router; int is_router;
pr_debug("bond_send_unsol_na: bond %s slave %s\n", bond->dev->name, pr_debug("%s: bond %s slave %s\n", bond->dev->name,
slave ? slave->dev->name : "NULL"); __func__, slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_unsol_na || if (!slave || !bond->send_unsol_na ||
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
* *
*/ */
#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>
...@@ -303,8 +305,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) ...@@ -303,8 +305,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
if (bond_is_lb(bond)) if (bond_is_lb(bond))
bond_alb_clear_vlan(bond, vlan_id); bond_alb_clear_vlan(bond, vlan_id);
pr_debug("removed VLAN ID %d from bond %s\n", vlan_id, pr_debug("removed VLAN ID %d from bond %s\n",
bond->dev->name); vlan_id, bond->dev->name);
kfree(vlan); kfree(vlan);
...@@ -323,8 +325,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) ...@@ -323,8 +325,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
} }
} }
pr_debug("couldn't find VLAN ID %d in bond %s\n", vlan_id, pr_debug("couldn't find VLAN ID %d in bond %s\n",
bond->dev->name); vlan_id, bond->dev->name);
out: out:
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
...@@ -499,8 +501,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) ...@@ -499,8 +501,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
res = bond_add_vlan(bond, vid); res = bond_add_vlan(bond, vid);
if (res) { if (res) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to add vlan id %d\n",
": %s: Error: Failed to add vlan id %d\n",
bond_dev->name, vid); bond_dev->name, vid);
} }
} }
...@@ -534,8 +535,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) ...@@ -534,8 +535,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
res = bond_del_vlan(bond, vid); res = bond_del_vlan(bond, vid);
if (res) { if (res) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to remove vlan id %d\n",
": %s: Error: Failed to remove vlan id %d\n",
bond_dev->name, vid); bond_dev->name, vid);
} }
} }
...@@ -1053,8 +1053,7 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -1053,8 +1053,7 @@ 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(DRV_NAME pr_err("%s: Error %d setting MAC of slave %s\n",
": %s: Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name); bond->dev->name, -rv, new_active->dev->name);
goto out; goto out;
} }
...@@ -1067,16 +1066,14 @@ static void bond_do_fail_over_mac(struct bonding *bond, ...@@ -1067,16 +1066,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(DRV_NAME pr_err("%s: Error %d setting MAC of slave %s\n",
": %s: Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name); bond->dev->name, -rv, new_active->dev->name);
out: out:
read_lock(&bond->lock); read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock); write_lock_bh(&bond->curr_slave_lock);
break; break;
default: default:
pr_err(DRV_NAME pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n",
": %s: bond_do_fail_over_mac impossible: bad policy %d\n",
bond->dev->name, bond->params.fail_over_mac); bond->dev->name, bond->params.fail_over_mac);
break; break;
} }
...@@ -1178,9 +1175,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -1178,9 +1175,7 @@ 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 (USES_PRIMARY(bond->params.mode)) { if (USES_PRIMARY(bond->params.mode)) {
pr_info(DRV_NAME pr_info("%s: making interface %s the new active one %d ms earlier.\n",
": %s: making interface %s the new "
"active one %d ms earlier.\n",
bond->dev->name, new_active->dev->name, bond->dev->name, new_active->dev->name,
(bond->params.updelay - new_active->delay) * bond->params.miimon); (bond->params.updelay - new_active->delay) * bond->params.miimon);
} }
...@@ -1195,9 +1190,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -1195,9 +1190,7 @@ 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 (USES_PRIMARY(bond->params.mode)) { if (USES_PRIMARY(bond->params.mode)) {
pr_info(DRV_NAME pr_info("%s: making interface %s the new active one.\n",
": %s: making interface %s the new "
"active one.\n",
bond->dev->name, new_active->dev->name); bond->dev->name, new_active->dev->name);
} }
} }
...@@ -1268,12 +1261,10 @@ void bond_select_active_slave(struct bonding *bond) ...@@ -1268,12 +1261,10 @@ void bond_select_active_slave(struct bonding *bond)
return; return;
if (netif_carrier_ok(bond->dev)) { if (netif_carrier_ok(bond->dev)) {
pr_info(DRV_NAME pr_info("%s: first active interface up!\n",
": %s: first active interface up!\n",
bond->dev->name); bond->dev->name);
} else { } else {
pr_info(DRV_NAME ": %s: " pr_info("%s: now running without any active interface !\n",
"now running without any active interface !\n",
bond->dev->name); bond->dev->name);
} }
} }
...@@ -1423,15 +1414,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1423,15 +1414,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&
slave_ops->ndo_do_ioctl == NULL) { slave_ops->ndo_do_ioctl == NULL) {
pr_warning(DRV_NAME pr_warning("%s: Warning: no link monitoring support for %s\n",
": %s: Warning: no link monitoring support for %s\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
} }
/* bond must be initialized by bond_open() before enslaving */ /* bond must be initialized by bond_open() before enslaving */
if (!(bond_dev->flags & IFF_UP)) { if (!(bond_dev->flags & IFF_UP)) {
pr_warning(DRV_NAME pr_warning("%s: master_dev is not up in bond_enslave\n",
" %s: master_dev is not up in bond_enslave\n",
bond_dev->name); bond_dev->name);
} }
...@@ -1446,19 +1435,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1446,19 +1435,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
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); pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name);
if (!list_empty(&bond->vlan_list)) { if (!list_empty(&bond->vlan_list)) {
pr_err(DRV_NAME pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
": %s: Error: cannot enslave VLAN " bond_dev->name, slave_dev->name, bond_dev->name);
"challenged slave %s on VLAN enabled "
"bond %s\n", bond_dev->name, slave_dev->name,
bond_dev->name);
return -EPERM; return -EPERM;
} else { } else {
pr_warning(DRV_NAME pr_warning("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
": %s: Warning: enslaved VLAN challenged " bond_dev->name, slave_dev->name,
"slave %s. Adding VLANs will be blocked as " slave_dev->name, bond_dev->name);
"long as %s is part of bond %s\n",
bond_dev->name, slave_dev->name, slave_dev->name,
bond_dev->name);
bond_dev->features |= NETIF_F_VLAN_CHALLENGED; bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
} }
} else { } else {
...@@ -1478,8 +1461,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1478,8 +1461,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(DRV_NAME ": %s is up. " pr_err("%s is up. This may be due to an out of date ifenslave.\n",
"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;
...@@ -1495,7 +1477,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1495,7 +1477,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (bond->slave_cnt == 0) { if (bond->slave_cnt == 0) {
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", pr_debug("%s: change device type from %d to %d\n",
bond_dev->name, bond_dev->type, slave_dev->type); bond_dev->name,
bond_dev->type, slave_dev->type);
netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE);
...@@ -1507,8 +1490,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1507,8 +1490,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE);
} }
} else if (bond_dev->type != slave_dev->type) { } else if (bond_dev->type != slave_dev->type) {
pr_err(DRV_NAME ": %s ether type (%d) is different " pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
"from other slaves (%d), can not enslave it.\n",
slave_dev->name, slave_dev->name,
slave_dev->type, bond_dev->type); slave_dev->type, bond_dev->type);
res = -EINVAL; res = -EINVAL;
...@@ -1517,18 +1499,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1517,18 +1499,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (slave_ops->ndo_set_mac_address == NULL) { if (slave_ops->ndo_set_mac_address == NULL) {
if (bond->slave_cnt == 0) { if (bond->slave_cnt == 0) {
pr_warning(DRV_NAME pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active.",
": %s: Warning: The first slave device "
"specified does not support setting the MAC "
"address. Setting fail_over_mac to active.",
bond_dev->name); bond_dev->name);
bond->params.fail_over_mac = BOND_FOM_ACTIVE; bond->params.fail_over_mac = BOND_FOM_ACTIVE;
} else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) { } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
pr_err(DRV_NAME 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",
": %s: Error: The slave device specified " bond_dev->name);
"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;
} }
...@@ -1655,21 +1631,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1655,21 +1631,11 @@ 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_warning(DRV_NAME pr_warning("%s: Warning: MII and ETHTOOL support not available for interface %s, and arp_interval/arp_ip_target module parameters not specified, thus bonding will not detect link failures! see bonding.txt for details.\n",
": %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",
bond_dev->name, slave_dev->name); bond_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_warning(DRV_NAME pr_warning("%s: Warning: can't get link status from interface %s; the network driver associated with this interface does not support MII or ETHTOOL link status reporting, thus miimon has no effect on this interface.\n",
": %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",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
} }
} }
...@@ -1678,34 +1644,27 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1678,34 +1644,27 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.miimon || if (!bond->params.miimon ||
(bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) {
if (bond->params.updelay) { if (bond->params.updelay) {
pr_debug("Initial state of slave_dev is " pr_debug("Initial state of slave_dev is BOND_LINK_BACK\n");
"BOND_LINK_BACK\n");
new_slave->link = BOND_LINK_BACK; new_slave->link = BOND_LINK_BACK;
new_slave->delay = bond->params.updelay; new_slave->delay = bond->params.updelay;
} else { } else {
pr_debug("Initial state of slave_dev is " pr_debug("Initial state of slave_dev is BOND_LINK_UP\n");
"BOND_LINK_UP\n");
new_slave->link = BOND_LINK_UP; new_slave->link = BOND_LINK_UP;
} }
new_slave->jiffies = jiffies; new_slave->jiffies = jiffies;
} else { } else {
pr_debug("Initial state of slave_dev is " pr_debug("Initial state of slave_dev is BOND_LINK_DOWN\n");
"BOND_LINK_DOWN\n");
new_slave->link = BOND_LINK_DOWN; new_slave->link = BOND_LINK_DOWN;
} }
if (bond_update_speed_duplex(new_slave) && if (bond_update_speed_duplex(new_slave) &&
(new_slave->link != BOND_LINK_DOWN)) { (new_slave->link != BOND_LINK_DOWN)) {
pr_warning(DRV_NAME pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n",
": %s: Warning: failed to get speed and duplex from %s, "
"assumed to be 100Mb/sec and Full.\n",
bond_dev->name, new_slave->dev->name); bond_dev->name, new_slave->dev->name);
if (bond->params.mode == BOND_MODE_8023AD) { if (bond->params.mode == BOND_MODE_8023AD) {
pr_warning(DRV_NAME pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n",
": %s: Warning: Operation of 802.3ad mode requires ETHTOOL " bond_dev->name);
"support in base driver for proper aggregator "
"selection.\n", bond_dev->name);
} }
} }
...@@ -1777,8 +1736,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1777,8 +1736,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (res) if (res)
goto err_close; goto err_close;
pr_info(DRV_NAME pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
": %s: enslaving %s as a%s interface with a%s link.\n",
bond_dev->name, slave_dev->name, bond_dev->name, slave_dev->name,
new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup", new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup",
new_slave->link != BOND_LINK_DOWN ? "n up" : " down"); new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
...@@ -1833,8 +1791,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1833,8 +1791,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_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) ||
(slave_dev->master != bond_dev)) { (slave_dev->master != bond_dev)) {
pr_err(DRV_NAME pr_err("%s: Error: cannot release %s.\n",
": %s: Error: cannot release %s.\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
return -EINVAL; return -EINVAL;
} }
...@@ -1844,8 +1801,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1844,8 +1801,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_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(DRV_NAME pr_info("%s: %s not enslaved\n",
": %s: %s not enslaved\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
return -EINVAL; return -EINVAL;
...@@ -1854,11 +1810,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1854,11 +1810,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.fail_over_mac) { if (!bond->params.fail_over_mac) {
if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
bond->slave_cnt > 1) bond->slave_cnt > 1)
pr_warning(DRV_NAME pr_warning("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s. Set the HWaddr of %s to a different address to avoid conflicts.\n",
": %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",
bond_dev->name, slave_dev->name, bond_dev->name, slave_dev->name,
slave->perm_hwaddr, slave->perm_hwaddr,
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
...@@ -1872,11 +1824,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1872,11 +1824,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
bond_3ad_unbind_slave(slave); bond_3ad_unbind_slave(slave);
} }
pr_info(DRV_NAME pr_info("%s: releasing %s interface %s\n",
": %s: releasing %s interface %s\n",
bond_dev->name, bond_dev->name,
(slave->state == BOND_STATE_ACTIVE) (slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
? "active" : "backup",
slave_dev->name); slave_dev->name);
oldcurrent = bond->curr_active_slave; oldcurrent = bond->curr_active_slave;
...@@ -1934,20 +1884,14 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1934,20 +1884,14 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
if (list_empty(&bond->vlan_list)) { if (list_empty(&bond->vlan_list)) {
bond_dev->features |= NETIF_F_VLAN_CHALLENGED; bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
} else { } else {
pr_warning(DRV_NAME pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
": %s: Warning: clearing HW address of %s while it "
"still has VLANs.\n",
bond_dev->name, bond_dev->name); bond_dev->name, bond_dev->name);
pr_warning(DRV_NAME pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
": %s: When re-adding slaves, make sure the bond's "
"HW address matches its VLANs'.\n",
bond_dev->name); bond_dev->name);
} }
} else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
!bond_has_challenged_slaves(bond)) { !bond_has_challenged_slaves(bond)) {
pr_info(DRV_NAME pr_info("%s: last VLAN challenged slave %s left bond %s. VLAN blocking is removed\n",
": %s: last VLAN challenged slave %s "
"left bond %s. VLAN blocking is removed\n",
bond_dev->name, slave_dev->name, bond_dev->name); bond_dev->name, slave_dev->name, bond_dev->name);
bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED;
} }
...@@ -2011,7 +1955,7 @@ int bond_release_and_destroy(struct net_device *bond_dev, ...@@ -2011,7 +1955,7 @@ 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->slave_cnt == 0)) { if ((ret == 0) && (bond->slave_cnt == 0)) {
pr_info(DRV_NAME ": %s: destroying bond %s.\n", pr_info("%s: destroying bond %s.\n",
bond_dev->name, bond_dev->name); bond_dev->name, bond_dev->name);
unregister_netdevice(bond_dev); unregister_netdevice(bond_dev);
} }
...@@ -2116,19 +2060,13 @@ static int bond_release_all(struct net_device *bond_dev) ...@@ -2116,19 +2060,13 @@ static int bond_release_all(struct net_device *bond_dev)
if (list_empty(&bond->vlan_list)) if (list_empty(&bond->vlan_list))
bond_dev->features |= NETIF_F_VLAN_CHALLENGED; bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
else { else {
pr_warning(DRV_NAME pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
": %s: Warning: clearing HW address of %s while it "
"still has VLANs.\n",
bond_dev->name, bond_dev->name); bond_dev->name, bond_dev->name);
pr_warning(DRV_NAME pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
": %s: When re-adding slaves, make sure the bond's "
"HW address matches its VLANs'.\n",
bond_dev->name); bond_dev->name);
} }
pr_info(DRV_NAME pr_info("%s: released all slaves\n", bond_dev->name);
": %s: released all slaves\n",
bond_dev->name);
out: out:
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
...@@ -2254,9 +2192,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2254,9 +2192,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(DRV_NAME pr_info("%s: link status down for %sinterface %s, disabling it in %d ms.\n",
": %s: link status down for %s"
"interface %s, disabling it in %d ms.\n",
bond->dev->name, bond->dev->name,
(bond->params.mode == (bond->params.mode ==
BOND_MODE_ACTIVEBACKUP) ? BOND_MODE_ACTIVEBACKUP) ?
...@@ -2273,9 +2209,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2273,9 +2209,7 @@ static int bond_miimon_inspect(struct bonding *bond)
*/ */
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
slave->jiffies = jiffies; slave->jiffies = jiffies;
pr_info(DRV_NAME pr_info("%s: link status up again after %d ms for interface %s.\n",
": %s: link status up again after %d "
"ms for interface %s.\n",
bond->dev->name, bond->dev->name,
(bond->params.downdelay - slave->delay) * (bond->params.downdelay - slave->delay) *
bond->params.miimon, bond->params.miimon,
...@@ -2300,9 +2234,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2300,9 +2234,7 @@ 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(DRV_NAME pr_info("%s: link status up for interface %s, enabling it in %d ms.\n",
": %s: link status up for "
"interface %s, enabling it in %d ms.\n",
bond->dev->name, slave->dev->name, bond->dev->name, slave->dev->name,
ignore_updelay ? 0 : ignore_updelay ? 0 :
bond->params.updelay * bond->params.updelay *
...@@ -2312,9 +2244,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2312,9 +2244,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(DRV_NAME pr_info("%s: link status down again after %d ms for interface %s.\n",
": %s: link status down again after %d "
"ms for interface %s.\n",
bond->dev->name, bond->dev->name,
(bond->params.updelay - slave->delay) * (bond->params.updelay - slave->delay) *
bond->params.miimon, bond->params.miimon,
...@@ -2366,9 +2296,7 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2366,9 +2296,7 @@ static void bond_miimon_commit(struct bonding *bond)
slave->state = BOND_STATE_BACKUP; slave->state = BOND_STATE_BACKUP;
} }
pr_info(DRV_NAME pr_info("%s: link status definitely up for interface %s.\n",
": %s: link status definitely "
"up for interface %s.\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
/* notify ad that the link status has changed */ /* notify ad that the link status has changed */
...@@ -2395,9 +2323,7 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2395,9 +2323,7 @@ static void bond_miimon_commit(struct bonding *bond)
bond->params.mode == BOND_MODE_8023AD) bond->params.mode == BOND_MODE_8023AD)
bond_set_slave_inactive_flags(slave); bond_set_slave_inactive_flags(slave);
pr_info(DRV_NAME pr_info("%s: link status definitely down for interface %s, disabling it\n",
": %s: link status definitely down for "
"interface %s, disabling it\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
if (bond->params.mode == BOND_MODE_8023AD) if (bond->params.mode == BOND_MODE_8023AD)
...@@ -2414,8 +2340,7 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2414,8 +2340,7 @@ static void bond_miimon_commit(struct bonding *bond)
continue; continue;
default: default:
pr_err(DRV_NAME pr_err("%s: invalid new link %d on slave %s\n",
": %s: invalid new link %d on slave %s\n",
bond->dev->name, slave->new_link, bond->dev->name, slave->new_link,
slave->dev->name); slave->dev->name);
slave->new_link = BOND_LINK_NOCHANGE; slave->new_link = BOND_LINK_NOCHANGE;
...@@ -2540,13 +2465,13 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ ...@@ -2540,13 +2465,13 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_
NULL, slave_dev->dev_addr, NULL); NULL, slave_dev->dev_addr, NULL);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": ARP packet allocation failed\n"); pr_err("ARP packet allocation failed\n");
return; return;
} }
if (vlan_id) { if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id); skb = vlan_put_tag(skb, vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": failed to insert VLAN tag\n"); pr_err("failed to insert VLAN tag\n");
return; return;
} }
} }
...@@ -2586,8 +2511,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) ...@@ -2586,8 +2511,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl); rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl);
if (rv) { if (rv) {
if (net_ratelimit()) { if (net_ratelimit()) {
pr_warning(DRV_NAME pr_warning("%s: no route to arp_ip_target %pI4\n",
": %s: no route to arp_ip_target %pI4\n",
bond->dev->name, &fl.fl4_dst); bond->dev->name, &fl.fl4_dst);
} }
continue; continue;
...@@ -2623,8 +2547,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) ...@@ -2623,8 +2547,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
} }
if (net_ratelimit()) { if (net_ratelimit()) {
pr_warning(DRV_NAME pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
": %s: no path to arp_ip_target %pI4 via rt.dev %s\n",
bond->dev->name, &fl.fl4_dst, bond->dev->name, &fl.fl4_dst,
rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
} }
...@@ -2644,8 +2567,8 @@ static void bond_send_gratuitous_arp(struct bonding *bond) ...@@ -2644,8 +2567,8 @@ static void bond_send_gratuitous_arp(struct bonding *bond)
struct vlan_entry *vlan; struct vlan_entry *vlan;
struct net_device *vlan_dev; struct net_device *vlan_dev;
pr_debug("bond_send_grat_arp: bond %s slave %s\n", bond->dev->name, pr_debug("bond_send_grat_arp: bond %s slave %s\n",
slave ? slave->dev->name : "NULL"); bond->dev->name, slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_grat_arp || if (!slave || !bond->send_grat_arp ||
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
...@@ -2674,7 +2597,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 ...@@ -2674,7 +2597,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
&sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); &sip, &tip, i, &targets[i],
bond_has_this_ip(bond, tip));
if (sip == targets[i]) { if (sip == targets[i]) {
if (bond_has_this_ip(bond, tip)) if (bond_has_this_ip(bond, tip))
slave->last_arp_rx = jiffies; slave->last_arp_rx = jiffies;
...@@ -2800,15 +2724,12 @@ void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2800,15 +2724,12 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
* is closed. * is closed.
*/ */
if (!oldcurrent) { if (!oldcurrent) {
pr_info(DRV_NAME pr_info("%s: link status definitely up for interface %s, ",
": %s: link status definitely "
"up for interface %s, ",
bond->dev->name, bond->dev->name,
slave->dev->name); slave->dev->name);
do_failover = 1; do_failover = 1;
} else { } else {
pr_info(DRV_NAME pr_info("%s: interface %s is now up\n",
": %s: interface %s is now up\n",
bond->dev->name, bond->dev->name,
slave->dev->name); slave->dev->name);
} }
...@@ -2829,8 +2750,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2829,8 +2750,7 @@ 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(DRV_NAME pr_info("%s: interface %s is now down.\n",
": %s: interface %s is now down.\n",
bond->dev->name, bond->dev->name,
slave->dev->name); slave->dev->name);
...@@ -2965,9 +2885,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) ...@@ -2965,9 +2885,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
pr_info(DRV_NAME pr_info("%s: link status definitely up for interface %s.\n",
": %s: link status definitely "
"up for interface %s.\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
if (!bond->curr_active_slave || if (!bond->curr_active_slave ||
...@@ -2985,9 +2903,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) ...@@ -2985,9 +2903,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
bond_set_slave_inactive_flags(slave); bond_set_slave_inactive_flags(slave);
pr_info(DRV_NAME pr_info("%s: link status definitely down for interface %s, disabling it\n",
": %s: link status definitely down for "
"interface %s, disabling it\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
if (slave == bond->curr_active_slave) { if (slave == bond->curr_active_slave) {
...@@ -2998,8 +2914,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) ...@@ -2998,8 +2914,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
continue; continue;
default: default:
pr_err(DRV_NAME pr_err("%s: impossible: new_link %d on slave %s\n",
": %s: impossible: new_link %d on slave %s\n",
bond->dev->name, slave->new_link, bond->dev->name, slave->new_link,
slave->dev->name); slave->dev->name);
continue; continue;
...@@ -3028,7 +2943,7 @@ static void bond_ab_arp_probe(struct bonding *bond) ...@@ -3028,7 +2943,7 @@ static void bond_ab_arp_probe(struct bonding *bond)
read_lock(&bond->curr_slave_lock); read_lock(&bond->curr_slave_lock);
if (bond->current_arp_slave && bond->curr_active_slave) if (bond->current_arp_slave && bond->curr_active_slave)
pr_info(DRV_NAME "PROBE: c_arp %s && cas %s BAD\n", pr_info("PROBE: c_arp %s && cas %s BAD\n",
bond->current_arp_slave->dev->name, bond->current_arp_slave->dev->name,
bond->curr_active_slave->dev->name); bond->curr_active_slave->dev->name);
...@@ -3078,8 +2993,7 @@ static void bond_ab_arp_probe(struct bonding *bond) ...@@ -3078,8 +2993,7 @@ static void bond_ab_arp_probe(struct bonding *bond)
bond_set_slave_inactive_flags(slave); bond_set_slave_inactive_flags(slave);
pr_info(DRV_NAME pr_info("%s: backup interface %s is now down.\n",
": %s: backup interface %s is now down.\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
} }
} }
...@@ -3360,8 +3274,7 @@ static void bond_create_proc_entry(struct bonding *bond) ...@@ -3360,8 +3274,7 @@ static 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_warning(DRV_NAME pr_warning("Warning: Cannot create /proc/net/%s/%s\n",
": Warning: 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);
...@@ -3388,8 +3301,7 @@ static void bond_create_proc_dir(struct bond_net *bn) ...@@ -3388,8 +3301,7 @@ static void bond_create_proc_dir(struct bond_net *bn)
if (!bn->proc_dir) { if (!bn->proc_dir) {
bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
if (!bn->proc_dir) if (!bn->proc_dir)
pr_warning(DRV_NAME pr_warning("Warning: cannot create /proc/net/%s\n",
": Warning: cannot create /proc/net/%s\n",
DRV_NAME); DRV_NAME);
} }
} }
...@@ -3539,7 +3451,7 @@ static int bond_netdev_event(struct notifier_block *this, ...@@ -3539,7 +3451,7 @@ static int bond_netdev_event(struct notifier_block *this,
struct net_device *event_dev = (struct net_device *)ptr; struct net_device *event_dev = (struct net_device *)ptr;
pr_debug("event_dev: %s, event: %lx\n", pr_debug("event_dev: %s, event: %lx\n",
(event_dev ? event_dev->name : "None"), event_dev ? event_dev->name : "None",
event); event);
if (!(event_dev->priv_flags & IFF_BONDING)) if (!(event_dev->priv_flags & IFF_BONDING))
...@@ -3875,8 +3787,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3875,8 +3787,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
struct mii_ioctl_data *mii = NULL; struct mii_ioctl_data *mii = NULL;
int res = 0; int res = 0;
pr_debug("bond_ioctl: master=%s, cmd=%d\n", pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd);
bond_dev->name, cmd);
switch (cmd) { switch (cmd) {
case SIOCGMIIPHY: case SIOCGMIIPHY:
...@@ -3945,12 +3856,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -3945,12 +3856,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave); slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave);
pr_debug("slave_dev=%p: \n", slave_dev); pr_debug("slave_dev=%p:\n", slave_dev);
if (!slave_dev) if (!slave_dev)
res = -ENODEV; res = -ENODEV;
else { else {
pr_debug("slave_dev->name=%s: \n", slave_dev->name); pr_debug("slave_dev->name=%s:\n", slave_dev->name);
switch (cmd) { switch (cmd) {
case BOND_ENSLAVE_OLD: case BOND_ENSLAVE_OLD:
case SIOCBONDENSLAVE: case SIOCBONDENSLAVE:
...@@ -4077,8 +3988,10 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) ...@@ -4077,8 +3988,10 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
*/ */
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
pr_debug("s %p s->p %p c_m %p\n", slave, pr_debug("s %p s->p %p c_m %p\n",
slave->prev, slave->dev->netdev_ops->ndo_change_mtu); slave,
slave->prev,
slave->dev->netdev_ops->ndo_change_mtu);
res = dev_set_mtu(slave->dev, new_mtu); res = dev_set_mtu(slave->dev, new_mtu);
...@@ -4108,8 +4021,8 @@ unwind: ...@@ -4108,8 +4021,8 @@ unwind:
tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu); tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu);
if (tmp_res) { if (tmp_res) {
pr_debug("unwind err %d dev %s\n", tmp_res, pr_debug("unwind err %d dev %s\n",
slave->dev->name); tmp_res, slave->dev->name);
} }
} }
...@@ -4135,7 +4048,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -4135,7 +4048,8 @@ 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", bond, (bond_dev ? bond_dev->name : "None")); pr_debug("bond=%p, name=%s\n",
bond, bond_dev ? bond_dev->name : "None");
/* /*
* If fail_over_mac is set to active, do nothing and return * If fail_over_mac is set to active, do nothing and return
...@@ -4200,8 +4114,8 @@ unwind: ...@@ -4200,8 +4114,8 @@ unwind:
tmp_res = dev_set_mac_address(slave->dev, &tmp_sa); tmp_res = dev_set_mac_address(slave->dev, &tmp_sa);
if (tmp_res) { if (tmp_res) {
pr_debug("unwind err %d dev %s\n", tmp_res, pr_debug("unwind err %d dev %s\n",
slave->dev->name); tmp_res, slave->dev->name);
} }
} }
...@@ -4357,9 +4271,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -4357,9 +4271,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
if (tx_dev) { if (tx_dev) {
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2) { if (!skb2) {
pr_err(DRV_NAME pr_err("%s: Error: bond_xmit_broadcast(): skb_clone() failed\n",
": %s: Error: bond_xmit_broadcast(): "
"skb_clone() failed\n",
bond_dev->name); bond_dev->name);
continue; continue;
} }
...@@ -4425,7 +4337,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -4425,7 +4337,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
return bond_alb_xmit(skb, dev); return bond_alb_xmit(skb, dev);
default: default:
/* Should never happen, mode already checked */ /* Should never happen, mode already checked */
pr_err(DRV_NAME ": %s: Error: Unknown bonding mode %d\n", pr_err("%s: Error: Unknown bonding mode %d\n",
dev->name, bond->params.mode); dev->name, bond->params.mode);
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -4462,10 +4374,8 @@ void bond_set_mode_ops(struct bonding *bond, int mode) ...@@ -4462,10 +4374,8 @@ void bond_set_mode_ops(struct bonding *bond, int mode)
break; break;
default: default:
/* Should never happen, mode already checked */ /* Should never happen, mode already checked */
pr_err(DRV_NAME pr_err("%s: Error: Unknown bonding mode %d\n",
": %s: Error: Unknown bonding mode %d\n", bond_dev->name, mode);
bond_dev->name,
mode);
break; break;
} }
} }
...@@ -4650,8 +4560,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4650,8 +4560,7 @@ static int bond_check_params(struct bond_params *params)
if (mode) { if (mode) {
bond_mode = bond_parse_parm(mode, bond_mode_tbl); bond_mode = bond_parse_parm(mode, bond_mode_tbl);
if (bond_mode == -1) { if (bond_mode == -1) {
pr_err(DRV_NAME pr_err("Error: Invalid bonding mode \"%s\"\n",
": Error: Invalid bonding mode \"%s\"\n",
mode == NULL ? "NULL" : mode); mode == NULL ? "NULL" : mode);
return -EINVAL; return -EINVAL;
} }
...@@ -4660,16 +4569,13 @@ static int bond_check_params(struct bond_params *params) ...@@ -4660,16 +4569,13 @@ static int bond_check_params(struct bond_params *params)
if (xmit_hash_policy) { if (xmit_hash_policy) {
if ((bond_mode != BOND_MODE_XOR) && if ((bond_mode != BOND_MODE_XOR) &&
(bond_mode != BOND_MODE_8023AD)) { (bond_mode != BOND_MODE_8023AD)) {
pr_info(DRV_NAME pr_info("xmit_hash_policy param is irrelevant in mode %s\n",
": xmit_hash_policy param is irrelevant in"
" mode %s\n",
bond_mode_name(bond_mode)); bond_mode_name(bond_mode));
} else { } else {
xmit_hashtype = bond_parse_parm(xmit_hash_policy, xmit_hashtype = bond_parse_parm(xmit_hash_policy,
xmit_hashtype_tbl); xmit_hashtype_tbl);
if (xmit_hashtype == -1) { if (xmit_hashtype == -1) {
pr_err(DRV_NAME pr_err("Error: Invalid xmit_hash_policy \"%s\"\n",
": Error: Invalid xmit_hash_policy \"%s\"\n",
xmit_hash_policy == NULL ? "NULL" : xmit_hash_policy == NULL ? "NULL" :
xmit_hash_policy); xmit_hash_policy);
return -EINVAL; return -EINVAL;
...@@ -4679,14 +4585,12 @@ static int bond_check_params(struct bond_params *params) ...@@ -4679,14 +4585,12 @@ static int bond_check_params(struct bond_params *params)
if (lacp_rate) { if (lacp_rate) {
if (bond_mode != BOND_MODE_8023AD) { if (bond_mode != BOND_MODE_8023AD) {
pr_info(DRV_NAME pr_info("lacp_rate param is irrelevant in mode %s\n",
": lacp_rate param is irrelevant in mode %s\n",
bond_mode_name(bond_mode)); bond_mode_name(bond_mode));
} else { } else {
lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl);
if (lacp_fast == -1) { if (lacp_fast == -1) {
pr_err(DRV_NAME pr_err("Error: Invalid lacp rate \"%s\"\n",
": Error: Invalid lacp rate \"%s\"\n",
lacp_rate == NULL ? "NULL" : lacp_rate); lacp_rate == NULL ? "NULL" : lacp_rate);
return -EINVAL; return -EINVAL;
} }
...@@ -4696,82 +4600,64 @@ static int bond_check_params(struct bond_params *params) ...@@ -4696,82 +4600,64 @@ static int bond_check_params(struct bond_params *params)
if (ad_select) { if (ad_select) {
params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); params->ad_select = bond_parse_parm(ad_select, ad_select_tbl);
if (params->ad_select == -1) { if (params->ad_select == -1) {
pr_err(DRV_NAME pr_err("Error: Invalid ad_select \"%s\"\n",
": Error: Invalid ad_select \"%s\"\n",
ad_select == NULL ? "NULL" : ad_select); ad_select == NULL ? "NULL" : ad_select);
return -EINVAL; return -EINVAL;
} }
if (bond_mode != BOND_MODE_8023AD) { if (bond_mode != BOND_MODE_8023AD) {
pr_warning(DRV_NAME pr_warning("ad_select param only affects 802.3ad mode\n");
": ad_select param only affects 802.3ad mode\n");
} }
} else { } else {
params->ad_select = BOND_AD_STABLE; params->ad_select = BOND_AD_STABLE;
} }
if (max_bonds < 0) { if (max_bonds < 0) {
pr_warning(DRV_NAME pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
": Warning: max_bonds (%d) not in range %d-%d, so it "
"was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS); max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
max_bonds = BOND_DEFAULT_MAX_BONDS; max_bonds = BOND_DEFAULT_MAX_BONDS;
} }
if (miimon < 0) { if (miimon < 0) {
pr_warning(DRV_NAME pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to %d\n",
": Warning: miimon module parameter (%d), "
"not in range 0-%d, so it was reset to %d\n",
miimon, INT_MAX, BOND_LINK_MON_INTERV); miimon, INT_MAX, BOND_LINK_MON_INTERV);
miimon = BOND_LINK_MON_INTERV; miimon = BOND_LINK_MON_INTERV;
} }
if (updelay < 0) { if (updelay < 0) {
pr_warning(DRV_NAME pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
": Warning: updelay module parameter (%d), "
"not in range 0-%d, so it was reset to 0\n",
updelay, INT_MAX); updelay, INT_MAX);
updelay = 0; updelay = 0;
} }
if (downdelay < 0) { if (downdelay < 0) {
pr_warning(DRV_NAME pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
": Warning: downdelay module parameter (%d), "
"not in range 0-%d, so it was reset to 0\n",
downdelay, INT_MAX); downdelay, INT_MAX);
downdelay = 0; downdelay = 0;
} }
if ((use_carrier != 0) && (use_carrier != 1)) { if ((use_carrier != 0) && (use_carrier != 1)) {
pr_warning(DRV_NAME pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
": Warning: use_carrier module parameter (%d), "
"not of valid value (0/1), so it was set to 1\n",
use_carrier); use_carrier);
use_carrier = 1; use_carrier = 1;
} }
if (num_grat_arp < 0 || num_grat_arp > 255) { if (num_grat_arp < 0 || num_grat_arp > 255) {
pr_warning(DRV_NAME pr_warning("Warning: num_grat_arp (%d) not in range 0-255 so it was reset to 1 \n",
": Warning: num_grat_arp (%d) not in range 0-255 so it " num_grat_arp);
"was reset to 1 \n", num_grat_arp);
num_grat_arp = 1; num_grat_arp = 1;
} }
if (num_unsol_na < 0 || num_unsol_na > 255) { if (num_unsol_na < 0 || num_unsol_na > 255) {
pr_warning(DRV_NAME pr_warning("Warning: num_unsol_na (%d) not in range 0-255 so it was reset to 1 \n",
": Warning: num_unsol_na (%d) not in range 0-255 so it " num_unsol_na);
"was reset to 1 \n", num_unsol_na);
num_unsol_na = 1; num_unsol_na = 1;
} }
/* reset values for 802.3ad */ /* reset values for 802.3ad */
if (bond_mode == BOND_MODE_8023AD) { if (bond_mode == BOND_MODE_8023AD) {
if (!miimon) { if (!miimon) {
pr_warning(DRV_NAME pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
": Warning: miimon must be specified, "
"otherwise bonding will not detect link "
"failure, speed and duplex which are "
"essential for 802.3ad operation\n");
pr_warning("Forcing miimon to 100msec\n"); pr_warning("Forcing miimon to 100msec\n");
miimon = 100; miimon = 100;
} }
...@@ -4781,23 +4667,14 @@ static int bond_check_params(struct bond_params *params) ...@@ -4781,23 +4667,14 @@ static int bond_check_params(struct bond_params *params)
if ((bond_mode == BOND_MODE_TLB) || if ((bond_mode == BOND_MODE_TLB) ||
(bond_mode == BOND_MODE_ALB)) { (bond_mode == BOND_MODE_ALB)) {
if (!miimon) { if (!miimon) {
pr_warning(DRV_NAME pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
": Warning: miimon must be specified, "
"otherwise bonding will not detect link "
"failure and link speed which are essential "
"for TLB/ALB load balancing\n");
pr_warning("Forcing miimon to 100msec\n"); pr_warning("Forcing miimon to 100msec\n");
miimon = 100; miimon = 100;
} }
} }
if (bond_mode == BOND_MODE_ALB) { if (bond_mode == BOND_MODE_ALB) {
pr_notice(DRV_NAME pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n",
": In ALB mode you might experience client "
"disconnections upon reconnection of a link if the "
"bonding module updelay parameter (%d msec) is "
"incompatible with the forwarding delay time of the "
"switch\n",
updelay); updelay);
} }
...@@ -4806,37 +4683,27 @@ static int bond_check_params(struct bond_params *params) ...@@ -4806,37 +4683,27 @@ static int bond_check_params(struct bond_params *params)
/* just warn the user the up/down delay will have /* just warn the user the up/down delay will have
* no effect since miimon is zero... * no effect since miimon is zero...
*/ */
pr_warning(DRV_NAME pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
": Warning: miimon module parameter not set "
"and updelay (%d) or downdelay (%d) module "
"parameter is set; updelay and downdelay have "
"no effect unless miimon is set\n",
updelay, downdelay); updelay, downdelay);
} }
} else { } else {
/* don't allow arp monitoring */ /* don't allow arp monitoring */
if (arp_interval) { if (arp_interval) {
pr_warning(DRV_NAME pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n",
": Warning: miimon (%d) and arp_interval (%d) "
"can't be used simultaneously, disabling ARP "
"monitoring\n",
miimon, arp_interval); miimon, arp_interval);
arp_interval = 0; arp_interval = 0;
} }
if ((updelay % miimon) != 0) { if ((updelay % miimon) != 0) {
pr_warning(DRV_NAME pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
": Warning: updelay (%d) is not a multiple " updelay, miimon,
"of miimon (%d), updelay rounded to %d ms\n", (updelay / miimon) * miimon);
updelay, miimon, (updelay / miimon) * miimon);
} }
updelay /= miimon; updelay /= miimon;
if ((downdelay % miimon) != 0) { if ((downdelay % miimon) != 0) {
pr_warning(DRV_NAME pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n",
": Warning: downdelay (%d) is not a multiple "
"of miimon (%d), downdelay rounded to %d ms\n",
downdelay, miimon, downdelay, miimon,
(downdelay / miimon) * miimon); (downdelay / miimon) * miimon);
} }
...@@ -4845,9 +4712,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4845,9 +4712,7 @@ static int bond_check_params(struct bond_params *params)
} }
if (arp_interval < 0) { if (arp_interval < 0) {
pr_warning(DRV_NAME pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to %d\n",
": Warning: arp_interval module parameter (%d) "
", not in range 0-%d, so it was reset to %d\n",
arp_interval, INT_MAX, BOND_LINK_ARP_INTERV); arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);
arp_interval = BOND_LINK_ARP_INTERV; arp_interval = BOND_LINK_ARP_INTERV;
} }
...@@ -4858,9 +4723,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4858,9 +4723,7 @@ static int bond_check_params(struct bond_params *params)
/* not complete check, but should be good enough to /* not complete check, but should be good enough to
catch mistakes */ catch mistakes */
if (!isdigit(arp_ip_target[arp_ip_count][0])) { if (!isdigit(arp_ip_target[arp_ip_count][0])) {
pr_warning(DRV_NAME pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
": Warning: bad arp_ip_target module parameter "
"(%s), ARP monitoring will not be performed\n",
arp_ip_target[arp_ip_count]); arp_ip_target[arp_ip_count]);
arp_interval = 0; arp_interval = 0;
} else { } else {
...@@ -4871,31 +4734,25 @@ static int bond_check_params(struct bond_params *params) ...@@ -4871,31 +4734,25 @@ static int bond_check_params(struct bond_params *params)
if (arp_interval && !arp_ip_count) { if (arp_interval && !arp_ip_count) {
/* don't allow arping if no arp_ip_target given... */ /* don't allow arping if no arp_ip_target given... */
pr_warning(DRV_NAME pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
": Warning: arp_interval module parameter (%d) "
"specified without providing an arp_ip_target "
"parameter, arp_interval was reset to 0\n",
arp_interval); arp_interval);
arp_interval = 0; arp_interval = 0;
} }
if (arp_validate) { if (arp_validate) {
if (bond_mode != BOND_MODE_ACTIVEBACKUP) { if (bond_mode != BOND_MODE_ACTIVEBACKUP) {
pr_err(DRV_NAME pr_err("arp_validate only supported in active-backup mode\n");
": arp_validate only supported in active-backup mode\n");
return -EINVAL; return -EINVAL;
} }
if (!arp_interval) { if (!arp_interval) {
pr_err(DRV_NAME pr_err("arp_validate requires arp_interval\n");
": arp_validate requires arp_interval\n");
return -EINVAL; return -EINVAL;
} }
arp_validate_value = bond_parse_parm(arp_validate, arp_validate_value = bond_parse_parm(arp_validate,
arp_validate_tbl); arp_validate_tbl);
if (arp_validate_value == -1) { if (arp_validate_value == -1) {
pr_err(DRV_NAME pr_err("Error: invalid arp_validate \"%s\"\n",
": Error: invalid arp_validate \"%s\"\n",
arp_validate == NULL ? "NULL" : arp_validate); arp_validate == NULL ? "NULL" : arp_validate);
return -EINVAL; return -EINVAL;
} }
...@@ -4903,14 +4760,11 @@ static int bond_check_params(struct bond_params *params) ...@@ -4903,14 +4760,11 @@ static int bond_check_params(struct bond_params *params)
arp_validate_value = 0; arp_validate_value = 0;
if (miimon) { if (miimon) {
pr_info(DRV_NAME pr_info("MII link monitoring set to %d ms\n", miimon);
": MII link monitoring set to %d ms\n",
miimon);
} else if (arp_interval) { } else if (arp_interval) {
int i; int i;
pr_info(DRV_NAME ": ARP monitoring set to %d ms," pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
" validate %s, with %d target(s):",
arp_interval, arp_interval,
arp_validate_tbl[arp_validate_value].modename, arp_validate_tbl[arp_validate_value].modename,
arp_ip_count); arp_ip_count);
...@@ -4924,20 +4778,14 @@ static int bond_check_params(struct bond_params *params) ...@@ -4924,20 +4778,14 @@ static int bond_check_params(struct bond_params *params)
/* miimon and arp_interval not set, we need one so things /* miimon and arp_interval not set, we need one so things
* work as expected, see bonding.txt for details * work as expected, see bonding.txt for details
*/ */
pr_warning(DRV_NAME pr_warning("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n");
": Warning: either miimon or arp_interval and "
"arp_ip_target module parameters must be specified, "
"otherwise bonding will not detect link failures! see "
"bonding.txt for details.\n");
} }
if (primary && !USES_PRIMARY(bond_mode)) { if (primary && !USES_PRIMARY(bond_mode)) {
/* currently, using a primary only makes sense /* currently, using a primary only makes sense
* in active backup, TLB or ALB modes * in active backup, TLB or ALB modes
*/ */
pr_warning(DRV_NAME pr_warning("Warning: %s primary device specified but has no effect in %s mode\n",
": Warning: %s primary device specified but has no "
"effect in %s mode\n",
primary, bond_mode_name(bond_mode)); primary, bond_mode_name(bond_mode));
primary = NULL; primary = NULL;
} }
...@@ -4946,8 +4794,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4946,8 +4794,7 @@ static int bond_check_params(struct bond_params *params)
primary_reselect_value = bond_parse_parm(primary_reselect, primary_reselect_value = bond_parse_parm(primary_reselect,
pri_reselect_tbl); pri_reselect_tbl);
if (primary_reselect_value == -1) { if (primary_reselect_value == -1) {
pr_err(DRV_NAME pr_err("Error: Invalid primary_reselect \"%s\"\n",
": Error: Invalid primary_reselect \"%s\"\n",
primary_reselect == primary_reselect ==
NULL ? "NULL" : primary_reselect); NULL ? "NULL" : primary_reselect);
return -EINVAL; return -EINVAL;
...@@ -4960,16 +4807,13 @@ static int bond_check_params(struct bond_params *params) ...@@ -4960,16 +4807,13 @@ static int bond_check_params(struct bond_params *params)
fail_over_mac_value = bond_parse_parm(fail_over_mac, fail_over_mac_value = bond_parse_parm(fail_over_mac,
fail_over_mac_tbl); fail_over_mac_tbl);
if (fail_over_mac_value == -1) { if (fail_over_mac_value == -1) {
pr_err(DRV_NAME pr_err("Error: invalid fail_over_mac \"%s\"\n",
": Error: invalid fail_over_mac \"%s\"\n",
arp_validate == NULL ? "NULL" : arp_validate); arp_validate == NULL ? "NULL" : arp_validate);
return -EINVAL; return -EINVAL;
} }
if (bond_mode != BOND_MODE_ACTIVEBACKUP) if (bond_mode != BOND_MODE_ACTIVEBACKUP)
pr_warning(DRV_NAME pr_warning("Warning: fail_over_mac only affects active-backup mode.\n");
": Warning: fail_over_mac only affects "
"active-backup mode.\n");
} else { } else {
fail_over_mac_value = BOND_FOM_NONE; fail_over_mac_value = BOND_FOM_NONE;
} }
...@@ -5076,8 +4920,7 @@ int bond_create(struct net *net, const char *name) ...@@ -5076,8 +4920,7 @@ int bond_create(struct net *net, const char *name)
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
bond_setup); bond_setup);
if (!bond_dev) { if (!bond_dev) {
pr_err(DRV_NAME ": %s: eek! can't alloc netdev!\n", pr_err("%s: eek! can't alloc netdev!\n", name);
name);
res = -ENOMEM; res = -ENOMEM;
goto out; goto out;
} }
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
* file called LICENSE. * file called LICENSE.
* *
*/ */
#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/device.h> #include <linux/device.h>
...@@ -109,11 +112,10 @@ static ssize_t bonding_store_bonds(struct class *cls, ...@@ -109,11 +112,10 @@ static ssize_t bonding_store_bonds(struct class *cls,
goto err_no_cmd; goto err_no_cmd;
if (command[0] == '+') { if (command[0] == '+') {
pr_info(DRV_NAME pr_info("%s is being created...\n", ifname);
": %s is being created...\n", ifname);
rv = bond_create(net, ifname); rv = bond_create(net, ifname);
if (rv) { if (rv) {
pr_info(DRV_NAME ": Bond creation failed.\n"); pr_info("Bond creation failed.\n");
res = rv; res = rv;
} }
} else if (command[0] == '-') { } else if (command[0] == '-') {
...@@ -122,12 +124,10 @@ static ssize_t bonding_store_bonds(struct class *cls, ...@@ -122,12 +124,10 @@ static ssize_t bonding_store_bonds(struct class *cls,
rtnl_lock(); rtnl_lock();
bond_dev = bond_get_by_name(net, ifname); bond_dev = bond_get_by_name(net, ifname);
if (bond_dev) { if (bond_dev) {
pr_info(DRV_NAME ": %s is being deleted...\n", pr_info("%s is being deleted...\n", ifname);
ifname);
unregister_netdevice(bond_dev); unregister_netdevice(bond_dev);
} else { } else {
pr_err(DRV_NAME ": unable to delete non-existent %s\n", pr_err("unable to delete non-existent %s\n", ifname);
ifname);
res = -ENODEV; res = -ENODEV;
} }
rtnl_unlock(); rtnl_unlock();
...@@ -140,8 +140,7 @@ static ssize_t bonding_store_bonds(struct class *cls, ...@@ -140,8 +140,7 @@ static ssize_t bonding_store_bonds(struct class *cls,
return res; return res;
err_no_cmd: err_no_cmd:
pr_err(DRV_NAME ": no command found in bonding_masters." pr_err("no command found in bonding_masters. Use +ifname or -ifname.\n");
" Use +ifname or -ifname.\n");
return -EPERM; return -EPERM;
} }
...@@ -225,8 +224,8 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -225,8 +224,8 @@ static ssize_t bonding_store_slaves(struct device *d,
/* Quick sanity check -- is the bond interface up? */ /* Quick sanity check -- is the bond interface up? */
if (!(bond->dev->flags & IFF_UP)) { if (!(bond->dev->flags & IFF_UP)) {
pr_warning(DRV_NAME ": %s: doing slave updates when " pr_warning("%s: doing slave updates when interface is down.\n",
"interface is down.\n", bond->dev->name); bond->dev->name);
} }
/* Note: We can't hold bond->lock here, as bond_create grabs it. */ /* Note: We can't hold bond->lock here, as bond_create grabs it. */
...@@ -247,17 +246,14 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -247,17 +246,14 @@ static ssize_t bonding_store_slaves(struct device *d,
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(DRV_NAME pr_info("%s: Interface %s does not exist!\n",
": %s: Interface %s does not exist!\n",
bond->dev->name, ifname); bond->dev->name, ifname);
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
if (dev->flags & IFF_UP) { if (dev->flags & IFF_UP) {
pr_err(DRV_NAME pr_err("%s: Error: Unable to enslave %s because it is already up.\n",
": %s: Error: Unable to enslave %s "
"because it is already up.\n",
bond->dev->name, dev->name); bond->dev->name, dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -266,8 +262,7 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -266,8 +262,7 @@ static ssize_t bonding_store_slaves(struct device *d,
read_lock(&bond->lock); read_lock(&bond->lock);
bond_for_each_slave(bond, slave, i) bond_for_each_slave(bond, slave, i)
if (slave->dev == dev) { if (slave->dev == dev) {
pr_err(DRV_NAME pr_err("%s: Interface %s is already enslaved!\n",
": %s: Interface %s is already enslaved!\n",
bond->dev->name, ifname); bond->dev->name, ifname);
ret = -EPERM; ret = -EPERM;
read_unlock(&bond->lock); read_unlock(&bond->lock);
...@@ -275,8 +270,7 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -275,8 +270,7 @@ static ssize_t bonding_store_slaves(struct device *d,
} }
read_unlock(&bond->lock); read_unlock(&bond->lock);
pr_info(DRV_NAME ": %s: Adding slave %s.\n", pr_info("%s: Adding slave %s.\n", bond->dev->name, ifname);
bond->dev->name, ifname);
/* If this is the first slave, then we need to set /* If this is the first slave, then we need to set
the master's hardware address to be the same as the the master's hardware address to be the same as the
...@@ -313,7 +307,7 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -313,7 +307,7 @@ static ssize_t bonding_store_slaves(struct device *d,
break; break;
} }
if (dev) { if (dev) {
pr_info(DRV_NAME ": %s: Removing slave %s\n", pr_info("%s: Removing slave %s\n",
bond->dev->name, dev->name); bond->dev->name, dev->name);
res = bond_release(bond->dev, dev); res = bond_release(bond->dev, dev);
if (res) { if (res) {
...@@ -323,8 +317,7 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -323,8 +317,7 @@ static ssize_t bonding_store_slaves(struct device *d,
/* set the slave MTU to the default */ /* set the slave MTU to the default */
dev_set_mtu(dev, original_mtu); dev_set_mtu(dev, original_mtu);
} else { } else {
pr_err(DRV_NAME ": unable to remove non-existent" pr_err("unable to remove non-existent slave %s for bond %s.\n",
" slave %s for bond %s.\n",
ifname, bond->dev->name); ifname, bond->dev->name);
ret = -ENODEV; ret = -ENODEV;
} }
...@@ -332,7 +325,8 @@ static ssize_t bonding_store_slaves(struct device *d, ...@@ -332,7 +325,8 @@ static ssize_t bonding_store_slaves(struct device *d,
} }
err_no_cmd: err_no_cmd:
pr_err(DRV_NAME ": no command found in slaves file for bond %s. Use +ifname or -ifname.\n", bond->dev->name); pr_err("no command found in slaves file for bond %s. Use +ifname or -ifname.\n",
bond->dev->name);
ret = -EPERM; ret = -EPERM;
out: out:
...@@ -365,18 +359,16 @@ static ssize_t bonding_store_mode(struct device *d, ...@@ -365,18 +359,16 @@ static ssize_t bonding_store_mode(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
pr_err(DRV_NAME ": unable to update mode of %s" pr_err("unable to update mode of %s because interface is up.\n",
" because interface is up.\n", bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
new_value = bond_parse_parm(buf, bond_mode_tbl); new_value = bond_parse_parm(buf, bond_mode_tbl);
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid mode value %.*s.\n",
": %s: Ignoring invalid mode value %.*s.\n", bond->dev->name, (int)strlen(buf) - 1, buf);
bond->dev->name,
(int)strlen(buf) - 1, buf);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} else { } else {
...@@ -388,7 +380,7 @@ static ssize_t bonding_store_mode(struct device *d, ...@@ -388,7 +380,7 @@ static ssize_t bonding_store_mode(struct device *d,
bond->params.mode = new_value; bond->params.mode = new_value;
bond_set_mode_ops(bond, bond->params.mode); bond_set_mode_ops(bond, bond->params.mode);
pr_info(DRV_NAME ": %s: setting mode to %s (%d).\n", pr_info("%s: setting mode to %s (%d).\n",
bond->dev->name, bond_mode_tbl[new_value].modename, bond->dev->name, bond_mode_tbl[new_value].modename,
new_value); new_value);
} }
...@@ -421,8 +413,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, ...@@ -421,8 +413,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
pr_err(DRV_NAME pr_err("%s: Interface is up. Unable to update xmit policy.\n",
"%s: Interface is up. Unable to update xmit policy.\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -430,8 +421,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, ...@@ -430,8 +421,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
new_value = bond_parse_parm(buf, xmit_hashtype_tbl); new_value = bond_parse_parm(buf, xmit_hashtype_tbl);
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid xmit hash policy value %.*s.\n",
": %s: Ignoring invalid xmit hash policy value %.*s.\n",
bond->dev->name, bond->dev->name,
(int)strlen(buf) - 1, buf); (int)strlen(buf) - 1, buf);
ret = -EINVAL; ret = -EINVAL;
...@@ -439,7 +429,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, ...@@ -439,7 +429,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
} else { } else {
bond->params.xmit_policy = new_value; bond->params.xmit_policy = new_value;
bond_set_mode_ops(bond, bond->params.mode); bond_set_mode_ops(bond, bond->params.mode);
pr_info(DRV_NAME ": %s: setting xmit hash policy to %s (%d).\n", pr_info("%s: setting xmit hash policy to %s (%d).\n",
bond->dev->name, bond->dev->name,
xmit_hashtype_tbl[new_value].modename, new_value); xmit_hashtype_tbl[new_value].modename, new_value);
} }
...@@ -472,18 +462,16 @@ static ssize_t bonding_store_arp_validate(struct device *d, ...@@ -472,18 +462,16 @@ static ssize_t bonding_store_arp_validate(struct device *d,
new_value = bond_parse_parm(buf, arp_validate_tbl); new_value = bond_parse_parm(buf, arp_validate_tbl);
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid arp_validate value %s\n",
": %s: Ignoring invalid arp_validate value %s\n",
bond->dev->name, buf); bond->dev->name, buf);
return -EINVAL; return -EINVAL;
} }
if (new_value && (bond->params.mode != BOND_MODE_ACTIVEBACKUP)) { if (new_value && (bond->params.mode != BOND_MODE_ACTIVEBACKUP)) {
pr_err(DRV_NAME pr_err("%s: arp_validate only supported in active-backup mode.\n",
": %s: arp_validate only supported in active-backup mode.\n",
bond->dev->name); bond->dev->name);
return -EINVAL; return -EINVAL;
} }
pr_info(DRV_NAME ": %s: setting arp_validate to %s (%d).\n", pr_info("%s: setting arp_validate to %s (%d).\n",
bond->dev->name, arp_validate_tbl[new_value].modename, bond->dev->name, arp_validate_tbl[new_value].modename,
new_value); new_value);
...@@ -523,22 +511,20 @@ static ssize_t bonding_store_fail_over_mac(struct device *d, ...@@ -523,22 +511,20 @@ static ssize_t bonding_store_fail_over_mac(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (bond->slave_cnt != 0) { if (bond->slave_cnt != 0) {
pr_err(DRV_NAME pr_err("%s: Can't alter fail_over_mac with slaves in bond.\n",
": %s: Can't alter fail_over_mac with slaves in bond.\n",
bond->dev->name); bond->dev->name);
return -EPERM; return -EPERM;
} }
new_value = bond_parse_parm(buf, fail_over_mac_tbl); new_value = bond_parse_parm(buf, fail_over_mac_tbl);
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid fail_over_mac value %s.\n",
": %s: Ignoring invalid fail_over_mac value %s.\n",
bond->dev->name, buf); bond->dev->name, buf);
return -EINVAL; return -EINVAL;
} }
bond->params.fail_over_mac = new_value; bond->params.fail_over_mac = new_value;
pr_info(DRV_NAME ": %s: Setting fail_over_mac to %s (%d).\n", pr_info("%s: Setting fail_over_mac to %s (%d).\n",
bond->dev->name, fail_over_mac_tbl[new_value].modename, bond->dev->name, fail_over_mac_tbl[new_value].modename,
new_value); new_value);
...@@ -571,30 +557,25 @@ static ssize_t bonding_store_arp_interval(struct device *d, ...@@ -571,30 +557,25 @@ static ssize_t bonding_store_arp_interval(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no arp_interval value specified.\n",
": %s: no arp_interval value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
": %s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
bond->dev->name, new_value, INT_MAX); bond->dev->name, new_value, INT_MAX);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
pr_info(DRV_NAME pr_info("%s: Setting ARP monitoring interval to %d.\n",
": %s: Setting ARP monitoring interval to %d.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
bond->params.arp_interval = new_value; bond->params.arp_interval = new_value;
if (bond->params.arp_interval) if (bond->params.arp_interval)
bond->dev->priv_flags |= IFF_MASTER_ARPMON; bond->dev->priv_flags |= IFF_MASTER_ARPMON;
if (bond->params.miimon) { if (bond->params.miimon) {
pr_info(DRV_NAME pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
": %s: ARP monitoring cannot be used with MII monitoring. "
"%s Disabling MII monitoring.\n",
bond->dev->name, bond->dev->name); bond->dev->name, bond->dev->name);
bond->params.miimon = 0; bond->params.miimon = 0;
if (delayed_work_pending(&bond->mii_work)) { if (delayed_work_pending(&bond->mii_work)) {
...@@ -603,9 +584,7 @@ static ssize_t bonding_store_arp_interval(struct device *d, ...@@ -603,9 +584,7 @@ static ssize_t bonding_store_arp_interval(struct device *d,
} }
} }
if (!bond->params.arp_targets[0]) { if (!bond->params.arp_targets[0]) {
pr_info(DRV_NAME pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
": %s: ARP monitoring has been set up, "
"but no ARP targets have been specified.\n",
bond->dev->name); bond->dev->name);
} }
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
...@@ -666,8 +645,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, ...@@ -666,8 +645,7 @@ static ssize_t bonding_store_arp_targets(struct device *d,
/* look for adds */ /* look for adds */
if (buf[0] == '+') { if (buf[0] == '+') {
if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
pr_err(DRV_NAME pr_err("%s: invalid ARP target %pI4 specified for addition\n",
": %s: invalid ARP target %pI4 specified for addition\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -675,23 +653,20 @@ static ssize_t bonding_store_arp_targets(struct device *d, ...@@ -675,23 +653,20 @@ static ssize_t bonding_store_arp_targets(struct device *d,
/* look for an empty slot to put the target in, and check for dupes */ /* look for an empty slot to put the target in, and check for dupes */
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) {
if (targets[i] == newtarget) { /* duplicate */ if (targets[i] == newtarget) { /* duplicate */
pr_err(DRV_NAME pr_err("%s: ARP target %pI4 is already present\n",
": %s: ARP target %pI4 is already present\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (targets[i] == 0) { if (targets[i] == 0) {
pr_info(DRV_NAME pr_info("%s: adding ARP target %pI4.\n",
": %s: adding ARP target %pI4.\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
done = 1; done = 1;
targets[i] = newtarget; targets[i] = newtarget;
} }
} }
if (!done) { if (!done) {
pr_err(DRV_NAME pr_err("%s: ARP target table is full!\n",
": %s: ARP target table is full!\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -699,8 +674,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, ...@@ -699,8 +674,7 @@ static ssize_t bonding_store_arp_targets(struct device *d,
} else if (buf[0] == '-') { } else if (buf[0] == '-') {
if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
pr_err(DRV_NAME pr_err("%s: invalid ARP target %pI4 specified for removal\n",
": %s: invalid ARP target %pI4 specified for removal\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -709,8 +683,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, ...@@ -709,8 +683,7 @@ static ssize_t bonding_store_arp_targets(struct device *d,
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) {
if (targets[i] == newtarget) { if (targets[i] == newtarget) {
int j; int j;
pr_info(DRV_NAME pr_info("%s: removing ARP target %pI4.\n",
": %s: removing ARP target %pI4.\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++) for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++)
targets[j] = targets[j+1]; targets[j] = targets[j+1];
...@@ -720,15 +693,13 @@ static ssize_t bonding_store_arp_targets(struct device *d, ...@@ -720,15 +693,13 @@ static ssize_t bonding_store_arp_targets(struct device *d,
} }
} }
if (!done) { if (!done) {
pr_info(DRV_NAME pr_info("%s: unable to remove nonexistent ARP target %pI4.\n",
": %s: unable to remove nonexistent ARP target %pI4.\n",
bond->dev->name, &newtarget); bond->dev->name, &newtarget);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
} else { } else {
pr_err(DRV_NAME ": no command found in arp_ip_targets file" pr_err("no command found in arp_ip_targets file for bond %s. Use +<addr> or -<addr>.\n",
" for bond %s. Use +<addr> or -<addr>.\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -761,39 +732,32 @@ static ssize_t bonding_store_downdelay(struct device *d, ...@@ -761,39 +732,32 @@ static ssize_t bonding_store_downdelay(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (!(bond->params.miimon)) { if (!(bond->params.miimon)) {
pr_err(DRV_NAME pr_err("%s: Unable to set down delay as MII monitoring is disabled\n",
": %s: Unable to set down delay as MII monitoring is disabled\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no down delay value specified.\n", bond->dev->name);
": %s: no down delay value specified.\n",
bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
": %s: Invalid down delay value %d not in range %d-%d; rejected.\n",
bond->dev->name, new_value, 1, INT_MAX); bond->dev->name, new_value, 1, INT_MAX);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} else { } else {
if ((new_value % bond->params.miimon) != 0) { if ((new_value % bond->params.miimon) != 0) {
pr_warning(DRV_NAME pr_warning("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
": %s: Warning: down delay (%d) is not a "
"multiple of miimon (%d), delay rounded "
"to %d ms\n",
bond->dev->name, new_value, bond->dev->name, new_value,
bond->params.miimon, bond->params.miimon,
(new_value / bond->params.miimon) * (new_value / bond->params.miimon) *
bond->params.miimon); bond->params.miimon);
} }
bond->params.downdelay = new_value / bond->params.miimon; bond->params.downdelay = new_value / bond->params.miimon;
pr_info(DRV_NAME ": %s: Setting down delay to %d.\n", pr_info("%s: Setting down delay to %d.\n",
bond->dev->name, bond->dev->name,
bond->params.downdelay * bond->params.miimon); bond->params.downdelay * bond->params.miimon);
...@@ -823,41 +787,35 @@ static ssize_t bonding_store_updelay(struct device *d, ...@@ -823,41 +787,35 @@ static ssize_t bonding_store_updelay(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (!(bond->params.miimon)) { if (!(bond->params.miimon)) {
pr_err(DRV_NAME pr_err("%s: Unable to set up delay as MII monitoring is disabled\n",
": %s: Unable to set up delay as MII monitoring is disabled\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no up delay value specified.\n",
": %s: no up delay value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
": %s: Invalid down delay value %d not in range %d-%d; rejected.\n",
bond->dev->name, new_value, 1, INT_MAX); bond->dev->name, new_value, 1, INT_MAX);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} else { } else {
if ((new_value % bond->params.miimon) != 0) { if ((new_value % bond->params.miimon) != 0) {
pr_warning(DRV_NAME pr_warning("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
": %s: Warning: up delay (%d) is not a "
"multiple of miimon (%d), updelay rounded "
"to %d ms\n",
bond->dev->name, new_value, bond->dev->name, new_value,
bond->params.miimon, bond->params.miimon,
(new_value / bond->params.miimon) * (new_value / bond->params.miimon) *
bond->params.miimon); bond->params.miimon);
} }
bond->params.updelay = new_value / bond->params.miimon; bond->params.updelay = new_value / bond->params.miimon;
pr_info(DRV_NAME ": %s: Setting up delay to %d.\n", pr_info("%s: Setting up delay to %d.\n",
bond->dev->name, bond->params.updelay * bond->params.miimon); bond->dev->name,
bond->params.updelay * bond->params.miimon);
} }
out: out:
...@@ -889,16 +847,14 @@ static ssize_t bonding_store_lacp(struct device *d, ...@@ -889,16 +847,14 @@ static ssize_t bonding_store_lacp(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
pr_err(DRV_NAME pr_err("%s: Unable to update LACP rate because interface is up.\n",
": %s: Unable to update LACP rate because interface is up.\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
if (bond->params.mode != BOND_MODE_8023AD) { if (bond->params.mode != BOND_MODE_8023AD) {
pr_err(DRV_NAME pr_err("%s: Unable to update LACP rate because bond is not in 802.3ad mode.\n",
": %s: Unable to update LACP rate because bond is not in 802.3ad mode.\n",
bond->dev->name); bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -908,12 +864,11 @@ static ssize_t bonding_store_lacp(struct device *d, ...@@ -908,12 +864,11 @@ static ssize_t bonding_store_lacp(struct device *d,
if ((new_value == 1) || (new_value == 0)) { if ((new_value == 1) || (new_value == 0)) {
bond->params.lacp_fast = new_value; bond->params.lacp_fast = new_value;
pr_info(DRV_NAME ": %s: Setting LACP rate to %s (%d).\n", pr_info("%s: Setting LACP rate to %s (%d).\n",
bond->dev->name, bond_lacp_tbl[new_value].modename, bond->dev->name, bond_lacp_tbl[new_value].modename,
new_value); new_value);
} else { } else {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid LACP rate value %.*s.\n",
": %s: Ignoring invalid LACP rate value %.*s.\n",
bond->dev->name, (int)strlen(buf) - 1, buf); bond->dev->name, (int)strlen(buf) - 1, buf);
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -943,9 +898,8 @@ static ssize_t bonding_store_ad_select(struct device *d, ...@@ -943,9 +898,8 @@ static ssize_t bonding_store_ad_select(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
pr_err(DRV_NAME pr_err("%s: Unable to update ad_select because interface is up.\n",
": %s: Unable to update ad_select because interface " bond->dev->name);
"is up.\n", bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
...@@ -954,13 +908,11 @@ static ssize_t bonding_store_ad_select(struct device *d, ...@@ -954,13 +908,11 @@ static ssize_t bonding_store_ad_select(struct device *d,
if (new_value != -1) { if (new_value != -1) {
bond->params.ad_select = new_value; bond->params.ad_select = new_value;
pr_info(DRV_NAME pr_info("%s: Setting ad_select to %s (%d).\n",
": %s: Setting ad_select to %s (%d).\n",
bond->dev->name, ad_select_tbl[new_value].modename, bond->dev->name, ad_select_tbl[new_value].modename,
new_value); new_value);
} else { } else {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid ad_select value %.*s.\n",
": %s: Ignoring invalid ad_select value %.*s.\n",
bond->dev->name, (int)strlen(buf) - 1, buf); bond->dev->name, (int)strlen(buf) - 1, buf);
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -990,15 +942,13 @@ static ssize_t bonding_store_n_grat_arp(struct device *d, ...@@ -990,15 +942,13 @@ static ssize_t bonding_store_n_grat_arp(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no num_grat_arp value specified.\n",
": %s: no num_grat_arp value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0 || new_value > 255) { if (new_value < 0 || new_value > 255) {
pr_err(DRV_NAME pr_err("%s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n",
": %s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -1031,16 +981,14 @@ static ssize_t bonding_store_n_unsol_na(struct device *d, ...@@ -1031,16 +981,14 @@ static ssize_t bonding_store_n_unsol_na(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no num_unsol_na value specified.\n",
": %s: no num_unsol_na value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0 || new_value > 255) { if (new_value < 0 || new_value > 255) {
pr_err(DRV_NAME pr_err("%s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n",
": %s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -1075,39 +1023,30 @@ static ssize_t bonding_store_miimon(struct device *d, ...@@ -1075,39 +1023,30 @@ static ssize_t bonding_store_miimon(struct device *d,
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no miimon value specified.\n",
": %s: no miimon value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
": %s: Invalid miimon value %d not in range %d-%d; rejected.\n",
bond->dev->name, new_value, 1, INT_MAX); bond->dev->name, new_value, 1, INT_MAX);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} else { } else {
pr_info(DRV_NAME pr_info("%s: Setting MII monitoring interval to %d.\n",
": %s: Setting MII monitoring interval to %d.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
bond->params.miimon = new_value; bond->params.miimon = new_value;
if (bond->params.updelay) if (bond->params.updelay)
pr_info(DRV_NAME pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
": %s: Note: Updating updelay (to %d) "
"since it is a multiple of the miimon value.\n",
bond->dev->name, 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(DRV_NAME pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
": %s: Note: Updating downdelay (to %d) "
"since it is a multiple of the miimon value.\n",
bond->dev->name, bond->dev->name,
bond->params.downdelay * bond->params.miimon); bond->params.downdelay * bond->params.miimon);
if (bond->params.arp_interval) { if (bond->params.arp_interval) {
pr_info(DRV_NAME pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
": %s: MII monitoring cannot be used with "
"ARP monitoring. Disabling ARP monitoring...\n",
bond->dev->name); bond->dev->name);
bond->params.arp_interval = 0; bond->params.arp_interval = 0;
bond->dev->priv_flags &= ~IFF_MASTER_ARPMON; bond->dev->priv_flags &= ~IFF_MASTER_ARPMON;
...@@ -1176,16 +1115,14 @@ static ssize_t bonding_store_primary(struct device *d, ...@@ -1176,16 +1115,14 @@ static ssize_t bonding_store_primary(struct device *d,
write_lock_bh(&bond->curr_slave_lock); write_lock_bh(&bond->curr_slave_lock);
if (!USES_PRIMARY(bond->params.mode)) { if (!USES_PRIMARY(bond->params.mode)) {
pr_info(DRV_NAME pr_info("%s: Unable to set primary slave; %s is in mode %d\n",
": %s: Unable to set primary slave; %s is in mode %d\n",
bond->dev->name, bond->dev->name, bond->params.mode); bond->dev->name, bond->dev->name, bond->params.mode);
} else { } else {
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
if (strnicmp if (strnicmp
(slave->dev->name, buf, (slave->dev->name, buf,
strlen(slave->dev->name)) == 0) { strlen(slave->dev->name)) == 0) {
pr_info(DRV_NAME pr_info("%s: Setting %s as primary slave.\n",
": %s: Setting %s as primary slave.\n",
bond->dev->name, slave->dev->name); bond->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);
...@@ -1197,14 +1134,12 @@ static ssize_t bonding_store_primary(struct device *d, ...@@ -1197,14 +1134,12 @@ static ssize_t bonding_store_primary(struct device *d,
/* if we got here, then we didn't match the name of any slave */ /* if we got here, then we didn't match the name of any slave */
if (strlen(buf) == 0 || buf[0] == '\n') { if (strlen(buf) == 0 || buf[0] == '\n') {
pr_info(DRV_NAME pr_info("%s: Setting primary slave to None.\n",
": %s: Setting primary slave to None.\n",
bond->dev->name); bond->dev->name);
bond->primary_slave = NULL; bond->primary_slave = NULL;
bond_select_active_slave(bond); bond_select_active_slave(bond);
} else { } else {
pr_info(DRV_NAME pr_info("%s: Unable to set %.*s as primary slave as it is not a slave.\n",
": %s: Unable to set %.*s as primary slave as it is not a slave.\n",
bond->dev->name, (int)strlen(buf) - 1, buf); bond->dev->name, (int)strlen(buf) - 1, buf);
} }
} }
...@@ -1244,8 +1179,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d, ...@@ -1244,8 +1179,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d,
new_value = bond_parse_parm(buf, pri_reselect_tbl); new_value = bond_parse_parm(buf, pri_reselect_tbl);
if (new_value < 0) { if (new_value < 0) {
pr_err(DRV_NAME pr_err("%s: Ignoring invalid primary_reselect value %.*s.\n",
": %s: Ignoring invalid primary_reselect value %.*s.\n",
bond->dev->name, bond->dev->name,
(int) strlen(buf) - 1, buf); (int) strlen(buf) - 1, buf);
ret = -EINVAL; ret = -EINVAL;
...@@ -1253,7 +1187,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d, ...@@ -1253,7 +1187,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d,
} }
bond->params.primary_reselect = new_value; bond->params.primary_reselect = new_value;
pr_info(DRV_NAME ": %s: setting primary_reselect to %s (%d).\n", pr_info("%s: setting primary_reselect to %s (%d).\n",
bond->dev->name, pri_reselect_tbl[new_value].modename, bond->dev->name, pri_reselect_tbl[new_value].modename,
new_value); new_value);
...@@ -1291,19 +1225,17 @@ static ssize_t bonding_store_carrier(struct device *d, ...@@ -1291,19 +1225,17 @@ static ssize_t bonding_store_carrier(struct device *d,
if (sscanf(buf, "%d", &new_value) != 1) { if (sscanf(buf, "%d", &new_value) != 1) {
pr_err(DRV_NAME pr_err("%s: no use_carrier value specified.\n",
": %s: no use_carrier value specified.\n",
bond->dev->name); bond->dev->name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if ((new_value == 0) || (new_value == 1)) { if ((new_value == 0) || (new_value == 1)) {
bond->params.use_carrier = new_value; bond->params.use_carrier = new_value;
pr_info(DRV_NAME ": %s: Setting use_carrier to %d.\n", pr_info("%s: Setting use_carrier to %d.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
} else { } else {
pr_info(DRV_NAME pr_info("%s: Ignoring invalid use_carrier value %d.\n",
": %s: Ignoring invalid use_carrier value %d.\n",
bond->dev->name, new_value); bond->dev->name, new_value);
} }
out: out:
...@@ -1349,8 +1281,7 @@ static ssize_t bonding_store_active_slave(struct device *d, ...@@ -1349,8 +1281,7 @@ static ssize_t bonding_store_active_slave(struct device *d,
write_lock_bh(&bond->curr_slave_lock); write_lock_bh(&bond->curr_slave_lock);
if (!USES_PRIMARY(bond->params.mode)) if (!USES_PRIMARY(bond->params.mode))
pr_info(DRV_NAME ": %s: Unable to change active slave;" pr_info("%s: Unable to change active slave; %s is in mode %d\n",
" %s is in mode %d\n",
bond->dev->name, bond->dev->name, bond->params.mode); bond->dev->name, bond->dev->name, bond->params.mode);
else { else {
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
...@@ -1361,9 +1292,9 @@ static ssize_t bonding_store_active_slave(struct device *d, ...@@ -1361,9 +1292,9 @@ static ssize_t bonding_store_active_slave(struct device *d,
new_active = slave; new_active = slave;
if (new_active == old_active) { if (new_active == old_active) {
/* do nothing */ /* do nothing */
pr_info(DRV_NAME pr_info("%s: %s is already the current active slave.\n",
": %s: %s is already the current active slave.\n", bond->dev->name,
bond->dev->name, slave->dev->name); slave->dev->name);
goto out; goto out;
} }
else { else {
...@@ -1371,16 +1302,15 @@ static ssize_t bonding_store_active_slave(struct device *d, ...@@ -1371,16 +1302,15 @@ static ssize_t bonding_store_active_slave(struct device *d,
(old_active) && (old_active) &&
(new_active->link == BOND_LINK_UP) && (new_active->link == BOND_LINK_UP) &&
IS_UP(new_active->dev)) { IS_UP(new_active->dev)) {
pr_info(DRV_NAME pr_info("%s: Setting %s as active slave.\n",
": %s: Setting %s as active slave.\n", bond->dev->name,
bond->dev->name, slave->dev->name); slave->dev->name);
bond_change_active_slave(bond, new_active); bond_change_active_slave(bond, new_active);
} }
else { else {
pr_info(DRV_NAME pr_info("%s: Could not set %s as active slave; either %s is down or the link is down.\n",
": %s: Could not set %s as active slave; " bond->dev->name,
"either %s is down or the link is down.\n", slave->dev->name,
bond->dev->name, slave->dev->name,
slave->dev->name); slave->dev->name);
} }
goto out; goto out;
...@@ -1391,14 +1321,12 @@ static ssize_t bonding_store_active_slave(struct device *d, ...@@ -1391,14 +1321,12 @@ static ssize_t bonding_store_active_slave(struct device *d,
/* if we got here, then we didn't match the name of any slave */ /* if we got here, then we didn't match the name of any slave */
if (strlen(buf) == 0 || buf[0] == '\n') { if (strlen(buf) == 0 || buf[0] == '\n') {
pr_info(DRV_NAME pr_info("%s: Setting active slave to None.\n",
": %s: Setting active slave to None.\n",
bond->dev->name); bond->dev->name);
bond->primary_slave = NULL; bond->primary_slave = NULL;
bond_select_active_slave(bond); bond_select_active_slave(bond);
} else { } else {
pr_info(DRV_NAME ": %s: Unable to set %.*s" pr_info("%s: Unable to set %.*s as active slave as it is not a slave.\n",
" as active slave as it is not a slave.\n",
bond->dev->name, (int)strlen(buf) - 1, buf); bond->dev->name, (int)strlen(buf) - 1, buf);
} }
} }
...@@ -1600,8 +1528,7 @@ int bond_create_sysfs(void) ...@@ -1600,8 +1528,7 @@ int bond_create_sysfs(void)
/* Is someone being kinky and naming a device bonding_master? */ /* Is someone being kinky and naming a device bonding_master? */
if (__dev_get_by_name(&init_net, if (__dev_get_by_name(&init_net,
class_attr_bonding_masters.attr.name)) class_attr_bonding_masters.attr.name))
pr_err("network device named %s already " pr_err("network device named %s already exists in sysfs",
"exists in sysfs",
class_attr_bonding_masters.attr.name); class_attr_bonding_masters.attr.name);
ret = 0; ret = 0;
} }
......
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