aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-07-16 02:16:15 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-16 02:16:15 -0400
commit7a575f6b907ea5d207d2b5010293c189616eae34 (patch)
tree1945288ff37e2690be41a4e3c35e1e7e196f75b0
parenta84bc2a9013fb123deeca7283480955d021503fb (diff)
parentcb25235860c8b6552a8f9cca3291e9d46efb7925 (diff)
Merge branch 'bonding-next'
Veaceslav Falico says: ==================== bonding: convert pr_* to netdev_* Currently bonding uses pr_info/warn/etc. function to print something, while it's encouraged to use netdev_info/warn/etc. in net/. This patchset converts them where possible (i.e. where we have a working net_device). Also, convert pr_ratelimit* to net_() and remove the pr_fmt, to unify netdev_* and pr_* outputs. ==================== CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_3ad.c185
-rw-r--r--drivers/net/bonding/bond_alb.c36
-rw-r--r--drivers/net/bonding/bond_debugfs.c6
-rw-r--r--drivers/net/bonding/bond_main.c344
-rw-r--r--drivers/net/bonding/bond_netlink.c11
-rw-r--r--drivers/net/bonding/bond_options.c218
-rw-r--r--drivers/net/bonding/bond_procfs.c4
7 files changed, 373 insertions, 431 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 0dfeaf5da3f2..ee2c73a9de39 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 pr_fmt(fmt) KBUILD_MODNAME ": " fmt
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>
@@ -301,8 +299,8 @@ static u16 __get_link_speed(struct port *port)
301 } 299 }
302 } 300 }
303 301
304 pr_debug("Port %d Received link speed %d update from adapter\n", 302 netdev_dbg(slave->bond->dev, "Port %d Received link speed %d update from adapter\n",
305 port->actor_port_number, speed); 303 port->actor_port_number, speed);
306 return speed; 304 return speed;
307} 305}
308 306
@@ -329,14 +327,14 @@ static u8 __get_duplex(struct port *port)
329 switch (slave->duplex) { 327 switch (slave->duplex) {
330 case DUPLEX_FULL: 328 case DUPLEX_FULL:
331 retval = 0x1; 329 retval = 0x1;
332 pr_debug("Port %d Received status full duplex update from adapter\n", 330 netdev_dbg(slave->bond->dev, "Port %d Received status full duplex update from adapter\n",
333 port->actor_port_number); 331 port->actor_port_number);
334 break; 332 break;
335 case DUPLEX_HALF: 333 case DUPLEX_HALF:
336 default: 334 default:
337 retval = 0x0; 335 retval = 0x0;
338 pr_debug("Port %d Received status NOT full duplex update from adapter\n", 336 netdev_dbg(slave->bond->dev, "Port %d Received status NOT full duplex update from adapter\n",
339 port->actor_port_number); 337 port->actor_port_number);
340 break; 338 break;
341 } 339 }
342 } 340 }
@@ -1079,9 +1077,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1079 /* detect loopback situation */ 1077 /* detect loopback situation */
1080 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system), 1078 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
1081 &(port->actor_system))) { 1079 &(port->actor_system))) {
1082 pr_err("%s: An illegal loopback occurred on adapter (%s)\n" 1080 netdev_err(port->slave->bond->dev, "An illegal loopback occurred on adapter (%s)\n"
1083 "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", 1081 "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n",
1084 port->slave->bond->dev->name,
1085 port->slave->dev->name); 1082 port->slave->dev->name);
1086 return; 1083 return;
1087 } 1084 }
@@ -1269,9 +1266,9 @@ static void ad_port_selection_logic(struct port *port)
1269 port->next_port_in_aggregator = NULL; 1266 port->next_port_in_aggregator = NULL;
1270 port->actor_port_aggregator_identifier = 0; 1267 port->actor_port_aggregator_identifier = 0;
1271 1268
1272 pr_debug("Port %d left LAG %d\n", 1269 netdev_dbg(bond->dev, "Port %d left LAG %d\n",
1273 port->actor_port_number, 1270 port->actor_port_number,
1274 temp_aggregator->aggregator_identifier); 1271 temp_aggregator->aggregator_identifier);
1275 /* if the aggregator is empty, clear its 1272 /* if the aggregator is empty, clear its
1276 * parameters, and set it ready to be attached 1273 * parameters, and set it ready to be attached
1277 */ 1274 */
@@ -1284,11 +1281,11 @@ static void ad_port_selection_logic(struct port *port)
1284 /* meaning: the port was related to an aggregator 1281 /* meaning: the port was related to an aggregator
1285 * but was not on the aggregator port list 1282 * but was not on the aggregator port list
1286 */ 1283 */
1287 pr_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", 1284 net_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n",
1288 port->slave->bond->dev->name, 1285 port->slave->bond->dev->name,
1289 port->actor_port_number, 1286 port->actor_port_number,
1290 port->slave->dev->name, 1287 port->slave->dev->name,
1291 port->aggregator->aggregator_identifier); 1288 port->aggregator->aggregator_identifier);
1292 } 1289 }
1293 } 1290 }
1294 /* search on all aggregators for a suitable aggregator for this port */ 1291 /* search on all aggregators for a suitable aggregator for this port */
@@ -1318,9 +1315,9 @@ static void ad_port_selection_logic(struct port *port)
1318 port->next_port_in_aggregator = aggregator->lag_ports; 1315 port->next_port_in_aggregator = aggregator->lag_ports;
1319 port->aggregator->num_of_ports++; 1316 port->aggregator->num_of_ports++;
1320 aggregator->lag_ports = port; 1317 aggregator->lag_ports = port;
1321 pr_debug("Port %d joined LAG %d(existing LAG)\n", 1318 netdev_dbg(bond->dev, "Port %d joined LAG %d(existing LAG)\n",
1322 port->actor_port_number, 1319 port->actor_port_number,
1323 port->aggregator->aggregator_identifier); 1320 port->aggregator->aggregator_identifier);
1324 1321
1325 /* mark this port as selected */ 1322 /* mark this port as selected */
1326 port->sm_vars |= AD_PORT_SELECTED; 1323 port->sm_vars |= AD_PORT_SELECTED;
@@ -1363,12 +1360,11 @@ static void ad_port_selection_logic(struct port *port)
1363 /* mark this port as selected */ 1360 /* mark this port as selected */
1364 port->sm_vars |= AD_PORT_SELECTED; 1361 port->sm_vars |= AD_PORT_SELECTED;
1365 1362
1366 pr_debug("Port %d joined LAG %d(new LAG)\n", 1363 netdev_dbg(bond->dev, "Port %d joined LAG %d(new LAG)\n",
1367 port->actor_port_number, 1364 port->actor_port_number,
1368 port->aggregator->aggregator_identifier); 1365 port->aggregator->aggregator_identifier);
1369 } else { 1366 } else {
1370 pr_err("%s: Port %d (on %s) did not find a suitable aggregator\n", 1367 netdev_err(bond->dev, "Port %d (on %s) did not find a suitable aggregator\n",
1371 port->slave->bond->dev->name,
1372 port->actor_port_number, port->slave->dev->name); 1368 port->actor_port_number, port->slave->dev->name);
1373 } 1369 }
1374 } 1370 }
@@ -1445,9 +1441,9 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1445 break; 1441 break;
1446 1442
1447 default: 1443 default:
1448 pr_warn_ratelimited("%s: Impossible agg select mode %d\n", 1444 net_warn_ratelimited("%s: Impossible agg select mode %d\n",
1449 curr->slave->bond->dev->name, 1445 curr->slave->bond->dev->name,
1450 __get_agg_selection_mode(curr->lag_ports)); 1446 __get_agg_selection_mode(curr->lag_ports));
1451 break; 1447 break;
1452 } 1448 }
1453 1449
@@ -1539,40 +1535,40 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1539 1535
1540 /* if there is new best aggregator, activate it */ 1536 /* if there is new best aggregator, activate it */
1541 if (best) { 1537 if (best) {
1542 pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", 1538 netdev_dbg(bond->dev, "best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1543 best->aggregator_identifier, best->num_of_ports, 1539 best->aggregator_identifier, best->num_of_ports,
1544 best->actor_oper_aggregator_key, 1540 best->actor_oper_aggregator_key,
1545 best->partner_oper_aggregator_key, 1541 best->partner_oper_aggregator_key,
1546 best->is_individual, best->is_active); 1542 best->is_individual, best->is_active);
1547 pr_debug("best ports %p slave %p %s\n", 1543 netdev_dbg(bond->dev, "best ports %p slave %p %s\n",
1548 best->lag_ports, best->slave, 1544 best->lag_ports, best->slave,
1549 best->slave ? best->slave->dev->name : "NULL"); 1545 best->slave ? best->slave->dev-&