aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
authorHolger Eitzenberger <holger@eitzenberger.org>2008-12-10 02:09:22 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-10 02:09:22 -0500
commit5a03cdb7f2d7ff88e50153d8c3b90a1d52dca435 (patch)
tree2cdaf63b0308afcf259625ea20439840c81d62e5 /drivers/net/bonding/bond_3ad.c
parentef65583d01f4060c758dba72f08edc09d8faa719 (diff)
bonding: use pr_debug instead of own macros
Use pr_debug() instead of own macros. Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org> 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.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 78f645d6471a..6f3655d3934f 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -20,8 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23//#define BONDING_DEBUG 1
24
25#include <linux/skbuff.h> 23#include <linux/skbuff.h>
26#include <linux/if_ether.h> 24#include <linux/if_ether.h>
27#include <linux/netdevice.h> 25#include <linux/netdevice.h>
@@ -381,7 +379,7 @@ static u16 __get_link_speed(struct port *port)
381 } 379 }
382 } 380 }
383 381
384 dprintk("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed); 382 pr_debug("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed);
385 return speed; 383 return speed;
386} 384}
387 385
@@ -407,12 +405,12 @@ static u8 __get_duplex(struct port *port)
407 switch (slave->duplex) { 405 switch (slave->duplex) {
408 case DUPLEX_FULL: 406 case DUPLEX_FULL:
409 retval=0x1; 407 retval=0x1;
410 dprintk("Port %d Received status full duplex update from adapter\n", port->actor_port_number); 408 pr_debug("Port %d Received status full duplex update from adapter\n", port->actor_port_number);
411 break; 409 break;
412 case DUPLEX_HALF: 410 case DUPLEX_HALF:
413 default: 411 default:
414 retval=0x0; 412 retval=0x0;
415 dprintk("Port %d Received status NOT full duplex update from adapter\n", port->actor_port_number); 413 pr_debug("Port %d Received status NOT full duplex update from adapter\n", port->actor_port_number);
416 break; 414 break;
417 } 415 }
418 } 416 }
@@ -1019,7 +1017,7 @@ static void ad_mux_machine(struct port *port)
1019 1017
1020 // check if the state machine was changed 1018 // check if the state machine was changed
1021 if (port->sm_mux_state != last_state) { 1019 if (port->sm_mux_state != last_state) {
1022 dprintk("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state); 1020 pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state);
1023 switch (port->sm_mux_state) { 1021 switch (port->sm_mux_state) {
1024 case AD_MUX_DETACHED: 1022 case AD_MUX_DETACHED:
1025 __detach_bond_from_agg(port); 1023 __detach_bond_from_agg(port);
@@ -1118,7 +1116,7 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1118 1116
1119 // check if the State machine was changed or new lacpdu arrived 1117 // check if the State machine was changed or new lacpdu arrived
1120 if ((port->sm_rx_state != last_state) || (lacpdu)) { 1118 if ((port->sm_rx_state != last_state) || (lacpdu)) {
1121 dprintk("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state); 1119 pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state);
1122 switch (port->sm_rx_state) { 1120 switch (port->sm_rx_state) {
1123 case AD_RX_INITIALIZE: 1121 case AD_RX_INITIALIZE:
1124 if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) { 1122 if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) {
@@ -1205,7 +1203,7 @@ static void ad_tx_machine(struct port *port)
1205 __update_lacpdu_from_port(port); 1203 __update_lacpdu_from_port(port);
1206 // send the lacpdu 1204 // send the lacpdu
1207 if (ad_lacpdu_send(port) >= 0) { 1205 if (ad_lacpdu_send(port) >= 0) {
1208 dprintk("Sent LACPDU on port %d\n", port->actor_port_number); 1206 pr_debug("Sent LACPDU on port %d\n", port->actor_port_number);
1209 // mark ntt as false, so it will not be sent again until demanded 1207 // mark ntt as false, so it will not be sent again until demanded
1210 port->ntt = 0; 1208 port->ntt = 0;
1211 } 1209 }
@@ -1278,7 +1276,7 @@ static void ad_periodic_machine(struct port *port)
1278 1276
1279 // check if the state machine was changed 1277 // check if the state machine was changed
1280 if (port->sm_periodic_state != last_state) { 1278 if (port->sm_periodic_state != last_state) {
1281 dprintk("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state); 1279 pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state);
1282 switch (port->sm_periodic_state) { 1280 switch (port->sm_periodic_state) {
1283 case AD_NO_PERIODIC: 1281 case AD_NO_PERIODIC:
1284 port->sm_periodic_timer_counter = 0; // zero timer 1282 port->sm_periodic_timer_counter = 0; // zero timer
@@ -1335,7 +1333,7 @@ static void ad_port_selection_logic(struct port *port)
1335 port->next_port_in_aggregator=NULL; 1333 port->next_port_in_aggregator=NULL;
1336 port->actor_port_aggregator_identifier=0; 1334 port->actor_port_aggregator_identifier=0;
1337 1335
1338 dprintk("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier); 1336 pr_debug("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier);
1339 // if the aggregator is empty, clear its parameters, and set it ready to be attached 1337 // if the aggregator is empty, clear its parameters, and set it ready to be attached
1340 if (!temp_aggregator->lag_ports) { 1338 if (!temp_aggregator->lag_ports) {
1341 ad_clear_agg(temp_aggregator); 1339 ad_clear_agg(temp_aggregator);
@@ -1378,7 +1376,7 @@ static void ad_port_selection_logic(struct port *port)
1378 port->next_port_in_aggregator=aggregator->lag_ports; 1376 port->next_port_in_aggregator=aggregator->lag_ports;
1379 port->aggregator->num_of_ports++; 1377 port->aggregator->num_of_ports++;
1380 aggregator->lag_ports=port; 1378 aggregator->lag_ports=port;
1381 dprintk("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); 1379 pr_debug("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
1382 1380
1383 // mark this port as selected 1381 // mark this port as selected
1384 port->sm_vars |= AD_PORT_SELECTED; 1382 port->sm_vars |= AD_PORT_SELECTED;
@@ -1415,7 +1413,7 @@ static void ad_port_selection_logic(struct port *port)
1415 // mark this port as selected 1413 // mark this port as selected
1416 port->sm_vars |= AD_PORT_SELECTED; 1414 port->sm_vars |= AD_PORT_SELECTED;
1417 1415
1418 dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); 1416 pr_debug("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
1419 } else { 1417 } else {
1420 printk(KERN_ERR DRV_NAME ": %s: Port %d (on %s) did not find a suitable aggregator\n", 1418 printk(KERN_ERR DRV_NAME ": %s: Port %d (on %s) did not find a suitable aggregator\n",
1421 port->slave->dev->master->name, 1419 port->slave->dev->master->name,
@@ -1574,19 +1572,19 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1574 1572
1575 // if there is new best aggregator, activate it 1573 // if there is new best aggregator, activate it
1576 if (best) { 1574 if (best) {
1577 dprintk("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", 1575 pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1578 best->aggregator_identifier, best->num_of_ports, 1576 best->aggregator_identifier, best->num_of_ports,
1579 best->actor_oper_aggregator_key, 1577 best->actor_oper_aggregator_key,
1580 best->partner_oper_aggregator_key, 1578 best->partner_oper_aggregator_key,
1581 best->is_individual, best->is_active); 1579 best->is_individual, best->is_active);
1582 dprintk("best ports %p slave %p %s\n", 1580 pr_debug("best ports %p slave %p %s\n",
1583 best->lag_ports, best->slave, 1581 best->lag_ports, best->slave,
1584 best->slave ? best->slave->dev->name : "NULL"); 1582 best->slave ? best->slave->dev->name : "NULL");
1585 1583
1586 for (agg = __get_first_agg(best->lag_ports); agg; 1584 for (agg = __get_first_agg(best->lag_ports); agg;
1587 agg = __get_next_agg(agg)) { 1585 agg = __get_next_agg(agg)) {
1588 1586
1589 dprintk("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", 1587 pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1590 agg->aggregator_identifier, agg->num_of_ports, 1588 agg->aggregator_identifier, agg->num_of_ports,
1591 agg->actor_oper_aggregator_key, 1589 agg->actor_oper_aggregator_key,
1592 agg->partner_oper_aggregator_key, 1590 agg->partner_oper_aggregator_key,
@@ -1602,9 +1600,9 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1602 } 1600 }
1603 1601
1604 best->is_active = 1; 1602 best->is_active = 1;
1605 dprintk("LAG %d chosen as the active LAG\n", 1603 pr_debug("LAG %d chosen as the active LAG\n",
1606 best->aggregator_identifier); 1604 best->aggregator_identifier);
1607 dprintk("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", 1605 pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1608 best->aggregator_identifier, best->num_of_ports, 1606 best->aggregator_identifier, best->num_of_ports,
1609 best->actor_oper_aggregator_key, 1607 best->actor_oper_aggregator_key,
1610 best->partner_oper_aggregator_key, 1608 best->partner_oper_aggregator_key,
@@ -1662,7 +1660,7 @@ static void ad_clear_agg(struct aggregator *aggregator)
1662 aggregator->lag_ports = NULL; 1660 aggregator->lag_ports = NULL;
1663 aggregator->is_active = 0; 1661 aggregator->is_active = 0;
1664 aggregator->num_of_ports = 0; 1662 aggregator->num_of_ports = 0;
1665 dprintk("LAG %d was cleared\n", aggregator->aggregator_identifier); 1663 pr_debug("LAG %d was cleared\n", aggregator->aggregator_identifier);
1666 } 1664 }
1667} 1665}
1668 1666
@@ -1747,7 +1745,7 @@ static void ad_initialize_port(struct port *port, int lacp_fast)
1747static void ad_enable_collecting_distributing(struct port *port) 1745static void ad_enable_collecting_distributing(struct port *port)
1748{ 1746{
1749 if (port->aggregator->is_active) { 1747 if (port->aggregator->is_active) {
1750 dprintk("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); 1748 pr_debug("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
1751 __enable_port(port); 1749 __enable_port(port);
1752 } 1750 }
1753} 1751}
@@ -1760,7 +1758,7 @@ static void ad_enable_collecting_distributing(struct port *port)
1760static void ad_disable_collecting_distributing(struct port *port) 1758static void ad_disable_collecting_distributing(struct port *port)
1761{ 1759{
1762 if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { 1760 if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) {
1763 dprintk("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); 1761 pr_debug("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
1764 __disable_port(port); 1762 __disable_port(port);
1765 } 1763 }
1766} 1764}
@@ -1798,7 +1796,7 @@ static void ad_marker_info_send(struct port *port)
1798 1796
1799 // send the marker information 1797 // send the marker information
1800 if (ad_marker_send(port, &marker) >= 0) { 1798 if (ad_marker_send(port, &marker) >= 0) {
1801 dprintk("Sent Marker Information on port %d\n", port->actor_port_number); 1799 pr_debug("Sent Marker Information on port %d\n", port->actor_port_number);
1802 } 1800 }
1803} 1801}
1804#endif 1802#endif
@@ -1822,7 +1820,7 @@ static void ad_marker_info_received(struct bond_marker *marker_info,
1822 // send the marker response 1820 // send the marker response
1823 1821
1824 if (ad_marker_send(port, &marker) >= 0) { 1822 if (ad_marker_send(port, &marker) >= 0) {
1825 dprintk("Sent Marker Response on port %d\n", port->actor_port_number); 1823 pr_debug("Sent Marker Response on port %d\n", port->actor_port_number);
1826 } 1824 }
1827} 1825}
1828 1826
@@ -2036,7 +2034,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
2036 return; 2034 return;
2037 } 2035 }
2038 2036
2039 dprintk("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier); 2037 pr_debug("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier);
2040 2038
2041 /* Tell the partner that this port is not suitable for aggregation */ 2039 /* Tell the partner that this port is not suitable for aggregation */
2042 port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; 2040 port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;
@@ -2060,7 +2058,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
2060 // if new aggregator found, copy the aggregator's parameters 2058 // if new aggregator found, copy the aggregator's parameters
2061 // and connect the related lag_ports to the new aggregator 2059 // and connect the related lag_ports to the new aggregator
2062 if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { 2060 if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
2063 dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); 2061 pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier);
2064 2062
2065 if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { 2063 if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {
2066 printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n", 2064 printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n",
@@ -2111,7 +2109,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
2111 } 2109 }
2112 } 2110 }
2113 2111
2114 dprintk("Unbinding port %d\n", port->actor_port_number); 2112 pr_debug("Unbinding port %d\n", port->actor_port_number);
2115 // find the aggregator that this port is connected to 2113 // find the aggregator that this port is connected to
2116 temp_aggregator = __get_first_agg(port); 2114 temp_aggregator = __get_first_agg(port);
2117 for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) { 2115 for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) {
@@ -2242,7 +2240,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2242 2240
2243 switch (lacpdu->subtype) { 2241 switch (lacpdu->subtype) {
2244 case AD_TYPE_LACPDU: 2242 case AD_TYPE_LACPDU:
2245 dprintk("Received LACPDU on port %d\n", port->actor_port_number); 2243 pr_debug("Received LACPDU on port %d\n", port->actor_port_number);
2246 ad_rx_machine(lacpdu, port); 2244 ad_rx_machine(lacpdu, port);
2247 break; 2245 break;
2248 2246
@@ -2251,17 +2249,17 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2251 2249
2252 switch (((struct bond_marker *)lacpdu)->tlv_type) { 2250 switch (((struct bond_marker *)lacpdu)->tlv_type) {
2253 case AD_MARKER_INFORMATION_SUBTYPE: 2251 case AD_MARKER_INFORMATION_SUBTYPE:
2254 dprintk("Received Marker Information on port %d\n", port->actor_port_number); 2252 pr_debug("Received Marker Information on port %d\n", port->actor_port_number);
2255 ad_marker_info_received((struct bond_marker *)lacpdu, port); 2253 ad_marker_info_received((struct bond_marker *)lacpdu, port);
2256 break; 2254 break;
2257 2255
2258 case AD_MARKER_RESPONSE_SUBTYPE: 2256 case AD_MARKER_RESPONSE_SUBTYPE:
2259 dprintk("Received Marker Response on port %d\n", port->actor_port_number); 2257 pr_debug("Received Marker Response on port %d\n", port->actor_port_number);
2260 ad_marker_response_received((struct bond_marker *)lacpdu, port); 2258 ad_marker_response_received((struct bond_marker *)lacpdu, port);
2261 break; 2259 break;
2262 2260
2263 default: 2261 default:
2264 dprintk("Received an unknown Marker subtype on slot %d\n", port->actor_port_number); 2262 pr_debug("Received an unknown Marker subtype on slot %d\n", port->actor_port_number);
2265 } 2263 }
2266 } 2264 }
2267 } 2265 }
@@ -2289,7 +2287,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave)
2289 2287
2290 port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; 2288 port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS;
2291 port->actor_oper_port_key=port->actor_admin_port_key |= (__get_link_speed(port) << 1); 2289 port->actor_oper_port_key=port->actor_admin_port_key |= (__get_link_speed(port) << 1);
2292 dprintk("Port %d changed speed\n", port->actor_port_number); 2290 pr_debug("Port %d changed speed\n", port->actor_port_number);
2293 // there is no need to reselect a new aggregator, just signal the 2291 // there is no need to reselect a new aggregator, just signal the
2294 // state machines to reinitialize 2292 // state machines to reinitialize
2295 port->sm_vars |= AD_PORT_BEGIN; 2293 port->sm_vars |= AD_PORT_BEGIN;
@@ -2317,7 +2315,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
2317 2315
2318 port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; 2316 port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS;
2319 port->actor_oper_port_key=port->actor_admin_port_key |= __get_duplex(port); 2317 port->actor_oper_port_key=port->actor_admin_port_key |= __get_duplex(port);
2320 dprintk("Port %d changed duplex\n", port->actor_port_number); 2318 pr_debug("Port %d changed duplex\n", port->actor_port_number);
2321 // there is no need to reselect a new aggregator, just signal the 2319 // there is no need to reselect a new aggregator, just signal the
2322 // state machines to reinitialize 2320 // state machines to reinitialize
2323 port->sm_vars |= AD_PORT_BEGIN; 2321 port->sm_vars |= AD_PORT_BEGIN;