diff options
author | Joe Perches <joe@perches.com> | 2009-12-13 23:06:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-13 23:06:07 -0500 |
commit | a4aee5c808fc5bf6889c9012217841eb3fd91a6a (patch) | |
tree | 28b2f17a9907685ab530b20d46bc9d50797ae692 /drivers/net/bonding/bond_3ad.c | |
parent | 231d52a7bec6d141883d81dbb5516bff4a07533b (diff) |
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: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 171 |
1 files changed, 94 insertions, 77 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index d69e6838f21e..0fb7a4964e75 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
24 | #include <linux/if_ether.h> | 26 | #include <linux/if_ether.h> |
25 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
@@ -352,7 +354,8 @@ static u16 __get_link_speed(struct port *port) | |||
352 | } | 354 | } |
353 | } | 355 | } |
354 | 356 | ||
355 | pr_debug("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed); | 357 | pr_debug("Port %d Received link speed %d update from adapter\n", |
358 | port->actor_port_number, speed); | ||
356 | return speed; | 359 | return speed; |
357 | } | 360 | } |
358 | 361 | ||
@@ -378,12 +381,14 @@ static u8 __get_duplex(struct port *port) | |||
378 | switch (slave->duplex) { | 381 | switch (slave->duplex) { |
379 | case DUPLEX_FULL: | 382 | case DUPLEX_FULL: |
380 | retval=0x1; | 383 | retval=0x1; |
381 | pr_debug("Port %d Received status full duplex update from adapter\n", port->actor_port_number); | 384 | pr_debug("Port %d Received status full duplex update from adapter\n", |
385 | port->actor_port_number); | ||
382 | break; | 386 | break; |
383 | case DUPLEX_HALF: | 387 | case DUPLEX_HALF: |
384 | default: | 388 | default: |
385 | retval=0x0; | 389 | retval=0x0; |
386 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", port->actor_port_number); | 390 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", |
391 | port->actor_port_number); | ||
387 | break; | 392 | break; |
388 | } | 393 | } |
389 | } | 394 | } |
@@ -980,7 +985,9 @@ static void ad_mux_machine(struct port *port) | |||
980 | 985 | ||
981 | // check if the state machine was changed | 986 | // check if the state machine was changed |
982 | if (port->sm_mux_state != last_state) { | 987 | if (port->sm_mux_state != last_state) { |
983 | pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state); | 988 | pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", |
989 | port->actor_port_number, last_state, | ||
990 | port->sm_mux_state); | ||
984 | switch (port->sm_mux_state) { | 991 | switch (port->sm_mux_state) { |
985 | case AD_MUX_DETACHED: | 992 | case AD_MUX_DETACHED: |
986 | __detach_bond_from_agg(port); | 993 | __detach_bond_from_agg(port); |
@@ -1079,7 +1086,9 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) | |||
1079 | 1086 | ||
1080 | // check if the State machine was changed or new lacpdu arrived | 1087 | // check if the State machine was changed or new lacpdu arrived |
1081 | if ((port->sm_rx_state != last_state) || (lacpdu)) { | 1088 | if ((port->sm_rx_state != last_state) || (lacpdu)) { |
1082 | pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state); | 1089 | pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", |
1090 | port->actor_port_number, last_state, | ||
1091 | port->sm_rx_state); | ||
1083 | switch (port->sm_rx_state) { | 1092 | switch (port->sm_rx_state) { |
1084 | case AD_RX_INITIALIZE: | 1093 | case AD_RX_INITIALIZE: |
1085 | if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) { | 1094 | 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 | // detect loopback situation | 1135 | // detect loopback situation |
1127 | if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { | 1136 | if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { |
1128 | // INFO_RECEIVED_LOOPBACK_FRAMES | 1137 | // INFO_RECEIVED_LOOPBACK_FRAMES |
1129 | pr_err(DRV_NAME ": %s: An illegal loopback occurred on " | 1138 | pr_err("%s: An illegal loopback occurred on adapter (%s).\n" |
1130 | "adapter (%s). Check the configuration to verify that all " | 1139 | "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", |
1131 | "Adapters are connected to 802.3ad compliant switch ports\n", | ||
1132 | port->slave->dev->master->name, port->slave->dev->name); | 1140 | port->slave->dev->master->name, port->slave->dev->name); |
1133 | __release_rx_machine_lock(port); | 1141 | __release_rx_machine_lock(port); |
1134 | return; | 1142 | return; |
@@ -1166,7 +1174,8 @@ static void ad_tx_machine(struct port *port) | |||
1166 | __update_lacpdu_from_port(port); | 1174 | __update_lacpdu_from_port(port); |
1167 | 1175 | ||
1168 | if (ad_lacpdu_send(port) >= 0) { | 1176 | if (ad_lacpdu_send(port) >= 0) { |
1169 | pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); | 1177 | pr_debug("Sent LACPDU on port %d\n", |
1178 | port->actor_port_number); | ||
1170 | 1179 | ||
1171 | /* mark ntt as false, so it will not be sent again until | 1180 | /* mark ntt as false, so it will not be sent again until |
1172 | demanded */ | 1181 | demanded */ |
@@ -1241,7 +1250,9 @@ static void ad_periodic_machine(struct port *port) | |||
1241 | 1250 | ||
1242 | // check if the state machine was changed | 1251 | // check if the state machine was changed |
1243 | if (port->sm_periodic_state != last_state) { | 1252 | if (port->sm_periodic_state != last_state) { |
1244 | pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state); | 1253 | pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", |
1254 | port->actor_port_number, last_state, | ||
1255 | port->sm_periodic_state); | ||
1245 | switch (port->sm_periodic_state) { | 1256 | switch (port->sm_periodic_state) { |
1246 | case AD_NO_PERIODIC: | 1257 | case AD_NO_PERIODIC: |
1247 | port->sm_periodic_timer_counter = 0; // zero timer | 1258 | port->sm_periodic_timer_counter = 0; // zero timer |
@@ -1298,7 +1309,9 @@ static void ad_port_selection_logic(struct port *port) | |||
1298 | port->next_port_in_aggregator=NULL; | 1309 | port->next_port_in_aggregator=NULL; |
1299 | port->actor_port_aggregator_identifier=0; | 1310 | port->actor_port_aggregator_identifier=0; |
1300 | 1311 | ||
1301 | pr_debug("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier); | 1312 | pr_debug("Port %d left LAG %d\n", |
1313 | port->actor_port_number, | ||
1314 | temp_aggregator->aggregator_identifier); | ||
1302 | // if the aggregator is empty, clear its parameters, and set it ready to be attached | 1315 | // if the aggregator is empty, clear its parameters, and set it ready to be attached |
1303 | if (!temp_aggregator->lag_ports) { | 1316 | if (!temp_aggregator->lag_ports) { |
1304 | ad_clear_agg(temp_aggregator); | 1317 | ad_clear_agg(temp_aggregator); |
@@ -1307,9 +1320,7 @@ static void ad_port_selection_logic(struct port *port) | |||
1307 | } | 1320 | } |
1308 | } | 1321 | } |
1309 | if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list | 1322 | if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list |
1310 | pr_warning(DRV_NAME ": %s: Warning: Port %d (on %s) " | 1323 | pr_warning("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", |
1311 | "was related to aggregator %d but was not " | ||
1312 | "on its port list\n", | ||
1313 | port->slave->dev->master->name, | 1324 | port->slave->dev->master->name, |
1314 | port->actor_port_number, | 1325 | port->actor_port_number, |
1315 | port->slave->dev->name, | 1326 | port->slave->dev->name, |
@@ -1343,7 +1354,9 @@ static void ad_port_selection_logic(struct port *port) | |||
1343 | port->next_port_in_aggregator=aggregator->lag_ports; | 1354 | port->next_port_in_aggregator=aggregator->lag_ports; |
1344 | port->aggregator->num_of_ports++; | 1355 | port->aggregator->num_of_ports++; |
1345 | aggregator->lag_ports=port; | 1356 | aggregator->lag_ports=port; |
1346 | pr_debug("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1357 | pr_debug("Port %d joined LAG %d(existing LAG)\n", |
1358 | port->actor_port_number, | ||
1359 | port->aggregator->aggregator_identifier); | ||
1347 | 1360 | ||
1348 | // mark this port as selected | 1361 | // mark this port as selected |
1349 | port->sm_vars |= AD_PORT_SELECTED; | 1362 | port->sm_vars |= AD_PORT_SELECTED; |
@@ -1380,10 +1393,11 @@ static void ad_port_selection_logic(struct port *port) | |||
1380 | // mark this port as selected | 1393 | // mark this port as selected |
1381 | port->sm_vars |= AD_PORT_SELECTED; | 1394 | port->sm_vars |= AD_PORT_SELECTED; |
1382 | 1395 | ||
1383 | pr_debug("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1396 | pr_debug("Port %d joined LAG %d(new LAG)\n", |
1397 | port->actor_port_number, | ||
1398 | port->aggregator->aggregator_identifier); | ||
1384 | } else { | 1399 | } else { |
1385 | pr_err(DRV_NAME ": %s: Port %d (on %s) did not find " | 1400 | pr_err("%s: Port %d (on %s) did not find a suitable aggregator\n", |
1386 | "a suitable aggregator\n", | ||
1387 | port->slave->dev->master->name, | 1401 | port->slave->dev->master->name, |
1388 | port->actor_port_number, port->slave->dev->name); | 1402 | port->actor_port_number, port->slave->dev->name); |
1389 | } | 1403 | } |
@@ -1460,8 +1474,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, | |||
1460 | break; | 1474 | break; |
1461 | 1475 | ||
1462 | default: | 1476 | default: |
1463 | pr_warning(DRV_NAME | 1477 | pr_warning("%s: Impossible agg select mode %d\n", |
1464 | ": %s: Impossible agg select mode %d\n", | ||
1465 | curr->slave->dev->master->name, | 1478 | curr->slave->dev->master->name, |
1466 | __get_agg_selection_mode(curr->lag_ports)); | 1479 | __get_agg_selection_mode(curr->lag_ports)); |
1467 | break; | 1480 | break; |
@@ -1546,40 +1559,38 @@ static void ad_agg_selection_logic(struct aggregator *agg) | |||
1546 | // if there is new best aggregator, activate it | 1559 | // if there is new best aggregator, activate it |
1547 | if (best) { | 1560 | if (best) { |
1548 | pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1561 | pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1549 | best->aggregator_identifier, best->num_of_ports, | 1562 | best->aggregator_identifier, best->num_of_ports, |
1550 | best->actor_oper_aggregator_key, | 1563 | best->actor_oper_aggregator_key, |
1551 | best->partner_oper_aggregator_key, | 1564 | best->partner_oper_aggregator_key, |
1552 | best->is_individual, best->is_active); | 1565 | best->is_individual, best->is_active); |
1553 | pr_debug("best ports %p slave %p %s\n", | 1566 | pr_debug("best ports %p slave %p %s\n", |
1554 | best->lag_ports, best->slave, | 1567 | best->lag_ports, best->slave, |
1555 | best->slave ? best->slave->dev->name : "NULL"); | 1568 | best->slave ? best->slave->dev->name : "NULL"); |
1556 | 1569 | ||
1557 | for (agg = __get_first_agg(best->lag_ports); agg; | 1570 | for (agg = __get_first_agg(best->lag_ports); agg; |
1558 | agg = __get_next_agg(agg)) { | 1571 | agg = __get_next_agg(agg)) { |
1559 | 1572 | ||
1560 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1573 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1561 | agg->aggregator_identifier, agg->num_of_ports, | 1574 | agg->aggregator_identifier, agg->num_of_ports, |
1562 | agg->actor_oper_aggregator_key, | 1575 | agg->actor_oper_aggregator_key, |
1563 | agg->partner_oper_aggregator_key, | 1576 | agg->partner_oper_aggregator_key, |
1564 | agg->is_individual, agg->is_active); | 1577 | agg->is_individual, agg->is_active); |
1565 | } | 1578 | } |
1566 | 1579 | ||
1567 | // check if any partner replys | 1580 | // check if any partner replys |
1568 | if (best->is_individual) { | 1581 | if (best->is_individual) { |
1569 | pr_warning(DRV_NAME ": %s: Warning: No 802.3ad" | 1582 | pr_warning("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", |
1570 | " response from the link partner for any" | 1583 | best->slave->dev->master->name); |
1571 | " adapters in the bond\n", | ||
1572 | best->slave->dev->master->name); | ||
1573 | } | 1584 | } |
1574 | 1585 | ||
1575 | best->is_active = 1; | 1586 | best->is_active = 1; |
1576 | pr_debug("LAG %d chosen as the active LAG\n", | 1587 | pr_debug("LAG %d chosen as the active LAG\n", |
1577 | best->aggregator_identifier); | 1588 | best->aggregator_identifier); |
1578 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1589 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1579 | best->aggregator_identifier, best->num_of_ports, | 1590 | best->aggregator_identifier, best->num_of_ports, |
1580 | best->actor_oper_aggregator_key, | 1591 | best->actor_oper_aggregator_key, |
1581 | best->partner_oper_aggregator_key, | 1592 | best->partner_oper_aggregator_key, |
1582 | best->is_individual, best->is_active); | 1593 | best->is_individual, best->is_active); |
1583 | 1594 | ||
1584 | // disable the ports that were related to the former active_aggregator | 1595 | // disable the ports that were related to the former active_aggregator |
1585 | if (active) { | 1596 | if (active) { |
@@ -1633,7 +1644,8 @@ static void ad_clear_agg(struct aggregator *aggregator) | |||
1633 | aggregator->lag_ports = NULL; | 1644 | aggregator->lag_ports = NULL; |
1634 | aggregator->is_active = 0; | 1645 | aggregator->is_active = 0; |
1635 | aggregator->num_of_ports = 0; | 1646 | aggregator->num_of_ports = 0; |
1636 | pr_debug("LAG %d was cleared\n", aggregator->aggregator_identifier); | 1647 | pr_debug("LAG %d was cleared\n", |
1648 | aggregator->aggregator_identifier); | ||
1637 | } | 1649 | } |
1638 | } | 1650 | } |
1639 | 1651 | ||
@@ -1728,7 +1740,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast) | |||
1728 | static void ad_enable_collecting_distributing(struct port *port) | 1740 | static void ad_enable_collecting_distributing(struct port *port) |
1729 | { | 1741 | { |
1730 | if (port->aggregator->is_active) { | 1742 | if (port->aggregator->is_active) { |
1731 | pr_debug("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1743 | pr_debug("Enabling port %d(LAG %d)\n", |
1744 | port->actor_port_number, | ||
1745 | port->aggregator->aggregator_identifier); | ||
1732 | __enable_port(port); | 1746 | __enable_port(port); |
1733 | } | 1747 | } |
1734 | } | 1748 | } |
@@ -1741,7 +1755,9 @@ static void ad_enable_collecting_distributing(struct port *port) | |||
1741 | static void ad_disable_collecting_distributing(struct port *port) | 1755 | static void ad_disable_collecting_distributing(struct port *port) |
1742 | { | 1756 | { |
1743 | if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { | 1757 | if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { |
1744 | pr_debug("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1758 | pr_debug("Disabling port %d(LAG %d)\n", |
1759 | port->actor_port_number, | ||
1760 | port->aggregator->aggregator_identifier); | ||
1745 | __disable_port(port); | 1761 | __disable_port(port); |
1746 | } | 1762 | } |
1747 | } | 1763 | } |
@@ -1779,7 +1795,8 @@ static void ad_marker_info_send(struct port *port) | |||
1779 | 1795 | ||
1780 | // send the marker information | 1796 | // send the marker information |
1781 | if (ad_marker_send(port, &marker) >= 0) { | 1797 | if (ad_marker_send(port, &marker) >= 0) { |
1782 | pr_debug("Sent Marker Information on port %d\n", port->actor_port_number); | 1798 | pr_debug("Sent Marker Information on port %d\n", |
1799 | port->actor_port_number); | ||
1783 | } | 1800 | } |
1784 | } | 1801 | } |
1785 | #endif | 1802 | #endif |
@@ -1803,7 +1820,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info, | |||
1803 | // send the marker response | 1820 | // send the marker response |
1804 | 1821 | ||
1805 | if (ad_marker_send(port, &marker) >= 0) { | 1822 | if (ad_marker_send(port, &marker) >= 0) { |
1806 | pr_debug("Sent Marker Response on port %d\n", port->actor_port_number); | 1823 | pr_debug("Sent Marker Response on port %d\n", |
1824 | port->actor_port_number); | ||
1807 | } | 1825 | } |
1808 | } | 1826 | } |
1809 | 1827 | ||
@@ -1889,8 +1907,7 @@ int bond_3ad_bind_slave(struct slave *slave) | |||
1889 | struct aggregator *aggregator; | 1907 | struct aggregator *aggregator; |
1890 | 1908 | ||
1891 | if (bond == NULL) { | 1909 | if (bond == NULL) { |
1892 | pr_err(DRV_NAME ": %s: The slave %s is not attached to " | 1910 | pr_err("%s: The slave %s is not attached to its bond\n", |
1893 | "its bond\n", | ||
1894 | slave->dev->master->name, slave->dev->name); | 1911 | slave->dev->master->name, slave->dev->name); |
1895 | return -1; | 1912 | return -1; |
1896 | } | 1913 | } |
@@ -1966,13 +1983,13 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1966 | 1983 | ||
1967 | // if slave is null, the whole port is not initialized | 1984 | // if slave is null, the whole port is not initialized |
1968 | if (!port->slave) { | 1985 | if (!port->slave) { |
1969 | pr_warning(DRV_NAME ": Warning: %s: Trying to " | 1986 | pr_warning("Warning: %s: Trying to unbind an uninitialized port on %s\n", |
1970 | "unbind an uninitialized port on %s\n", | ||
1971 | slave->dev->master->name, slave->dev->name); | 1987 | slave->dev->master->name, slave->dev->name); |
1972 | return; | 1988 | return; |
1973 | } | 1989 | } |
1974 | 1990 | ||
1975 | pr_debug("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier); | 1991 | pr_debug("Unbinding Link Aggregation Group %d\n", |
1992 | aggregator->aggregator_identifier); | ||
1976 | 1993 | ||
1977 | /* Tell the partner that this port is not suitable for aggregation */ | 1994 | /* Tell the partner that this port is not suitable for aggregation */ |
1978 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; | 1995 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; |
@@ -1996,10 +2013,12 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1996 | // if new aggregator found, copy the aggregator's parameters | 2013 | // if new aggregator found, copy the aggregator's parameters |
1997 | // and connect the related lag_ports to the new aggregator | 2014 | // and connect the related lag_ports to the new aggregator |
1998 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { | 2015 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { |
1999 | pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); | 2016 | pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", |
2017 | aggregator->aggregator_identifier, | ||
2018 | new_aggregator->aggregator_identifier); | ||
2000 | 2019 | ||
2001 | if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { | 2020 | if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { |
2002 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2021 | pr_info("%s: Removing an active aggregator\n", |
2003 | aggregator->slave->dev->master->name); | 2022 | aggregator->slave->dev->master->name); |
2004 | // select new active aggregator | 2023 | // select new active aggregator |
2005 | select_new_active_agg = 1; | 2024 | select_new_active_agg = 1; |
@@ -2030,8 +2049,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2030 | ad_agg_selection_logic(__get_first_agg(port)); | 2049 | ad_agg_selection_logic(__get_first_agg(port)); |
2031 | } | 2050 | } |
2032 | } else { | 2051 | } else { |
2033 | pr_warning(DRV_NAME ": %s: Warning: unbinding aggregator, " | 2052 | pr_warning("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n", |
2034 | "and could not find a new aggregator for its ports\n", | ||
2035 | slave->dev->master->name); | 2053 | slave->dev->master->name); |
2036 | } | 2054 | } |
2037 | } else { // in case that the only port related to this aggregator is the one we want to remove | 2055 | } 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 | // clear the aggregator | 2057 | // clear the aggregator |
2040 | ad_clear_agg(aggregator); | 2058 | ad_clear_agg(aggregator); |
2041 | if (select_new_active_agg) { | 2059 | if (select_new_active_agg) { |
2042 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2060 | pr_info("%s: Removing an active aggregator\n", |
2043 | slave->dev->master->name); | 2061 | slave->dev->master->name); |
2044 | // select new active aggregator | 2062 | // select new active aggregator |
2045 | ad_agg_selection_logic(__get_first_agg(port)); | 2063 | ad_agg_selection_logic(__get_first_agg(port)); |
@@ -2066,7 +2084,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2066 | // clear the aggregator | 2084 | // clear the aggregator |
2067 | ad_clear_agg(temp_aggregator); | 2085 | ad_clear_agg(temp_aggregator); |
2068 | if (select_new_active_agg) { | 2086 | if (select_new_active_agg) { |
2069 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2087 | pr_info("%s: Removing an active aggregator\n", |
2070 | slave->dev->master->name); | 2088 | slave->dev->master->name); |
2071 | // select new active aggregator | 2089 | // select new active aggregator |
2072 | ad_agg_selection_logic(__get_first_agg(port)); | 2090 | ad_agg_selection_logic(__get_first_agg(port)); |
@@ -2115,8 +2133,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2115 | // select the active aggregator for the bond | 2133 | // select the active aggregator for the bond |
2116 | if ((port = __get_first_port(bond))) { | 2134 | if ((port = __get_first_port(bond))) { |
2117 | if (!port->slave) { | 2135 | if (!port->slave) { |
2118 | pr_warning(DRV_NAME ": %s: Warning: bond's first port is " | 2136 | pr_warning("%s: Warning: bond's first port is uninitialized\n", |
2119 | "uninitialized\n", bond->dev->name); | 2137 | bond->dev->name); |
2120 | goto re_arm; | 2138 | goto re_arm; |
2121 | } | 2139 | } |
2122 | 2140 | ||
@@ -2129,8 +2147,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2129 | // for each port run the state machines | 2147 | // for each port run the state machines |
2130 | for (port = __get_first_port(bond); port; port = __get_next_port(port)) { | 2148 | for (port = __get_first_port(bond); port; port = __get_next_port(port)) { |
2131 | if (!port->slave) { | 2149 | if (!port->slave) { |
2132 | pr_warning(DRV_NAME ": %s: Warning: Found an uninitialized " | 2150 | pr_warning("%s: Warning: Found an uninitialized port\n", |
2133 | "port\n", bond->dev->name); | 2151 | bond->dev->name); |
2134 | goto re_arm; | 2152 | goto re_arm; |
2135 | } | 2153 | } |
2136 | 2154 | ||
@@ -2171,15 +2189,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2171 | port = &(SLAVE_AD_INFO(slave).port); | 2189 | port = &(SLAVE_AD_INFO(slave).port); |
2172 | 2190 | ||
2173 | if (!port->slave) { | 2191 | if (!port->slave) { |
2174 | pr_warning(DRV_NAME ": %s: Warning: port of slave %s " | 2192 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", |
2175 | "is uninitialized\n", | ||
2176 | slave->dev->name, slave->dev->master->name); | 2193 | slave->dev->name, slave->dev->master->name); |
2177 | return; | 2194 | return; |
2178 | } | 2195 | } |
2179 | 2196 | ||
2180 | switch (lacpdu->subtype) { | 2197 | switch (lacpdu->subtype) { |
2181 | case AD_TYPE_LACPDU: | 2198 | case AD_TYPE_LACPDU: |
2182 | pr_debug("Received LACPDU on port %d\n", port->actor_port_number); | 2199 | pr_debug("Received LACPDU on port %d\n", |
2200 | port->actor_port_number); | ||
2183 | ad_rx_machine(lacpdu, port); | 2201 | ad_rx_machine(lacpdu, port); |
2184 | break; | 2202 | break; |
2185 | 2203 | ||
@@ -2188,17 +2206,20 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2188 | 2206 | ||
2189 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2207 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
2190 | case AD_MARKER_INFORMATION_SUBTYPE: | 2208 | case AD_MARKER_INFORMATION_SUBTYPE: |
2191 | pr_debug("Received Marker Information on port %d\n", port->actor_port_number); | 2209 | pr_debug("Received Marker Information on port %d\n", |
2210 | port->actor_port_number); | ||
2192 | ad_marker_info_received((struct bond_marker *)lacpdu, port); | 2211 | ad_marker_info_received((struct bond_marker *)lacpdu, port); |
2193 | break; | 2212 | break; |
2194 | 2213 | ||
2195 | case AD_MARKER_RESPONSE_SUBTYPE: | 2214 | case AD_MARKER_RESPONSE_SUBTYPE: |
2196 | pr_debug("Received Marker Response on port %d\n", port->actor_port_number); | 2215 | pr_debug("Received Marker Response on port %d\n", |
2216 | port->actor_port_number); | ||
2197 | ad_marker_response_received((struct bond_marker *)lacpdu, port); | 2217 | ad_marker_response_received((struct bond_marker *)lacpdu, port); |
2198 | break; | 2218 | break; |
2199 | 2219 | ||
2200 | default: | 2220 | default: |
2201 | pr_debug("Received an unknown Marker subtype on slot %d\n", port->actor_port_number); | 2221 | pr_debug("Received an unknown Marker subtype on slot %d\n", |
2222 | port->actor_port_number); | ||
2202 | } | 2223 | } |
2203 | } | 2224 | } |
2204 | } | 2225 | } |
@@ -2218,8 +2239,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) | |||
2218 | 2239 | ||
2219 | // if slave is null, the whole port is not initialized | 2240 | // if slave is null, the whole port is not initialized |
2220 | if (!port->slave) { | 2241 | if (!port->slave) { |
2221 | pr_warning(DRV_NAME ": Warning: %s: speed " | 2242 | pr_warning("Warning: %s: speed changed for uninitialized port on %s\n", |
2222 | "changed for uninitialized port on %s\n", | ||
2223 | slave->dev->master->name, slave->dev->name); | 2243 | slave->dev->master->name, slave->dev->name); |
2224 | return; | 2244 | return; |
2225 | } | 2245 | } |
@@ -2246,8 +2266,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2246 | 2266 | ||
2247 | // if slave is null, the whole port is not initialized | 2267 | // if slave is null, the whole port is not initialized |
2248 | if (!port->slave) { | 2268 | if (!port->slave) { |
2249 | pr_warning(DRV_NAME ": %s: Warning: duplex changed " | 2269 | pr_warning("%s: Warning: duplex changed for uninitialized port on %s\n", |
2250 | "for uninitialized port on %s\n", | ||
2251 | slave->dev->master->name, slave->dev->name); | 2270 | slave->dev->master->name, slave->dev->name); |
2252 | return; | 2271 | return; |
2253 | } | 2272 | } |
@@ -2275,8 +2294,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) | |||
2275 | 2294 | ||
2276 | // if slave is null, the whole port is not initialized | 2295 | // if slave is null, the whole port is not initialized |
2277 | if (!port->slave) { | 2296 | if (!port->slave) { |
2278 | pr_warning(DRV_NAME ": Warning: %s: link status changed for " | 2297 | pr_warning("Warning: %s: link status changed for uninitialized port on %s\n", |
2279 | "uninitialized port on %s\n", | ||
2280 | slave->dev->master->name, slave->dev->name); | 2298 | slave->dev->master->name, slave->dev->name); |
2281 | return; | 2299 | return; |
2282 | } | 2300 | } |
@@ -2381,8 +2399,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2381 | } | 2399 | } |
2382 | 2400 | ||
2383 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { | 2401 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { |
2384 | pr_debug(DRV_NAME ": %s: Error: " | 2402 | pr_debug("%s: Error: bond_3ad_get_active_agg_info failed\n", |
2385 | "bond_3ad_get_active_agg_info failed\n", dev->name); | 2403 | dev->name); |
2386 | goto out; | 2404 | goto out; |
2387 | } | 2405 | } |
2388 | 2406 | ||
@@ -2391,8 +2409,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2391 | 2409 | ||
2392 | if (slaves_in_agg == 0) { | 2410 | if (slaves_in_agg == 0) { |
2393 | /*the aggregator is empty*/ | 2411 | /*the aggregator is empty*/ |
2394 | pr_debug(DRV_NAME ": %s: Error: active aggregator is empty\n", | 2412 | pr_debug("%s: Error: active aggregator is empty\n", dev->name); |
2395 | dev->name); | ||
2396 | goto out; | 2413 | goto out; |
2397 | } | 2414 | } |
2398 | 2415 | ||
@@ -2410,8 +2427,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2410 | } | 2427 | } |
2411 | 2428 | ||
2412 | if (slave_agg_no >= 0) { | 2429 | if (slave_agg_no >= 0) { |
2413 | pr_err(DRV_NAME ": %s: Error: Couldn't find a slave to tx on " | 2430 | pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n", |
2414 | "for aggregator ID %d\n", dev->name, agg_id); | 2431 | dev->name, agg_id); |
2415 | goto out; | 2432 | goto out; |
2416 | } | 2433 | } |
2417 | 2434 | ||