Commit 17720981 authored by Jarod Wilson's avatar Jarod Wilson Committed by David S. Miller

bonding/802.3ad: convert to using slave printk macros

All of these printk instances benefit from having both master and slave
device information included, so convert to using a standardized macro
format and remove redundant information.
Suggested-by: default avatarJoe Perches <joe@perches.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: netdev@vger.kernel.org
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2a7420d
...@@ -325,17 +325,17 @@ static u16 __get_link_speed(struct port *port) ...@@ -325,17 +325,17 @@ static u16 __get_link_speed(struct port *port)
default: default:
/* unknown speed value from ethtool. shouldn't happen */ /* unknown speed value from ethtool. shouldn't happen */
if (slave->speed != SPEED_UNKNOWN) if (slave->speed != SPEED_UNKNOWN)
pr_warn_once("%s: unknown ethtool speed (%d) for port %d (set it to 0)\n", pr_warn_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n",
slave->bond->dev->name, slave->bond->dev->name,
slave->speed, slave->dev->name, slave->speed,
port->actor_port_number); port->actor_port_number);
speed = 0; speed = 0;
break; break;
} }
} }
netdev_dbg(slave->bond->dev, "Port %d Received link speed %d update from adapter\n", slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n",
port->actor_port_number, speed); port->actor_port_number, speed);
return speed; return speed;
} }
...@@ -359,14 +359,14 @@ static u8 __get_duplex(struct port *port) ...@@ -359,14 +359,14 @@ static u8 __get_duplex(struct port *port)
switch (slave->duplex) { switch (slave->duplex) {
case DUPLEX_FULL: case DUPLEX_FULL:
retval = 0x1; retval = 0x1;
netdev_dbg(slave->bond->dev, "Port %d Received status full duplex update from adapter\n", slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status full duplex update from adapter\n",
port->actor_port_number); port->actor_port_number);
break; break;
case DUPLEX_HALF: case DUPLEX_HALF:
default: default:
retval = 0x0; retval = 0x0;
netdev_dbg(slave->bond->dev, "Port %d Received status NOT full duplex update from adapter\n", slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status NOT full duplex update from adapter\n",
port->actor_port_number); port->actor_port_number);
break; break;
} }
} }
...@@ -500,10 +500,12 @@ static void __record_pdu(struct lacpdu *lacpdu, struct port *port) ...@@ -500,10 +500,12 @@ static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
if ((port->sm_vars & AD_PORT_MATCHED) && if ((port->sm_vars & AD_PORT_MATCHED) &&
(lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) { (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) {
partner->port_state |= AD_STATE_SYNCHRONIZATION; partner->port_state |= AD_STATE_SYNCHRONIZATION;
pr_debug("%s partner sync=1\n", port->slave->dev->name); slave_dbg(port->slave->bond->dev, port->slave->dev,
"partner sync=1\n");
} else { } else {
partner->port_state &= ~AD_STATE_SYNCHRONIZATION; partner->port_state &= ~AD_STATE_SYNCHRONIZATION;
pr_debug("%s partner sync=0\n", port->slave->dev->name); slave_dbg(port->slave->bond->dev, port->slave->dev,
"partner sync=0\n");
} }
} }
} }
...@@ -789,8 +791,9 @@ static inline void __update_lacpdu_from_port(struct port *port) ...@@ -789,8 +791,9 @@ static inline void __update_lacpdu_from_port(struct port *port)
lacpdu->actor_port_priority = htons(port->actor_port_priority); lacpdu->actor_port_priority = htons(port->actor_port_priority);
lacpdu->actor_port = htons(port->actor_port_number); lacpdu->actor_port = htons(port->actor_port_number);
lacpdu->actor_state = port->actor_oper_port_state; lacpdu->actor_state = port->actor_oper_port_state;
pr_debug("update lacpdu: %s, actor port state %x\n", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->slave->dev->name, port->actor_oper_port_state); "update lacpdu: actor port state %x\n",
port->actor_oper_port_state);
/* lacpdu->reserved_3_1 initialized /* lacpdu->reserved_3_1 initialized
* lacpdu->tlv_type_partner_info initialized * lacpdu->tlv_type_partner_info initialized
...@@ -1022,11 +1025,11 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr) ...@@ -1022,11 +1025,11 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
/* 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 (%s), Last State=%d, Curr State=%d\n", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number, "Mux Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->slave->dev->name, port->actor_port_number,
last_state, last_state,
port->sm_mux_state); port->sm_mux_state);
switch (port->sm_mux_state) { switch (port->sm_mux_state) {
case AD_MUX_DETACHED: case AD_MUX_DETACHED:
port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION; port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION;
...@@ -1140,11 +1143,11 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1140,11 +1143,11 @@ 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 (%s), Last State=%d, Curr State=%d\n", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number, "Rx Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->slave->dev->name, port->actor_port_number,
last_state, last_state,
port->sm_rx_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_MASKS)) if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS))
...@@ -1192,9 +1195,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1192,9 +1195,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
/* detect loopback situation */ /* detect loopback situation */
if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system), if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
&(port->actor_system))) { &(port->actor_system))) {
netdev_err(port->slave->bond->dev, "An illegal loopback occurred on adapter (%s)\n" slave_err(port->slave->bond->dev, port->slave->dev, "An illegal loopback occurred on slave\n"
"Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n");
port->slave->dev->name);
return; return;
} }
__update_selected(lacpdu, port); __update_selected(lacpdu, port);
...@@ -1263,8 +1265,10 @@ static void ad_tx_machine(struct port *port) ...@@ -1263,8 +1265,10 @@ 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", slave_dbg(port->slave->bond->dev,
port->actor_port_number); port->slave->dev,
"Sent LACPDU on port %d\n",
port->actor_port_number);
/* mark ntt as false, so it will not be sent /* mark ntt as false, so it will not be sent
* again until demanded * again until demanded
...@@ -1343,9 +1347,10 @@ static void ad_periodic_machine(struct port *port) ...@@ -1343,9 +1347,10 @@ 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", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number, last_state, "Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n",
port->sm_periodic_state); 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; port->sm_periodic_timer_counter = 0;
...@@ -1421,9 +1426,9 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr) ...@@ -1421,9 +1426,9 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
port->next_port_in_aggregator = NULL; port->next_port_in_aggregator = NULL;
port->actor_port_aggregator_identifier = 0; port->actor_port_aggregator_identifier = 0;
netdev_dbg(bond->dev, "Port %d left LAG %d\n", slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n",
port->actor_port_number, port->actor_port_number,
temp_aggregator->aggregator_identifier); temp_aggregator->aggregator_identifier);
/* if the aggregator is empty, clear its /* if the aggregator is empty, clear its
* parameters, and set it ready to be attached * parameters, and set it ready to be attached
*/ */
...@@ -1436,10 +1441,10 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr) ...@@ -1436,10 +1441,10 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
/* meaning: the port was related to an aggregator /* meaning: the port was related to an aggregator
* but was not on the aggregator port list * but was not on the aggregator port list
*/ */
net_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", net_warn_ratelimited("%s: (slave %s): Warning: Port %d was related to aggregator %d but was not on its port list\n",
port->slave->bond->dev->name, port->slave->bond->dev->name,
port->actor_port_number,
port->slave->dev->name, port->slave->dev->name,
port->actor_port_number,
port->aggregator->aggregator_identifier); port->aggregator->aggregator_identifier);
} }
} }
...@@ -1470,9 +1475,9 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr) ...@@ -1470,9 +1475,9 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
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;
netdev_dbg(bond->dev, "Port %d joined LAG %d(existing LAG)\n", slave_dbg(bond->dev, slave->dev, "Port %d joined LAG %d (existing LAG)\n",
port->actor_port_number, port->actor_port_number,
port->aggregator->aggregator_identifier); port->aggregator->aggregator_identifier);
/* mark this port as selected */ /* mark this port as selected */
port->sm_vars |= AD_PORT_SELECTED; port->sm_vars |= AD_PORT_SELECTED;
...@@ -1517,12 +1522,13 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr) ...@@ -1517,12 +1522,13 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
/* mark this port as selected */ /* mark this port as selected */
port->sm_vars |= AD_PORT_SELECTED; port->sm_vars |= AD_PORT_SELECTED;
netdev_dbg(bond->dev, "Port %d joined LAG %d(new LAG)\n", slave_dbg(bond->dev, port->slave->dev, "Port %d joined LAG %d (new LAG)\n",
port->actor_port_number, port->actor_port_number,
port->aggregator->aggregator_identifier); port->aggregator->aggregator_identifier);
} else { } else {
netdev_err(bond->dev, "Port %d (on %s) did not find a suitable aggregator\n", slave_err(bond->dev, port->slave->dev,
port->actor_port_number, port->slave->dev->name); "Port %d did not find a suitable aggregator\n",
port->actor_port_number);
} }
} }
/* if all aggregator's ports are READY_N == TRUE, set ready=TRUE /* if all aggregator's ports are READY_N == TRUE, set ready=TRUE
...@@ -1601,8 +1607,9 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, ...@@ -1601,8 +1607,9 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
break; break;
default: default:
net_warn_ratelimited("%s: Impossible agg select mode %d\n", net_warn_ratelimited("%s: (slave %s): Impossible agg select mode %d\n",
curr->slave->bond->dev->name, curr->slave->bond->dev->name,
curr->slave->dev->name,
__get_agg_selection_mode(curr->lag_ports)); __get_agg_selection_mode(curr->lag_ports));
break; break;
} }
...@@ -1703,36 +1710,37 @@ static void ad_agg_selection_logic(struct aggregator *agg, ...@@ -1703,36 +1710,37 @@ static void ad_agg_selection_logic(struct aggregator *agg,
/* if there is new best aggregator, activate it */ /* if there is new best aggregator, activate it */
if (best) { if (best) {
netdev_dbg(bond->dev, "best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
best->slave ? best->slave->dev->name : "NULL",
best->aggregator_identifier, best->num_of_ports, best->aggregator_identifier, best->num_of_ports,
best->actor_oper_aggregator_key, best->actor_oper_aggregator_key,
best->partner_oper_aggregator_key, best->partner_oper_aggregator_key,
best->is_individual, best->is_active); best->is_individual, best->is_active);
netdev_dbg(bond->dev, "best ports %p slave %p %s\n", netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n",
best->lag_ports, best->slave, best->slave ? best->slave->dev->name : "NULL",
best->slave ? best->slave->dev->name : "NULL"); best->lag_ports, best->slave);
bond_for_each_slave_rcu(bond, slave, iter) { bond_for_each_slave_rcu(bond, slave, iter) {
agg = &(SLAVE_AD_INFO(slave)->aggregator); agg = &(SLAVE_AD_INFO(slave)->aggregator);
netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", slave_dbg(bond->dev, slave->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
agg->aggregator_identifier, agg->num_of_ports, agg->aggregator_identifier, agg->num_of_ports,
agg->actor_oper_aggregator_key, agg->actor_oper_aggregator_key,
agg->partner_oper_aggregator_key, agg->partner_oper_aggregator_key,
agg->is_individual, agg->is_active); agg->is_individual, agg->is_active);
} }
/* check if any partner replys */ /* check if any partner replies */
if (best->is_individual) { if (best->is_individual)
net_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", net_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
best->slave ? bond->dev->name);
best->slave->bond->dev->name : "NULL");
}
best->is_active = 1; best->is_active = 1;
netdev_dbg(bond->dev, "LAG %d chosen as the active LAG\n", netdev_dbg(bond->dev, "(slave %s): LAG %d chosen as the active LAG\n",
best->slave ? best->slave->dev->name : "NULL",
best->aggregator_identifier); best->aggregator_identifier);
netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", netdev_dbg(bond->dev, "(slave %s): Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
best->slave ? best->slave->dev->name : "NULL",
best->aggregator_identifier, best->num_of_ports, best->aggregator_identifier, best->num_of_ports,
best->actor_oper_aggregator_key, best->actor_oper_aggregator_key,
best->partner_oper_aggregator_key, best->partner_oper_aggregator_key,
...@@ -1788,7 +1796,9 @@ static void ad_clear_agg(struct aggregator *aggregator) ...@@ -1788,7 +1796,9 @@ 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", pr_debug("%s: LAG %d was cleared\n",
aggregator->slave ?
aggregator->slave->dev->name : "NULL",
aggregator->aggregator_identifier); aggregator->aggregator_identifier);
} }
} }
...@@ -1885,9 +1895,10 @@ static void ad_enable_collecting_distributing(struct port *port, ...@@ -1885,9 +1895,10 @@ static void ad_enable_collecting_distributing(struct port *port,
bool *update_slave_arr) bool *update_slave_arr)
{ {
if (port->aggregator->is_active) { if (port->aggregator->is_active) {
pr_debug("Enabling port %d(LAG %d)\n", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number, "Enabling port %d (LAG %d)\n",
port->aggregator->aggregator_identifier); port->actor_port_number,
port->aggregator->aggregator_identifier);
__enable_port(port); __enable_port(port);
/* Slave array needs update */ /* Slave array needs update */
*update_slave_arr = true; *update_slave_arr = true;
...@@ -1905,9 +1916,10 @@ static void ad_disable_collecting_distributing(struct port *port, ...@@ -1905,9 +1916,10 @@ static void ad_disable_collecting_distributing(struct port *port,
if (port->aggregator && if (port->aggregator &&
!MAC_ADDRESS_EQUAL(&(port->aggregator->partner_system), !MAC_ADDRESS_EQUAL(&(port->aggregator->partner_system),
&(null_mac_addr))) { &(null_mac_addr))) {
pr_debug("Disabling port %d(LAG %d)\n", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number, "Disabling port %d (LAG %d)\n",
port->aggregator->aggregator_identifier); port->actor_port_number,
port->aggregator->aggregator_identifier);
__disable_port(port); __disable_port(port);
/* Slave array needs an update */ /* Slave array needs an update */
*update_slave_arr = true; *update_slave_arr = true;
...@@ -1920,7 +1932,7 @@ static void ad_disable_collecting_distributing(struct port *port, ...@@ -1920,7 +1932,7 @@ static void ad_disable_collecting_distributing(struct port *port,
* @port: the port we're looking at * @port: the port we're looking at
*/ */
static void ad_marker_info_received(struct bond_marker *marker_info, static void ad_marker_info_received(struct bond_marker *marker_info,
struct port *port) struct port *port)
{ {
struct bond_marker marker; struct bond_marker marker;
...@@ -1933,10 +1945,10 @@ static void ad_marker_info_received(struct bond_marker *marker_info, ...@@ -1933,10 +1945,10 @@ static void ad_marker_info_received(struct bond_marker *marker_info,
marker.tlv_type = AD_MARKER_RESPONSE_SUBTYPE; marker.tlv_type = AD_MARKER_RESPONSE_SUBTYPE;
/* 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", slave_dbg(port->slave->bond->dev, port->slave->dev,
port->actor_port_number); "Sent Marker Response on port %d\n",
} port->actor_port_number);
} }
/** /**
...@@ -2085,13 +2097,12 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2085,13 +2097,12 @@ void bond_3ad_unbind_slave(struct slave *slave)
/* if slave is null, the whole port is not initialized */ /* if slave is null, the whole port is not initialized */
if (!port->slave) { if (!port->slave) {
netdev_warn(bond->dev, "Trying to unbind an uninitialized port on %s\n", slave_warn(bond->dev, slave->dev, "Trying to unbind an uninitialized port\n");
slave->dev->name);
goto out; goto out;
} }
netdev_dbg(bond->dev, "Unbinding Link Aggregation Group %d\n", slave_dbg(bond->dev, slave->dev, "Unbinding Link Aggregation Group %d\n",
aggregator->aggregator_identifier); aggregator->aggregator_identifier);
/* Tell the partner that this port is not suitable for aggregation */ /* Tell the partner that this port is not suitable for aggregation */
port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION; port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION;
...@@ -2129,13 +2140,13 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2129,13 +2140,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
* new aggregator * new aggregator
*/ */
if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
netdev_dbg(bond->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n", slave_dbg(bond->dev, slave->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n",
aggregator->aggregator_identifier, aggregator->aggregator_identifier,
new_aggregator->aggregator_identifier); new_aggregator->aggregator_identifier);
if ((new_aggregator->lag_ports == port) && if ((new_aggregator->lag_ports == port) &&
new_aggregator->is_active) { new_aggregator->is_active) {
netdev_info(bond->dev, "Removing an active aggregator\n"); slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
select_new_active_agg = 1; select_new_active_agg = 1;
} }
...@@ -2166,7 +2177,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2166,7 +2177,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),
&dummy_slave_update); &dummy_slave_update);
} else { } else {
netdev_warn(bond->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n"); slave_warn(bond->dev, slave->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n");
} }
} else { } else {
/* in case that the only port related to this /* in case that the only port related to this
...@@ -2175,7 +2186,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2175,7 +2186,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
select_new_active_agg = aggregator->is_active; select_new_active_agg = aggregator->is_active;
ad_clear_agg(aggregator); ad_clear_agg(aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
netdev_info(bond->dev, "Removing an active aggregator\n"); slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
/* select new active aggregator */ /* select new active aggregator */
temp_aggregator = __get_first_agg(port); temp_aggregator = __get_first_agg(port);
if (temp_aggregator) if (temp_aggregator)
...@@ -2185,7 +2196,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2185,7 +2196,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
} }
} }
netdev_dbg(bond->dev, "Unbinding port %d\n", port->actor_port_number); slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", port->actor_port_number);
/* find the aggregator that this port is connected to */ /* find the aggregator that this port is connected to */
bond_for_each_slave(bond, slave_iter, iter) { bond_for_each_slave(bond, slave_iter, iter) {
...@@ -2208,7 +2219,7 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2208,7 +2219,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
select_new_active_agg = temp_aggregator->is_active; select_new_active_agg = temp_aggregator->is_active;
ad_clear_agg(temp_aggregator); ad_clear_agg(temp_aggregator);
if (select_new_active_agg) { if (select_new_active_agg) {
netdev_info(bond->dev, "Removing an active aggregator\n"); slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
/* select new active aggregator */ /* select new active aggregator */
ad_agg_selection_logic(__get_first_agg(port), ad_agg_selection_logic(__get_first_agg(port),
&dummy_slave_update); &dummy_slave_update);
...@@ -2379,9 +2390,9 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave) ...@@ -2379,9 +2390,9 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
switch (lacpdu->subtype) { switch (lacpdu->subtype) {
case AD_TYPE_LACPDU: case AD_TYPE_LACPDU:
ret = RX_HANDLER_CONSUMED; ret = RX_HANDLER_CONSUMED;
netdev_dbg(slave->bond->dev, slave_dbg(slave->bond->dev, slave->dev,
"Received LACPDU on port %d slave %s\n", "Received LACPDU on port %d\n",
port->actor_port_number, slave->dev->name); port->actor_port_number);
/* Protect against concurrent state machines */ /* Protect against concurrent state machines */
spin_lock(&slave->bond->mode_lock); spin_lock(&slave->bond->mode_lock);
ad_rx_machine(lacpdu, port); ad_rx_machine(lacpdu, port);
...@@ -2395,18 +2406,18 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave) ...@@ -2395,18 +2406,18 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
marker = (struct bond_marker *)lacpdu; marker = (struct bond_marker *)lacpdu;
switch (marker->tlv_type) { switch (marker->tlv_type) {
case AD_MARKER_INFORMATION_SUBTYPE: case AD_MARKER_INFORMATION_SUBTYPE:
netdev_dbg(slave->bond->dev, "Received Marker Information on port %d\n", slave_dbg(slave->bond->dev, slave->dev, "Received Marker Information on port %d\n",
port->actor_port_number); port->actor_port_number);
ad_marker_info_received(marker, port); ad_marker_info_received(marker, port);
break; break;
case AD_MARKER_RESPONSE_SUBTYPE: case AD_MARKER_RESPONSE_SUBTYPE:
netdev_dbg(slave->bond->dev, "Received Marker Response on port %d\n", slave_dbg(slave->bond->dev, slave->dev, "Received Marker Response on port %d\n",
port->actor_port_number); port->actor_port_number);
ad_marker_response_received(marker, port); ad_marker_response_received(marker, port);
break; break;
default: default:
netdev_dbg(slave->bond->dev, "Received an unknown Marker subtype on slot %d\n", slave_dbg(slave->bond->dev, slave->dev, "Received an unknown Marker subtype on port %d\n",
port->actor_port_number); port->actor_port_number);
stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx; stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx;
atomic64_inc(stat); atomic64_inc(stat);
stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx; stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx;
...@@ -2456,9 +2467,10 @@ static void ad_update_actor_keys(struct port *port, bool reset) ...@@ -2456,9 +2467,10 @@ static void ad_update_actor_keys(struct port *port, bool reset)
if (!reset) { if (!reset) {
if (!speed) { if (!speed) {
netdev_err(port->slave->dev, slave_err(port->slave->bond->dev,
"speed changed to 0 for port %s", port->slave->dev,
port->slave->dev->name); "speed changed to 0 on port %d\n",
port->actor_port_number);
} else if (duplex && ospeed != speed) { } else if (duplex && ospeed != speed) {
/* Speed change restarts LACP state-machine */ /* Speed change restarts LACP state-machine */
port->sm_vars |= AD_PORT_BEGIN; port->sm_vars |= AD_PORT_BEGIN;
...@@ -2483,17 +2495,16 @@ void bond_3ad_adapter_speed_duplex_changed(struct slave *slave) ...@@ -2483,17 +2495,16 @@ void bond_3ad_adapter_speed_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) {
netdev_warn(slave->bond->dev, slave_warn(slave->bond->dev, slave->dev,
"speed/duplex changed for uninitialized port %s\n", "speed/duplex changed for uninitialized port\n");
slave->dev->name);
return; return;
} }
spin_lock_bh(&slave->bond->mode_lock); spin_lock_bh(&slave->bond->mode_lock);
ad_update_actor_keys(port, false); ad_update_actor_keys(port, false);
spin_unlock_bh(&slave->bond->mode_lock); spin_unlock_bh(&slave->bond->mode_lock);
netdev_dbg(slave->bond->dev, "Port %d slave %s changed speed/duplex\n", slave_dbg(slave->bond->dev, slave->dev, "Port %d changed speed/duplex\n",
port->actor_port_number, slave->dev->name); port->actor_port_number);
} }
/** /**
...@@ -2513,8 +2524,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) ...@@ -2513,8 +2524,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) {
netdev_warn(slave->bond->dev, "link status changed for uninitialized port on %s\n", slave_warn(slave->bond->dev, slave->dev, "link status changed for uninitialized port\n");
slave->dev->name);
return; return;
} }
...@@ -2539,9 +2549,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) ...@@ -2539,9 +2549,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
spin_unlock_bh(&slave->bond->mode_lock); spin_unlock_bh(&slave->bond->mode_lock);
netdev_dbg(slave->bond->dev, "Port %d changed link status to %s\n", slave_dbg(slave->bond->dev, slave->dev, "Port %d changed link status to %s\n",
port->actor_port_number, port->actor_port_number,
link == BOND_LINK_UP ? "UP" : "DOWN"); link == BOND_LINK_UP ? "UP" : "DOWN");
/* RTNL is held and mode_lock is released so it's safe /* RTNL is held and mode_lock is released so it's safe
* to update slave_array here. * to update slave_array here.
......
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