diff options
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 185 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 36 | ||||
-rw-r--r-- | drivers/net/bonding/bond_debugfs.c | 6 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 344 | ||||
-rw-r--r-- | drivers/net/bonding/bond_netlink.c | 11 | ||||
-rw-r--r-- | drivers/net/bonding/bond_options.c | 218 | ||||
-rw-r--r-- | drivers/net/bonding/bond_procfs.c | 4 |
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->name : "NULL"); |
1550 | 1546 | ||
1551 | bond_for_each_slave_rcu(bond, slave, iter) { | 1547 | bond_for_each_slave_rcu(bond, slave, iter) { |
1552 | agg = &(SLAVE_AD_INFO(slave)->aggregator); | 1548 | agg = &(SLAVE_AD_INFO(slave)->aggregator); |
1553 | 1549 | ||
1554 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1550 | netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1555 | agg->aggregator_identifier, agg->num_of_ports, | 1551 | agg->aggregator_identifier, agg->num_of_ports, |
1556 | agg->actor_oper_aggregator_key, | 1552 | agg->actor_oper_aggregator_key, |
1557 | agg->partner_oper_aggregator_key, | 1553 | agg->partner_oper_aggregator_key, |
1558 | agg->is_individual, agg->is_active); | 1554 | agg->is_individual, agg->is_active); |
1559 | } | 1555 | } |
1560 | 1556 | ||
1561 | /* check if any partner replys */ | 1557 | /* check if any partner replys */ |
1562 | if (best->is_individual) { | 1558 | if (best->is_individual) { |
1563 | pr_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", | 1559 | net_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", |
1564 | best->slave ? | 1560 | best->slave ? |
1565 | best->slave->bond->dev->name : "NULL"); | 1561 | best->slave->bond->dev->name : "NULL"); |
1566 | } | 1562 | } |
1567 | 1563 | ||
1568 | best->is_active = 1; | 1564 | best->is_active = 1; |
1569 | pr_debug("LAG %d chosen as the active LAG\n", | 1565 | netdev_dbg(bond->dev, "LAG %d chosen as the active LAG\n", |
1570 | best->aggregator_identifier); | 1566 | best->aggregator_identifier); |
1571 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1567 | netdev_dbg(bond->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1572 | best->aggregator_identifier, best->num_of_ports, | 1568 | best->aggregator_identifier, best->num_of_ports, |
1573 | best->actor_oper_aggregator_key, | 1569 | best->actor_oper_aggregator_key, |
1574 | best->partner_oper_aggregator_key, | 1570 | best->partner_oper_aggregator_key, |
1575 | best->is_individual, best->is_active); | 1571 | best->is_individual, best->is_active); |
1576 | 1572 | ||
1577 | /* disable the ports that were related to the former | 1573 | /* disable the ports that were related to the former |
1578 | * active_aggregator | 1574 | * active_aggregator |
@@ -1908,13 +1904,13 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1908 | 1904 | ||
1909 | /* if slave is null, the whole port is not initialized */ | 1905 | /* if slave is null, the whole port is not initialized */ |
1910 | if (!port->slave) { | 1906 | if (!port->slave) { |
1911 | pr_warn("Warning: %s: Trying to unbind an uninitialized port on %s\n", | 1907 | netdev_warn(bond->dev, "Trying to unbind an uninitialized port on %s\n", |
1912 | slave->bond->dev->name, slave->dev->name); | 1908 | slave->dev->name); |
1913 | return; | 1909 | return; |
1914 | } | 1910 | } |
1915 | 1911 | ||
1916 | pr_debug("Unbinding Link Aggregation Group %d\n", | 1912 | netdev_dbg(bond->dev, "Unbinding Link Aggregation Group %d\n", |
1917 | aggregator->aggregator_identifier); | 1913 | aggregator->aggregator_identifier); |
1918 | 1914 | ||
1919 | /* Tell the partner that this port is not suitable for aggregation */ | 1915 | /* Tell the partner that this port is not suitable for aggregation */ |
1920 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; | 1916 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; |
@@ -1949,14 +1945,13 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1949 | * new aggregator | 1945 | * new aggregator |
1950 | */ | 1946 | */ |
1951 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { | 1947 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { |
1952 | pr_debug("Some port(s) related to LAG %d - replacing with LAG %d\n", | 1948 | netdev_dbg(bond->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n", |
1953 | aggregator->aggregator_identifier, | 1949 | aggregator->aggregator_identifier, |
1954 | new_aggregator->aggregator_identifier); | 1950 | new_aggregator->aggregator_identifier); |
1955 | 1951 | ||
1956 | if ((new_aggregator->lag_ports == port) && | 1952 | if ((new_aggregator->lag_ports == port) && |
1957 | new_aggregator->is_active) { | 1953 | new_aggregator->is_active) { |
1958 | pr_info("%s: Removing an active aggregator\n", | 1954 | netdev_info(bond->dev, "Removing an active aggregator\n"); |
1959 | aggregator->slave->bond->dev->name); | ||
1960 | select_new_active_agg = 1; | 1955 | select_new_active_agg = 1; |
1961 | } | 1956 | } |
1962 | 1957 | ||
@@ -1986,8 +1981,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1986 | if (select_new_active_agg) | 1981 | if (select_new_active_agg) |
1987 | ad_agg_selection_logic(__get_first_agg(port)); | 1982 | ad_agg_selection_logic(__get_first_agg(port)); |
1988 | } else { | 1983 | } else { |
1989 | pr_warn("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n", | 1984 | netdev_warn(bond->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n"); |
1990 | slave->bond->dev->name); | ||
1991 | } | 1985 | } |
1992 | } else { | 1986 | } else { |
1993 | /* in case that the only port related to this | 1987 | /* in case that the only port related to this |
@@ -1996,8 +1990,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1996 | select_new_active_agg = aggregator->is_active; | 1990 | select_new_active_agg = aggregator->is_active; |
1997 | ad_clear_agg(aggregator); | 1991 | ad_clear_agg(aggregator); |
1998 | if (select_new_active_agg) { | 1992 | if (select_new_active_agg) { |
1999 | pr_info("%s: Removing an active aggregator\n", | 1993 | netdev_info(bond->dev, "Removing an active aggregator\n"); |
2000 | slave->bond->dev->name); | ||
2001 | /* select new active aggregator */ | 1994 | /* select new active aggregator */ |
2002 | temp_aggregator = __get_first_agg(port); | 1995 | temp_aggregator = __get_first_agg(port); |
2003 | if (temp_aggregator) | 1996 | if (temp_aggregator) |
@@ -2006,7 +1999,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2006 | } | 1999 | } |
2007 | } | 2000 | } |
2008 | 2001 | ||
2009 | pr_debug("Unbinding port %d\n", port->actor_port_number); | 2002 | netdev_dbg(bond->dev, "Unbinding port %d\n", port->actor_port_number); |
2010 | 2003 | ||
2011 | /* find the aggregator that this port is connected to */ | 2004 | /* find the aggregator that this port is connected to */ |
2012 | bond_for_each_slave(bond, slave_iter, iter) { | 2005 | bond_for_each_slave(bond, slave_iter, iter) { |
@@ -2029,8 +2022,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2029 | select_new_active_agg = temp_aggregator->is_active; | 2022 | select_new_active_agg = temp_aggregator->is_active; |
2030 | ad_clear_agg(temp_aggregator); | 2023 | ad_clear_agg(temp_aggregator); |
2031 | if (select_new_active_agg) { | 2024 | if (select_new_active_agg) { |
2032 | pr_info("%s: Removing an active aggregator\n", | 2025 | netdev_info(bond->dev, "Removing an active aggregator\n"); |
2033 | slave->bond->dev->name); | ||
2034 | /* select new active aggregator */ | 2026 | /* select new active aggregator */ |
2035 | ad_agg_selection_logic(__get_first_agg(port)); | 2027 | ad_agg_selection_logic(__get_first_agg(port)); |
2036 | } | 2028 | } |
@@ -2081,8 +2073,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2081 | /* select the active aggregator for the bond */ | 2073 | /* select the active aggregator for the bond */ |
2082 | if (port) { | 2074 | if (port) { |
2083 | if (!port->slave) { | 2075 | if (!port->slave) { |
2084 | pr_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n", | 2076 | net_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n", |
2085 | bond->dev->name); | 2077 | bond->dev->name); |
2086 | goto re_arm; | 2078 | goto re_arm; |
2087 | } | 2079 | } |
2088 | 2080 | ||
@@ -2096,7 +2088,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2096 | bond_for_each_slave_rcu(bond, slave, iter) { | 2088 | bond_for_each_slave_rcu(bond, slave, iter) { |
2097 | port = &(SLAVE_AD_INFO(slave)->port); | 2089 | port = &(SLAVE_AD_INFO(slave)->port); |
2098 | if (!port->slave) { | 2090 | if (!port->slave) { |
2099 | pr_warn_ratelimited("%s: Warning: Found an uninitialized port\n", | 2091 | net_warn_ratelimited("%s: Warning: Found an uninitialized port\n", |
2100 | bond->dev->name); | 2092 | bond->dev->name); |
2101 | goto re_arm; | 2093 | goto re_arm; |
2102 | } | 2094 | } |
@@ -2158,16 +2150,16 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, | |||
2158 | port = &(SLAVE_AD_INFO(slave)->port); | 2150 | port = &(SLAVE_AD_INFO(slave)->port); |
2159 | 2151 | ||
2160 | if (!port->slave) { | 2152 | if (!port->slave) { |
2161 | pr_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n", | 2153 | net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n", |
2162 | slave->dev->name, slave->bond->dev->name); | 2154 | slave->dev->name, slave->bond->dev->name); |
2163 | return ret; | 2155 | return ret; |
2164 | } | 2156 | } |
2165 | 2157 | ||
2166 | switch (lacpdu->subtype) { | 2158 | switch (lacpdu->subtype) { |
2167 | case AD_TYPE_LACPDU: | 2159 | case AD_TYPE_LACPDU: |
2168 | ret = RX_HANDLER_CONSUMED; | 2160 | ret = RX_HANDLER_CONSUMED; |
2169 | pr_debug("Received LACPDU on port %d\n", | 2161 | netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n", |
2170 | port->actor_port_number); | 2162 | port->actor_port_number); |
2171 | /* Protect against concurrent state machines */ | 2163 | /* Protect against concurrent state machines */ |
2172 | __get_state_machine_lock(port); | 2164 | __get_state_machine_lock(port); |
2173 | ad_rx_machine(lacpdu, port); | 2165 | ad_rx_machine(lacpdu, port); |
@@ -2182,20 +2174,20 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, | |||
2182 | 2174 | ||
2183 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2175 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
2184 | case AD_MARKER_INFORMATION_SUBTYPE: | 2176 | case AD_MARKER_INFORMATION_SUBTYPE: |
2185 | pr_debug("Received Marker Information on port %d\n", | 2177 | netdev_dbg(slave->bond->dev, "Received Marker Information on port %d\n", |
2186 | port->actor_port_number); | 2178 | port->actor_port_number); |
2187 | ad_marker_info_received((struct bond_marker *)lacpdu, port); | 2179 | ad_marker_info_received((struct bond_marker *)lacpdu, port); |
2188 | break; | 2180 | break; |
2189 | 2181 | ||
2190 | case AD_MARKER_RESPONSE_SUBTYPE: | 2182 | case AD_MARKER_RESPONSE_SUBTYPE: |
2191 | pr_debug("Received Marker Response on port %d\n", | 2183 | netdev_dbg(slave->bond->dev, "Received Marker Response on port %d\n", |
2192 | port->actor_port_number); | 2184 | port->actor_port_number); |
2193 | ad_marker_response_received((struct bond_marker *)lacpdu, port); | 2185 | ad_marker_response_received((struct bond_marker *)lacpdu, port); |
2194 | break; | 2186 | break; |
2195 | 2187 | ||
2196 | default: | 2188 | default: |
2197 | pr_debug("Received an unknown Marker subtype on slot %d\n", | 2189 | netdev_dbg(slave->bond->dev, "Received an unknown Marker subtype on slot %d\n", |
2198 | port->actor_port_number); | 2190 | port->actor_port_number); |
2199 | } | 2191 | } |
2200 | } | 2192 | } |
2201 | } | 2193 | } |
@@ -2216,8 +2208,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) | |||
2216 | 2208 | ||
2217 | /* if slave is null, the whole port is not initialized */ | 2209 | /* if slave is null, the whole port is not initialized */ |
2218 | if (!port->slave) { | 2210 | if (!port->slave) { |
2219 | pr_warn("Warning: %s: speed changed for uninitialized port on %s\n", | 2211 | netdev_warn(slave->bond->dev, "speed changed for uninitialized port on %s\n", |
2220 | slave->bond->dev->name, slave->dev->name); | 2212 | slave->dev->name); |
2221 | return; | 2213 | return; |
2222 | } | 2214 | } |
2223 | 2215 | ||
@@ -2226,7 +2218,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) | |||
2226 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; | 2218 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; |
2227 | port->actor_oper_port_key = port->actor_admin_port_key |= | 2219 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2228 | (__get_link_speed(port) << 1); | 2220 | (__get_link_speed(port) << 1); |
2229 | pr_debug("Port %d changed speed\n", port->actor_port_number); | 2221 | netdev_dbg(slave->bond->dev, "Port %d changed speed\n", port->actor_port_number); |
2230 | /* there is no need to reselect a new aggregator, just signal the | 2222 | /* there is no need to reselect a new aggregator, just signal the |
2231 | * state machines to reinitialize | 2223 | * state machines to reinitialize |
2232 | */ | 2224 | */ |
@@ -2249,8 +2241,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2249 | 2241 | ||
2250 | /* if slave is null, the whole port is not initialized */ | 2242 | /* if slave is null, the whole port is not initialized */ |
2251 | if (!port->slave) { | 2243 | if (!port->slave) { |
2252 | pr_warn("%s: Warning: duplex changed for uninitialized port on %s\n", | 2244 | netdev_warn(slave->bond->dev, "duplex changed for uninitialized port on %s\n", |
2253 | slave->bond->dev->name, slave->dev->name); | 2245 | slave->dev->name); |
2254 | return; | 2246 | return; |
2255 | } | 2247 | } |
2256 | 2248 | ||
@@ -2259,7 +2251,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2259 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; | 2251 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; |
2260 | port->actor_oper_port_key = port->actor_admin_port_key |= | 2252 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2261 | __get_duplex(port); | 2253 | __get_duplex(port); |
2262 | pr_debug("Port %d changed duplex\n", port->actor_port_number); | 2254 | netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number); |
2263 | /* there is no need to reselect a new aggregator, just signal the | 2255 | /* there is no need to reselect a new aggregator, just signal the |
2264 | * state machines to reinitialize | 2256 | * state machines to reinitialize |
2265 | */ | 2257 | */ |
@@ -2283,8 +2275,8 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) | |||
2283 | 2275 | ||
2284 | /* if slave is null, the whole port is not initialized */ | 2276 | /* if slave is null, the whole port is not initialized */ |
2285 | if (!port->slave) { | 2277 | if (!port->slave) { |
2286 | pr_warn("Warning: %s: link status changed for uninitialized port on %s\n", | 2278 | netdev_warn(slave->bond->dev, "link status changed for uninitialized port on %s\n", |
2287 | slave->bond->dev->name, slave->dev->name); | 2279 | slave->dev->name); |
2288 | return; | 2280 | return; |
2289 | } | 2281 | } |
2290 | 2282 | ||
@@ -2311,9 +2303,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) | |||
2311 | port->actor_oper_port_key = (port->actor_admin_port_key &= | 2303 | port->actor_oper_port_key = (port->actor_admin_port_key &= |
2312 | ~AD_SPEED_KEY_BITS); | 2304 | ~AD_SPEED_KEY_BITS); |
2313 | } | 2305 | } |
2314 | pr_debug("Port %d changed link status to %s\n", | 2306 | netdev_dbg(slave->bond->dev, "Port %d changed link status to %s\n", |
2315 | port->actor_port_number, | 2307 | port->actor_port_number, |
2316 | link == BOND_LINK_UP ? "UP" : "DOWN"); | 2308 | link == BOND_LINK_UP ? "UP" : "DOWN"); |
2317 | /* there is no need to reselect a new aggregator, just signal the | 2309 | /* there is no need to reselect a new aggregator, just signal the |
2318 | * state machines to reinitialize | 2310 | * state machines to reinitialize |
2319 | */ | 2311 | */ |
@@ -2427,8 +2419,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2427 | int agg_id; | 2419 | int agg_id; |
2428 | 2420 | ||
2429 | if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { | 2421 | if (__bond_3ad_get_active_agg_info(bond, &ad_info)) { |
2430 | pr_debug("%s: Error: __bond_3ad_get_active_agg_info failed\n", | 2422 | netdev_dbg(dev, "__bond_3ad_get_active_agg_info failed\n"); |
2431 | dev->name); | ||
2432 | goto err_free; | 2423 | goto err_free; |
2433 | } | 2424 | } |
2434 | 2425 | ||
@@ -2436,7 +2427,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2436 | agg_id = ad_info.aggregator_id; | 2427 | agg_id = ad_info.aggregator_id; |
2437 | 2428 | ||
2438 | if (slaves_in_agg == 0) { | 2429 | if (slaves_in_agg == 0) { |
2439 | pr_debug("%s: Error: active aggregator is empty\n", dev->name); | 2430 | netdev_dbg(dev, "active aggregator is empty\n"); |
2440 | goto err_free; | 2431 | goto err_free; |
2441 | } | 2432 | } |
2442 | 2433 | ||
@@ -2462,8 +2453,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2462 | } | 2453 | } |
2463 | 2454 | ||
2464 | if (slave_agg_no >= 0) { | 2455 | if (slave_agg_no >= 0) { |
2465 | pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n", | 2456 | netdev_err(dev, "Couldn't find a slave to tx on for aggregator ID %d\n", |
2466 | dev->name, agg_id); | 2457 | agg_id); |
2467 | goto err_free; | 2458 | goto err_free; |
2468 | } | 2459 | } |
2469 | 2460 | ||
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index de5bd03925b4..f16442fa97ff 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -19,8 +19,6 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
24 | #include <linux/skbuff.h> | 22 | #include <linux/skbuff.h> |
25 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
26 | #include <linux/etherdevice.h> | 24 | #include <linux/etherdevice.h> |
@@ -369,7 +367,7 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond, | |||
369 | if (arp->op_code == htons(ARPOP_REPLY)) { | 367 | if (arp->op_code == htons(ARPOP_REPLY)) { |
370 | /* update rx hash table for this ARP */ | 368 | /* update rx hash table for this ARP */ |
371 | rlb_update_entry_from_arp(bond, arp); | 369 | rlb_update_entry_from_arp(bond, arp); |
372 | pr_debug("Server received an ARP Reply from client\n"); | 370 | netdev_dbg(bond->dev, "Server received an ARP Reply from client\n"); |
373 | } | 371 | } |
374 | out: | 372 | out: |
375 | return RX_HANDLER_ANOTHER; | 373 | return RX_HANDLER_ANOTHER; |
@@ -535,8 +533,8 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
535 | client_info->slave->dev->dev_addr, | 533 | client_info->slave->dev->dev_addr, |
536 | client_info->mac_dst); | 534 | client_info->mac_dst); |
537 | if (!skb) { | 535 | if (!skb) { |
538 | pr_err("%s: Error: failed to create an ARP packet\n", | 536 | netdev_err(client_info->slave->bond->dev, |
539 | client_info->slave->bond->dev->name); | 537 | "failed to create an ARP packet\n"); |
540 | continue; | 538 | continue; |
541 | } | 539 | } |
542 | 540 | ||
@@ -545,8 +543,8 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
545 | if (client_info->vlan_id) { | 543 | if (client_info->vlan_id) { |
546 | skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id); | 544 | skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id); |
547 | if (!skb) { | 545 | if (!skb) { |
548 | pr_err("%s: Error: failed to insert VLAN tag\n", | 546 | netdev_err(client_info->slave->bond->dev, |
549 | client_info->slave->bond->dev->name); | 547 | "failed to insert VLAN tag\n"); |
550 | continue; | 548 | continue; |
551 | } | 549 | } |
552 | } | 550 | } |
@@ -630,8 +628,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) | |||
630 | client_info = &(bond_info->rx_hashtbl[hash_index]); | 628 | client_info = &(bond_info->rx_hashtbl[hash_index]); |
631 | 629 | ||
632 | if (!client_info->slave) { | 630 | if (!client_info->slave) { |
633 | pr_err("%s: Error: found a client with no channel in the client's hash table\n", | 631 | netdev_err(bond->dev, "found a client with no channel in the client's hash table\n"); |
634 | bond->dev->name); | ||
635 | continue; | 632 | continue; |
636 | } | 633 | } |
637 | /*update all clients using this src_ip, that are not assigned | 634 | /*update all clients using this src_ip, that are not assigned |
@@ -767,7 +764,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) | |||
767 | tx_slave = rlb_choose_channel(skb, bond); | 764 | tx_slave = rlb_choose_channel(skb, bond); |
768 | if (tx_slave) | 765 | if (tx_slave) |
769 | ether_addr_copy(arp->mac_src, tx_slave->dev->dev_addr); | 766 | ether_addr_copy(arp->mac_src, tx_slave->dev->dev_addr); |
770 | pr_debug("Server sent ARP Reply packet\n"); | 767 | netdev_dbg(bond->dev, "Server sent ARP Reply packet\n"); |
771 | } else if (arp->op_code == htons(ARPOP_REQUEST)) { | 768 | } else if (arp->op_code == htons(ARPOP_REQUEST)) { |
772 | /* Create an entry in the rx_hashtbl for this client as a | 769 | /* Create an entry in the rx_hashtbl for this client as a |
773 | * place holder. | 770 | * place holder. |
@@ -787,7 +784,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) | |||
787 | * updated with their assigned mac. | 784 | * updated with their assigned mac. |
788 | */ | 785 | */ |
789 | rlb_req_update_subnet_clients(bond, arp->ip_src); | 786 | rlb_req_update_subnet_clients(bond, arp->ip_src); |
790 | pr_debug("Server sent ARP Request packet\n"); | 787 | netdev_dbg(bond->dev, "Server sent ARP Request packet\n"); |
791 | } | 788 | } |
792 | 789 | ||
793 | return tx_slave; | 790 | return tx_slave; |
@@ -1026,8 +1023,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], | |||
1026 | if (vid) { | 1023 | if (vid) { |
1027 | skb = vlan_put_tag(skb, vlan_proto, vid); | 1024 | skb = vlan_put_tag(skb, vlan_proto, vid); |
1028 | if (!skb) { | 1025 | if (!skb) { |
1029 | pr_err("%s: Error: failed to insert VLAN tag\n", | 1026 | netdev_err(slave->bond->dev, "failed to insert VLAN tag\n"); |
1030 | slave->bond->dev->name); | ||
1031 | return; | 1027 | return; |
1032 | } | 1028 | } |
1033 | } | 1029 | } |
@@ -1093,9 +1089,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[]) | |||
1093 | memcpy(s_addr.sa_data, addr, dev->addr_len); | 1089 | memcpy(s_addr.sa_data, addr, dev->addr_len); |
1094 | s_addr.sa_family = dev->type; | 1090 | s_addr.sa_family = dev->type; |
1095 | if (dev_set_mac_address(dev, &s_addr)) { | 1091 | if (dev_set_mac_address(dev, &s_addr)) { |
1096 | pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n" | 1092 | netdev_err(slave->bond->dev, "dev_set_mac_address of dev %s failed! ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", |
1097 | "ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", | 1093 | dev->name); |
1098 | slave->bond->dev->name, dev->name); | ||
1099 | return -EOPNOTSUPP; | 1094 | return -EOPNOTSUPP; |
1100 | } | 1095 | } |
1101 | return 0; | 1096 | return 0; |
@@ -1269,13 +1264,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1269 | if (free_mac_slave) { | 1264 | if (free_mac_slave) { |
1270 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr); | 1265 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr); |
1271 | 1266 | ||
1272 | pr_warn("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", | 1267 | netdev_warn(bond->dev, "the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", |
1273 | bond->dev->name, slave->dev->name, | 1268 | slave->dev->name, free_mac_slave->dev->name); |
1274 | free_mac_slave->dev->name); | ||
1275 | 1269 | ||
1276 | } else if (has_bond_addr) { | 1270 | } else if (has_bond_addr) { |
1277 | 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", | 1271 | netdev_err(bond->dev, "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", |
1278 | bond->dev->name, slave->dev->name); | 1272 | slave->dev->name); |
1279 | return -EFAULT; | 1273 | return -EFAULT; |
1280 | } | 1274 | } |
1281 | 1275 | ||
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 658e761c4568..280971b227ea 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c | |||
@@ -69,8 +69,7 @@ void bond_debug_register(struct bonding *bond) | |||
69 | debugfs_create_dir(bond->dev->name, bonding_debug_root); | 69 | debugfs_create_dir(bond->dev->name, bonding_debug_root); |
70 | 70 | ||
71 | if (!bond->debug_dir) { | 71 | if (!bond->debug_dir) { |
72 | pr_warn("%s: Warning: failed to register to debugfs\n", | 72 | netdev_warn(bond->dev, "failed to register to debugfs\n"); |
73 | bond->dev->name); | ||
74 | return; | 73 | return; |
75 | } | 74 | } |
76 | 75 | ||
@@ -98,8 +97,7 @@ void bond_debug_reregister(struct bonding *bond) | |||
98 | if (d) { | 97 | if (d) { |
99 | bond->debug_dir = d; | 98 | bond->debug_dir = d; |
100 | } else { | 99 | } else { |
101 | pr_warn("%s: Warning: failed to reregister, so just unregister old one\n", | 100 | netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); |
102 | bond->dev->name); | ||
103 | bond_debug_unregister(bond); | 101 | bond_debug_unregister(bond); |
104 | } | 102 | } |
105 | } | 103 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d643807a8e6a..041036e31aa3 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -31,8 +31,6 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
35 | |||
36 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
37 | #include <linux/module.h> | 35 | #include <linux/module.h> |
38 | #include <linux/types.h> | 36 | #include <linux/types.h> |
@@ -629,8 +627,8 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, | |||
629 | static void bond_set_dev_addr(struct net_device *bond_dev, | 627 | static void bond_set_dev_addr(struct net_device *bond_dev, |
630 | struct net_device *slave_dev) | 628 | struct net_device *slave_dev) |
631 | { | 629 | { |
632 | pr_debug("bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", | 630 | netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", |
633 | bond_dev, slave_dev, slave_dev->addr_len); | 631 | bond_dev, slave_dev, slave_dev->addr_len); |
634 | memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); | 632 | memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); |
635 | bond_dev->addr_assign_type = NET_ADDR_STOLEN; | 633 | bond_dev->addr_assign_type = NET_ADDR_STOLEN; |
636 | call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev); | 634 | call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev); |
@@ -684,8 +682,8 @@ static void bond_do_fail_over_mac(struct bonding *bond, | |||
684 | 682 | ||
685 | rv = dev_set_mac_address(new_active->dev, &saddr); | 683 | rv = dev_set_mac_address(new_active->dev, &saddr); |
686 | if (rv) { | 684 | if (rv) { |
687 | pr_err("%s: Error %d setting MAC of slave %s\n", | 685 | netdev_err(bond->dev, "Error %d setting MAC of slave %s\n", |
688 | bond->dev->name, -rv, new_active->dev->name); | 686 | -rv, new_active->dev->name); |
689 | goto out; | 687 | goto out; |
690 | } | 688 | } |
691 | 689 | ||
@@ -697,14 +695,14 @@ static void bond_do_fail_over_mac(struct bonding *bond, | |||
697 | 695 | ||
698 | rv = dev_set_mac_address(old_active->dev, &saddr); | 696 | rv = dev_set_mac_address(old_active->dev, &saddr); |
699 | if (rv) | 697 | if (rv) |
700 | pr_err("%s: Error %d setting MAC of slave %s\n", | 698 | netdev_err(bond->dev, "Error %d setting MAC of slave %s\n", |
701 | bond->dev->name, -rv, new_active->dev->name); | 699 | -rv, new_active->dev->name); |
702 | out: | 700 | out: |
703 | write_lock_bh(&bond->curr_slave_lock); | 701 | write_lock_bh(&bond->curr_slave_lock); |
704 | break; | 702 | break; |
705 | default: | 703 | default: |
706 | pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n", | 704 | netdev_err(bond->dev, "bond_do_fail_over_mac impossible: bad policy %d\n", |
707 | bond->dev->name, bond->params.fail_over_mac); | 705 | bond->params.fail_over_mac); |
708 | break; | 706 | break; |
709 | } | 707 | } |
710 | 708 | ||
@@ -765,8 +763,8 @@ static bool bond_should_notify_peers(struct bonding *bond) | |||
765 | slave = rcu_dereference(bond->curr_active_slave); | 763 | slave = rcu_dereference(bond->curr_active_slave); |
766 | rcu_read_unlock(); | 764 | rcu_read_unlock(); |
767 | 765 | ||
768 | pr_debug("bond_should_notify_peers: bond %s slave %s\n", | 766 | netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n", |
769 | bond->dev->name, slave ? slave->dev->name : "NULL"); | 767 | slave ? slave->dev->name : "NULL"); |
770 | 768 | ||
771 | if (!slave || !bond->send_peer_notif || | 769 | if (!slave || !bond->send_peer_notif || |
772 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) | 770 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) |
@@ -806,9 +804,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
806 | 804 | ||
807 | if (new_active->link == BOND_LINK_BACK) { | 805 | if (new_active->link == BOND_LINK_BACK) { |
808 | if (bond_uses_primary(bond)) { | 806 | if (bond_uses_primary(bond)) { |
809 | pr_info("%s: making interface %s the new active one %d ms earlier\n", | 807 | netdev_info(bond->dev, "making interface %s the new active one %d ms earlier\n", |
810 | bond->dev->name, new_active->dev->name, | 808 | new_active->dev->name, |
811 | (bond->params.updelay - new_active->delay) * bond->params.miimon); | 809 | (bond->params.updelay - new_active->delay) * bond->params.miimon); |
812 | } | 810 | } |
813 | 811 | ||
814 | new_active->delay = 0; | 812 | new_active->delay = 0; |
@@ -821,8 +819,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
821 | bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); | 819 | bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); |
822 | } else { | 820 | } else { |
823 | if (bond_uses_primary(bond)) { | 821 | if (bond_uses_primary(bond)) { |
824 | pr_info("%s: making interface %s the new active one\n", | 822 | netdev_info(bond->dev, "making interface %s the new active one\n", |
825 | bond->dev->name, new_active->dev->name); | 823 | new_active->dev->name); |
826 | } | 824 | } |
827 | } | 825 | } |
828 | } | 826 | } |
@@ -911,11 +909,9 @@ void bond_select_active_slave(struct bonding *bond) | |||
911 | return; | 909 | return; |
912 | 910 | ||
913 | if (netif_carrier_ok(bond->dev)) { | 911 | if (netif_carrier_ok(bond->dev)) { |
914 | pr_info("%s: first active interface up!\n", | 912 | netdev_info(bond->dev, "first active interface up!\n"); |
915 | bond->dev->name); | ||
916 | } else { | 913 | } else { |
917 | pr_info("%s: now running without any active interface!\n", | 914 | netdev_info(bond->dev, "now running without any active interface!\n"); |
918 | bond->dev->name); | ||
919 | } | 915 | } |
920 | } | 916 | } |
921 | } | 917 | } |
@@ -1212,36 +1208,38 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1212 | if (!bond->params.use_carrier && | 1208 | if (!bond->params.use_carrier && |
1213 | slave_dev->ethtool_ops->get_link == NULL && | 1209 | slave_dev->ethtool_ops->get_link == NULL && |
1214 | slave_ops->ndo_do_ioctl == NULL) { | 1210 | slave_ops->ndo_do_ioctl == NULL) { |
1215 | pr_warn("%s: Warning: no link monitoring support for %s\n", | 1211 | netdev_warn(bond_dev, "no link monitoring support for %s\n", |
1216 | bond_dev->name, slave_dev->name); | 1212 | slave_dev->name); |
1217 | } | 1213 | } |
1218 | 1214 | ||
1219 | /* already enslaved */ | 1215 | /* already enslaved */ |
1220 | if (slave_dev->flags & IFF_SLAVE) { | 1216 | if (slave_dev->flags & IFF_SLAVE) { |
1221 | pr_debug("Error: Device was already enslaved\n"); | 1217 | netdev_dbg(bond_dev, "Error: Device was already enslaved\n"); |
1222 | return -EBUSY; | 1218 | return -EBUSY; |
1223 | } | 1219 | } |
1224 | 1220 | ||
1225 | if (bond_dev == slave_dev) { | 1221 | if (bond_dev == slave_dev) { |
1226 | pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name); | 1222 | netdev_err(bond_dev, "cannot enslave bond to itself.\n"); |
1227 | return -EPERM; | 1223 | return -EPERM; |
1228 | } | 1224 | } |
1229 | 1225 | ||
1230 | /* vlan challenged mutual exclusion */ | 1226 | /* vlan challenged mutual exclusion */ |
1231 | /* no need to lock since we're protected by rtnl_lock */ | 1227 | /* no need to lock since we're protected by rtnl_lock */ |
1232 | if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { | 1228 | if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { |
1233 | pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); | 1229 | netdev_dbg(bond_dev, "%s is NETIF_F_VLAN_CHALLENGED\n", |
1230 | slave_dev->name); | ||
1234 | if (vlan_uses_dev(bond_dev)) { | 1231 | if (vlan_uses_dev(bond_dev)) { |
1235 | pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n", | 1232 | netdev_err(bond_dev, "Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n", |
1236 | bond_dev->name, slave_dev->name, bond_dev->name); | 1233 | slave_dev->name, bond_dev->name); |
1237 | return -EPERM; | 1234 | return -EPERM; |
1238 | } else { | 1235 | } else { |
1239 | pr_warn("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", | 1236 | netdev_warn(bond_dev, "enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", |
1240 | bond_dev->name, slave_dev->name, | 1237 | slave_dev->name, slave_dev->name, |
1241 | slave_dev->name, bond_dev->name); | 1238 | bond_dev->name); |
1242 | } | 1239 | } |
1243 | } else { | 1240 | } else { |
1244 | pr_debug("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); | 1241 | netdev_dbg(bond_dev, "%s is !NETIF_F_VLAN_CHALLENGED\n", |
1242 | slave_dev->name); | ||
1245 | } | 1243 | } |
1246 | 1244 | ||
1247 | /* | 1245 | /* |
@@ -1251,8 +1249,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1251 | * enslaving it; the old ifenslave will not. | 1249 | * enslaving it; the old ifenslave will not. |
1252 | */ | 1250 | */ |
1253 | if ((slave_dev->flags & IFF_UP)) { | 1251 | if ((slave_dev->flags & IFF_UP)) { |
1254 | pr_err("%s is up - this may be due to an out of date ifenslave\n", | 1252 | netdev_err(bond_dev, "%s is up - this may be due to an out of date ifenslave\n", |
1255 | slave_dev->name); | 1253 | slave_dev->name); |
1256 | res = -EPERM; | 1254 | res = -EPERM; |
1257 | goto err_undo_flags; | 1255 | goto err_undo_flags; |
1258 | } | 1256 | } |
@@ -1266,16 +1264,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1266 | */ | 1264 | */ |
1267 | if (!bond_has_slaves(bond)) { | 1265 | if (!bond_has_slaves(bond)) { |
1268 | if (bond_dev->type != slave_dev->type) { | 1266 | if (bond_dev->type != slave_dev->type) { |
1269 | pr_debug("%s: change device type from %d to %d\n", | 1267 | netdev_dbg(bond_dev, "change device type from %d to %d\n", |
1270 | bond_dev->name, | 1268 | bond_dev->type, slave_dev->type); |
1271 | bond_dev->type, slave_dev->type); | ||
1272 | 1269 | ||
1273 | res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, | 1270 | res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, |
1274 | bond_dev); | 1271 | bond_dev); |
1275 | res = notifier_to_errno(res); | 1272 | res = notifier_to_errno(res); |
1276 | if (res) { | 1273 | if (res) { |
1277 | pr_err("%s: refused to change device type\n", | 1274 | netdev_err(bond_dev, "refused to change device type\n"); |
1278 | bond_dev->name); | ||
1279 | res = -EBUSY; | 1275 | res = -EBUSY; |
1280 | goto err_undo_flags; | 1276 | goto err_undo_flags; |
1281 | } | 1277 | } |
@@ -1295,24 +1291,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1295 | bond_dev); | 1291 | bond_dev); |
1296 | } | 1292 | } |
1297 | } else if (bond_dev->type != slave_dev->type) { | 1293 | } else if (bond_dev->type != slave_dev->type) { |
1298 | pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it\n", | 1294 | netdev_err(bond_dev, "%s ether type (%d) is different from other slaves (%d), can not enslave it\n", |
1299 | slave_dev->name, slave_dev->type, bond_dev->type); | 1295 | slave_dev->name, slave_dev->type, bond_dev->type); |
1300 | res = -EINVAL; | 1296 | res = -EINVAL; |
1301 | goto err_undo_flags; | 1297 | goto err_undo_flags; |
1302 | } | 1298 | } |
1303 | 1299 | ||
1304 | if (slave_ops->ndo_set_mac_address == NULL) { | 1300 | if (slave_ops->ndo_set_mac_address == NULL) { |
1305 | pr_warn("%s: Warning: The slave device specified does not support setting the MAC address\n", | 1301 | netdev_warn(bond_dev, "The slave device specified does not support setting the MAC address\n"); |
1306 | bond_dev->name); | ||
1307 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && | 1302 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && |
1308 | bond->params.fail_over_mac != BOND_FOM_ACTIVE) { | 1303 | bond->params.fail_over_mac != BOND_FOM_ACTIVE) { |
1309 | if (!bond_has_slaves(bond)) { | 1304 | if (!bond_has_slaves(bond)) { |
1310 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; | 1305 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; |
1311 | pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", | 1306 | netdev_warn(bond_dev, "Setting fail_over_mac to active for active-backup mode\n"); |
1312 | bond_dev->name); | ||
1313 | } else { | 1307 | } else { |
1314 | 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", | 1308 | netdev_err(bond_dev, "The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active\n"); |
1315 | bond_dev->name); | ||
1316 | res = -EOPNOTSUPP; | 1309 | res = -EOPNOTSUPP; |
1317 | goto err_undo_flags; | 1310 | goto err_undo_flags; |
1318 | } | 1311 | } |
@@ -1345,7 +1338,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1345 | new_slave->original_mtu = slave_dev->mtu; | 1338 | new_slave->original_mtu = slave_dev->mtu; |
1346 | res = dev_set_mtu(slave_dev, bond->dev->mtu); | 1339 | res = dev_set_mtu(slave_dev, bond->dev->mtu); |
1347 | if (res) { | 1340 | if (res) { |
1348 | pr_debug("Error %d calling dev_set_mtu\n", res); | 1341 | netdev_dbg(bond_dev, "Error %d calling dev_set_mtu\n", res); |
1349 | goto err_free; | 1342 | goto err_free; |
1350 | } | 1343 | } |
1351 | 1344 | ||
@@ -1366,7 +1359,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1366 | addr.sa_family = slave_dev->type; | 1359 | addr.sa_family = slave_dev->type; |
1367 | res = dev_set_mac_address(slave_dev, &addr); | 1360 | res = dev_set_mac_address(slave_dev, &addr); |
1368 | if (res) { | 1361 | if (res) { |
1369 | pr_debug("Error %d calling set_mac_address\n", res); | 1362 | netdev_dbg(bond_dev, "Error %d calling set_mac_address\n", res); |
1370 | goto err_restore_mtu; | 1363 | goto err_restore_mtu; |
1371 | } | 1364 | } |
1372 | } | 1365 | } |
@@ -1374,7 +1367,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1374 | /* open the slave since the application closed it */ | 1367 | /* open the slave since the application closed it */ |
1375 | res = dev_open(slave_dev); | 1368 | res = dev_open(slave_dev); |
1376 | if (res) { | 1369 | if (res) { |
1377 | pr_debug("Opening slave %s failed\n", slave_dev->name); | 1370 | netdev_dbg(bond_dev, "Opening slave %s failed\n", slave_dev->name); |
1378 | goto err_restore_mac; | 1371 | goto err_restore_mac; |
1379 | } | 1372 | } |
1380 | 1373 | ||
@@ -1424,8 +1417,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1424 | 1417 | ||
1425 | res = vlan_vids_add_by_dev(slave_dev, bond_dev); | 1418 | res = vlan_vids_add_by_dev(slave_dev, bond_dev); |
1426 | if (res) { | 1419 | if (res) { |
1427 | pr_err("%s: Error: Couldn't add bond vlan ids to %s\n", | 1420 | netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n", |
1428 | bond_dev->name, slave_dev->name); | 1421 | slave_dev->name); |
1429 | goto err_close; | 1422 | goto err_close; |
1430 | } | 1423 | } |
1431 | 1424 | ||
@@ -1454,12 +1447,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1454 | * supported); thus, we don't need to change | 1447 | * supported); thus, we don't need to change |
1455 | * the messages for netif_carrier. | 1448 | * the messages for netif_carrier. |
1456 | */ | 1449 | */ |
1457 | pr_warn("%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", | 1450 | netdev_warn(bond_dev, "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", |
1458 | bond_dev->name, slave_dev->name); | 1451 | slave_dev->name); |
1459 | } else if (link_reporting == -1) { | 1452 | } else if (link_reporting == -1) { |
1460 | /* unable get link status using mii/ethtool */ | 1453 | /* unable get link status using mii/ethtool */ |
1461 | pr_warn("%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", | 1454 | netdev_warn(bond_dev, "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", |
1462 | bond_dev->name, slave_dev->name); | 1455 | slave_dev->name); |
1463 | } | 1456 | } |
1464 | } | 1457 | } |
1465 | 1458 | ||
@@ -1484,9 +1477,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1484 | 1477 | ||
1485 | if (new_slave->link != BOND_LINK_DOWN) | 1478 | if (new_slave->link != BOND_LINK_DOWN) |
1486 | new_slave->last_link_up = jiffies; | 1479 | new_slave->last_link_up = jiffies; |
1487 | pr_debug("Initial state of slave_dev is BOND_LINK_%s\n", | 1480 | netdev_dbg(bond_dev, "Initial state of slave_dev is BOND_LINK_%s\n", |
1488 | new_slave->link == BOND_LINK_DOWN ? "DOWN" : | 1481 | new_slave->link == BOND_LINK_DOWN ? "DOWN" : |
1489 | (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); | 1482 | (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); |
1490 | 1483 | ||
1491 | if (bond_uses_primary(bond) && bond->params.primary[0]) { | 1484 | if (bond_uses_primary(bond) && bond->params.primary[0]) { |
1492 | /* if there is a primary slave, remember it */ | 1485 | /* if there is a primary slave, remember it */ |
@@ -1527,7 +1520,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1527 | bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW); | 1520 | bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW); |
1528 | break; | 1521 | break; |
1529 | default: | 1522 | default: |
1530 | pr_debug("This slave is always active in trunk mode\n"); | 1523 | netdev_dbg(bond_dev, "This slave is always active in trunk mode\n"); |
1531 | 1524 | ||
1532 | /* always active in trunk mode */ | 1525 | /* always active in trunk mode */ |
1533 | bond_set_active_slave(new_slave); | 1526 | bond_set_active_slave(new_slave); |
@@ -1547,8 +1540,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1547 | slave_dev->npinfo = bond->dev->npinfo; | 1540 | slave_dev->npinfo = bond->dev->npinfo; |
1548 | if (slave_dev->npinfo) { | 1541 | if (slave_dev->npinfo) { |
1549 | if (slave_enable_netpoll(new_slave)) { | 1542 | if (slave_enable_netpoll(new_slave)) { |
1550 | pr_info("Error, %s: master_dev is using netpoll, but new slave device does not support netpoll\n", | 1543 | netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n"); |
1551 | bond_dev->name); | ||
1552 | res = -EBUSY; | 1544 | res = -EBUSY; |
1553 | goto err_detach; | 1545 | goto err_detach; |
1554 | } | 1546 | } |
@@ -1558,19 +1550,19 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1558 | res = netdev_rx_handler_register(slave_dev, bond_handle_frame, | 1550 | res = netdev_rx_handler_register(slave_dev, bond_handle_frame, |
1559 | new_slave); | 1551 | new_slave); |
1560 | if (res) { | 1552 | if (res) { |
1561 | pr_debug("Error %d calling netdev_rx_handler_register\n", res); | 1553 | netdev_dbg(bond_dev, "Error %d calling netdev_rx_handler_register\n", res); |
1562 | goto err_detach; | 1554 | goto err_detach; |
1563 | } | 1555 | } |
1564 | 1556 | ||
1565 | res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave); | 1557 | res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave); |
1566 | if (res) { | 1558 | if (res) { |
1567 | pr_debug("Error %d calling bond_master_upper_dev_link\n", res); | 1559 | netdev_dbg(bond_dev, "Error %d calling bond_master_upper_dev_link\n", res); |
1568 | goto err_unregister; | 1560 | goto err_unregister; |
1569 | } | 1561 | } |
1570 | 1562 | ||
1571 | res = bond_sysfs_slave_add(new_slave); | 1563 | res = bond_sysfs_slave_add(new_slave); |
1572 | if (res) { | 1564 | if (res) { |
1573 | pr_debug("Error %d calling bond_sysfs_slave_add\n", res); | 1565 | netdev_dbg(bond_dev, "Error %d calling bond_sysfs_slave_add\n", res); |
1574 | goto err_upper_unlink; | 1566 | goto err_upper_unlink; |
1575 | } | 1567 | } |
1576 | 1568 | ||
@@ -1586,10 +1578,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1586 | unblock_netpoll_tx(); | 1578 | unblock_netpoll_tx(); |
1587 | } | 1579 | } |
1588 | 1580 | ||
1589 | pr_info("%s: Enslaving %s as %s interface with %s link\n", | 1581 | netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n", |
1590 | bond_dev->name, slave_dev->name, | 1582 | slave_dev->name, |
1591 | bond_is_active_slave(new_slave) ? "an active" : "a backup", | 1583 | bond_is_active_slave(new_slave) ? "an active" : "a backup", |
1592 | new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); | 1584 | new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); |
1593 | 1585 | ||
1594 | /* enslave is successful */ | 1586 | /* enslave is successful */ |
1595 | return 0; | 1587 | return 0; |
@@ -1674,8 +1666,8 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1674 | /* slave is not a slave or master is not master of this slave */ | 1666 | /* slave is not a slave or master is not master of this slave */ |
1675 | if (!(slave_dev->flags & IFF_SLAVE) || | 1667 | if (!(slave_dev->flags & IFF_SLAVE) || |
1676 | !netdev_has_upper_dev(slave_dev, bond_dev)) { | 1668 | !netdev_has_upper_dev(slave_dev, bond_dev)) { |
1677 | pr_err("%s: Error: cannot release %s\n", | 1669 | netdev_err(bond_dev, "cannot release %s\n", |
1678 | bond_dev->name, slave_dev->name); | 1670 | slave_dev->name); |
1679 | return -EINVAL; | 1671 | return -EINVAL; |
1680 | } | 1672 | } |
1681 | 1673 | ||
@@ -1684,8 +1676,8 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1684 | slave = bond_get_slave_by_dev(bond, slave_dev); | 1676 | slave = bond_get_slave_by_dev(bond, slave_dev); |
1685 | if (!slave) { | 1677 | if (!slave) { |
1686 | /* not a slave of this bond */ | 1678 | /* not a slave of this bond */ |
1687 | pr_info("%s: %s not enslaved\n", | 1679 | netdev_info(bond_dev, "%s not enslaved\n", |
1688 | bond_dev->name, slave_dev->name); | 1680 | slave_dev->name); |
1689 | unblock_netpoll_tx(); | 1681 | unblock_netpoll_tx(); |
1690 | return -EINVAL; | 1682 | return -EINVAL; |
1691 | } | 1683 | } |
@@ -1705,10 +1697,9 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1705 | 1697 | ||
1706 | write_unlock_bh(&bond->lock); | 1698 | write_unlock_bh(&bond->lock); |
1707 | 1699 | ||
1708 | pr_info("%s: Releasing %s interface %s\n", | 1700 | netdev_info(bond_dev, "Releasing %s interface %s\n", |
1709 | bond_dev->name, | 1701 | bond_is_active_slave(slave) ? "active" : "backup", |
1710 | bond_is_active_slave(slave) ? "active" : "backup", | 1702 | slave_dev->name); |
1711 | slave_dev->name); | ||
1712 | 1703 | ||
1713 | oldcurrent = rcu_access_pointer(bond->curr_active_slave); | 1704 | oldcurrent = rcu_access_pointer(bond->curr_active_slave); |
1714 | 1705 | ||
@@ -1718,10 +1709,9 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1718 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) { | 1709 | BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) { |
1719 | if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && | 1710 | if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && |
1720 | bond_has_slaves(bond)) | 1711 | bond_has_slaves(bond)) |
1721 | pr_warn("%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", | 1712 | netdev_warn(bond_dev, "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", |
1722 | bond_dev->name, slave_dev->name, | 1713 | slave_dev->name, slave->perm_hwaddr, |
1723 | slave->perm_hwaddr, | 1714 | bond_dev->name, slave_dev->name); |
1724 | bond_dev->name, slave_dev->name); | ||
1725 | } | 1715 | } |
1726 | 1716 | ||
1727 | if (bond->primary_slave == slave) | 1717 | if (bond->primary_slave == slave) |
@@ -1774,8 +1764,8 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
1774 | bond_compute_features(bond); | 1764 | bond_compute_features(bond); |
1775 | if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && | 1765 | if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && |
1776 | (old_features & NETIF_F_VLAN_CHALLENGED)) | 1766 | (old_features & NETIF_F_VLAN_CHALLENGED)) |
1777 | pr_info("%s: last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n", | 1767 | netdev_info(bond_dev, "last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n", |
1778 | bond_dev->name, slave_dev->name, bond_dev->name); | 1768 | slave_dev->name, bond_dev->name); |
1779 | 1769 | ||
1780 | /* must do this from outside any spinlocks */ | 1770 | /* must do this from outside any spinlocks */ |
1781 | vlan_vids_del_by_dev(slave_dev, bond_dev); | 1771 | vlan_vids_del_by_dev(slave_dev, bond_dev); |
@@ -1842,8 +1832,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev, | |||
1842 | ret = bond_release(bond_dev, slave_dev); | 1832 | ret = bond_release(bond_dev, slave_dev); |
1843 | if (ret == 0 && !bond_has_slaves(bond)) { | 1833 | if (ret == 0 && !bond_has_slaves(bond)) { |
1844 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; | 1834 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; |
1845 | pr_info("%s: Destroying bond %s\n", | 1835 | netdev_info(bond_dev, "Destroying bond %s\n", |
1846 | bond_dev->name, bond_dev->name); | 1836 | bond_dev->name); |
1847 | unregister_netdevice(bond_dev); | 1837 | unregister_netdevice(bond_dev); |
1848 | } | 1838 | } |
1849 | return ret; | 1839 | return ret; |
@@ -1907,14 +1897,13 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
1907 | slave->link = BOND_LINK_FAIL; | 1897 | slave->link = BOND_LINK_FAIL; |
1908 | slave->delay = bond->params.downdelay; | 1898 | slave->delay = bond->params.downdelay; |
1909 | if (slave->delay) { | 1899 | if (slave->delay) { |
1910 | pr_info("%s: link status down for %sinterface %s, disabling it in %d ms\n", | 1900 | netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n", |
1911 | bond->dev->name, | 1901 | (BOND_MODE(bond) == |
1912 | (BOND_MODE(bond) == | 1902 | BOND_MODE_ACTIVEBACKUP) ? |
1913 | BOND_MODE_ACTIVEBACKUP) ? | 1903 | (bond_is_active_slave(slave) ? |
1914 | (bond_is_active_slave(slave) ? | 1904 | "active " : "backup ") : "", |
1915 | "active " : "backup ") : "", | 1905 | slave->dev->name, |
1916 | slave->dev->name, | 1906 | bond->params.downdelay * bond->params.miimon); |
1917 | bond->params.downdelay * bond->params.miimon); | ||
1918 | } | 1907 | } |
1919 | /*FALLTHRU*/ | 1908 | /*FALLTHRU*/ |
1920 | case BOND_LINK_FAIL: | 1909 | case BOND_LINK_FAIL: |
@@ -1924,11 +1913,10 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
1924 | */ | 1913 | */ |
1925 | slave->link = BOND_LINK_UP; | 1914 | slave->link = BOND_LINK_UP; |
1926 | slave->last_link_up = jiffies; | 1915 | slave->last_link_up = jiffies; |
1927 | pr_info("%s: link status up again after %d ms for interface %s\n", | 1916 | netdev_info(bond->dev, "link status up again after %d ms for interface %s\n", |
1928 | bond->dev->name, | 1917 | (bond->params.downdelay - slave->delay) * |
1929 | (bond->params.downdelay - slave->delay) * | 1918 | bond->params.miimon, |
1930 | bond->params.miimon, | 1919 | slave->dev->name); |
1931 | slave->dev->name); | ||
1932 | continue; | 1920 | continue; |
1933 | } | 1921 | } |
1934 | 1922 | ||
@@ -1949,21 +1937,20 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
1949 | slave->delay = bond->params.updelay; | 1937 | slave->delay = bond->params.updelay; |
1950 | 1938 | ||
1951 | if (slave->delay) { | 1939 | if (slave->delay) { |
1952 | pr_info("%s: link status up for interface %s, enabling it in %d ms\n", | 1940 | netdev_info(bond->dev, "link status up for interface %s, enabling it in %d ms\n", |
1953 | bond->dev->name, slave->dev->name, | 1941 | slave->dev->name, |
1954 | ignore_updelay ? 0 : | 1942 | ignore_updelay ? 0 : |
1955 | bond->params.updelay * | 1943 | bond->params.updelay * |
1956 | bond->params.miimon); | 1944 | bond->params.miimon); |
1957 | } | 1945 | } |
1958 | /*FALLTHRU*/ | 1946 | /*FALLTHRU*/ |
1959 | case BOND_LINK_BACK: | 1947 | case BOND_LINK_BACK: |
1960 | if (!link_state) { | 1948 | if (!link_state) { |
1961 | slave->link = BOND_LINK_DOWN; | 1949 | slave->link = BOND_LINK_DOWN; |
1962 | pr_info("%s: link status down again after %d ms for interface %s\n", | 1950 | netdev_info(bond->dev, "link status down again after %d ms for interface %s\n", |
1963 | bond->dev->name, | 1951 | (bond->params.updelay - slave->delay) * |
1964 | (bond->params.updelay - slave->delay) * | 1952 | bond->params.miimon, |
1965 | bond->params.miimon, | 1953 | slave->dev->name); |
1966 | slave->dev->name); | ||
1967 | 1954 | ||
1968 | continue; | 1955 | continue; |
1969 | } | 1956 | } |
@@ -2011,10 +1998,10 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2011 | bond_set_backup_slave(slave); | 1998 | bond_set_backup_slave(slave); |
2012 | } | 1999 | } |
2013 | 2000 | ||
2014 | pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex\n", | 2001 | netdev_info(bond->dev, "link status definitely up for interface %s, %u Mbps %s duplex\n", |
2015 | bond->dev->name, slave->dev->name, | 2002 | slave->dev->name, |
2016 | slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, | 2003 | slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, |
2017 | slave->duplex ? "full" : "half"); | 2004 | slave->duplex ? "full" : "half"); |
2018 | 2005 | ||
2019 | /* notify ad that the link status has changed */ | 2006 | /* notify ad that the link status has changed */ |
2020 | if (BOND_MODE(bond) == BOND_MODE_8023AD) | 2007 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
@@ -2041,8 +2028,8 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2041 | bond_set_slave_inactive_flags(slave, | 2028 | bond_set_slave_inactive_flags(slave, |
2042 | BOND_SLAVE_NOTIFY_NOW); | 2029 | BOND_SLAVE_NOTIFY_NOW); |
2043 | 2030 | ||
2044 | pr_info("%s: link status definitely down for interface %s, disabling it\n", | 2031 | netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n", |
2045 | bond->dev->name, slave->dev->name); | 2032 | slave->dev->name); |
2046 | 2033 | ||
2047 | if (BOND_MODE(bond) == BOND_MODE_8023AD) | 2034 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
2048 | bond_3ad_handle_link_change(slave, | 2035 | bond_3ad_handle_link_change(slave, |
@@ -2058,9 +2045,8 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2058 | continue; | 2045 | continue; |
2059 | 2046 | ||
2060 | default: | 2047 | default: |
2061 | pr_err("%s: invalid new link %d on slave %s\n", | 2048 | netdev_err(bond->dev, "invalid new link %d on slave %s\n", |
2062 | bond->dev->name, slave->new_link, | 2049 | slave->new_link, slave->dev->name); |
2063 | slave->dev->name); | ||
2064 | slave->new_link = BOND_LINK_NOCHANGE; | 2050 | slave->new_link = BOND_LINK_NOCHANGE; |
2065 | 2051 | ||
2066 | continue; | 2052 | continue; |
@@ -2163,8 +2149,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, | |||
2163 | struct sk_buff *skb; | 2149 | struct sk_buff *skb; |
2164 | int i; | 2150 | int i; |
2165 | 2151 | ||
2166 | pr_debug("arp %d on slave %s: dst %pI4 src %pI4\n", | 2152 | netdev_dbg(slave_dev, "arp %d on slave %s: dst %pI4 src %pI4\n", |
2167 | arp_op, slave_dev->name, &dest_ip, &src_ip); | 2153 | arp_op, slave_dev->name, &dest_ip, &src_ip); |
2168 | 2154 | ||
2169 | skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, | 2155 | skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, |
2170 | NULL, slave_dev->dev_addr, NULL); | 2156 | NULL, slave_dev->dev_addr, NULL); |
@@ -2179,8 +2165,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, | |||
2179 | if (!tags[i].vlan_id) | 2165 | if (!tags[i].vlan_id) |
2180 | continue; | 2166 | continue; |
2181 | 2167 | ||
2182 | pr_debug("inner tag: proto %X vid %X\n", | 2168 | netdev_dbg(slave_dev, "inner tag: proto %X vid %X\n", |
2183 | ntohs(tags[i].vlan_proto), tags[i].vlan_id); | 2169 | ntohs(tags[i].vlan_proto), tags[i].vlan_id); |
2184 | skb = __vlan_put_tag(skb, tags[i].vlan_proto, | 2170 | skb = __vlan_put_tag(skb, tags[i].vlan_proto, |
2185 | tags[i].vlan_id); | 2171 | tags[i].vlan_id); |
2186 | if (!skb) { | 2172 | if (!skb) { |
@@ -2190,8 +2176,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, | |||
2190 | } | 2176 | } |
2191 | /* Set the outer tag */ | 2177 | /* Set the outer tag */ |
2192 | if (tags[0].vlan_id) { | 2178 | if (tags[0].vlan_id) { |
2193 | pr_debug("outer tag: proto %X vid %X\n", | 2179 | netdev_dbg(slave_dev, "outer tag: proto %X vid %X\n", |
2194 | ntohs(tags[0].vlan_proto), tags[0].vlan_id); | 2180 | ntohs(tags[0].vlan_proto), tags[0].vlan_id); |
2195 | skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id); | 2181 | skb = vlan_put_tag(skb, tags[0].vlan_proto, tags[0].vlan_id); |
2196 | if (!skb) { | 2182 | if (!skb) { |
2197 | net_err_ratelimited("failed to insert outer VLAN tag\n"); | 2183 | net_err_ratelimited("failed to insert outer VLAN tag\n"); |
@@ -2245,7 +2231,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2245 | bool ret; | 2231 | bool ret; |
2246 | 2232 | ||
2247 | for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) { | 2233 | for (i = 0; i < BOND_MAX_ARP_TARGETS && targets[i]; i++) { |
2248 | pr_debug("basa: target %pI4\n", &targets[i]); | 2234 | netdev_dbg(bond->dev, "basa: target %pI4\n", &targets[i]); |
2249 | memset(tags, 0, sizeof(tags)); | 2235 | memset(tags, 0, sizeof(tags)); |
2250 | 2236 | ||
2251 | /* Find out through which dev should the packet go */ | 2237 | /* Find out through which dev should the packet go */ |
@@ -2276,9 +2262,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2276 | goto found; | 2262 | goto found; |
2277 | 2263 | ||
2278 | /* Not our device - skip */ | 2264 | /* Not our device - skip */ |
2279 | pr_debug("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", | 2265 | netdev_dbg(bond->dev, "no path to arp_ip_target %pI4 via rt.dev %s\n", |
2280 | bond->dev->name, &targets[i], | 2266 | &targets[i], rt->dst.dev ? rt->dst.dev->name : "NULL"); |
2281 | rt->dst.dev ? rt->dst.dev->name : "NULL"); | ||
2282 | 2267 | ||
2283 | ip_rt_put(rt); | 2268 | ip_rt_put(rt); |
2284 | continue; | 2269 | continue; |
@@ -2296,13 +2281,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2296 | int i; | 2281 | int i; |
2297 | 2282 | ||
2298 | if (!sip || !bond_has_this_ip(bond, tip)) { | 2283 | if (!sip || !bond_has_this_ip(bond, tip)) { |
2299 | pr_debug("bva: sip %pI4 tip %pI4 not found\n", &sip, &tip); | 2284 | netdev_dbg(bond->dev, "bva: sip %pI4 tip %pI4 not found\n", |
2285 | &sip, &tip); | ||
2300 | return; | 2286 | return; |
2301 | } | 2287 | } |
2302 | 2288 | ||
2303 | i = bond_get_targets_ip(bond->params.arp_targets, sip); | 2289 | i = bond_get_targets_ip(bond->params.arp_targets, sip); |
2304 | if (i == -1) { | 2290 | if (i == -1) { |
2305 | pr_debug("bva: sip %pI4 not found in targets\n", &sip); | 2291 | netdev_dbg(bond->dev, "bva: sip %pI4 not found in targets\n", |
2292 | &sip); | ||
2306 | return; | 2293 | return; |
2307 | } | 2294 | } |
2308 | slave->last_rx = jiffies; | 2295 | slave->last_rx = jiffies; |
@@ -2329,8 +2316,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, | |||
2329 | 2316 | ||
2330 | alen = arp_hdr_len(bond->dev); | 2317 | alen = arp_hdr_len(bond->dev); |
2331 | 2318 | ||
2332 | pr_debug("bond_arp_rcv: bond %s skb->dev %s\n", | 2319 | netdev_dbg(bond->dev, "bond_arp_rcv: skb->dev %s\n", |
2333 | bond->dev->name, skb->dev->name); | 2320 | skb->dev->name); |
2334 | 2321 | ||
2335 | if (alen > skb_headlen(skb)) { | 2322 | if (alen > skb_headlen(skb)) { |
2336 | arp = kmalloc(alen, GFP_ATOMIC); | 2323 | arp = kmalloc(alen, GFP_ATOMIC); |
@@ -2354,10 +2341,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, | |||
2354 | arp_ptr += 4 + bond->dev->addr_len; | 2341 | arp_ptr += 4 + bond->dev->addr_len; |
2355 | memcpy(&tip, arp_ptr, 4); | 2342 | memcpy(&tip, arp_ptr, 4); |
2356 | 2343 | ||
2357 | pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", | 2344 | netdev_dbg(bond->dev, "bond_arp_rcv: %s/%d av %d sv %d sip %pI4 tip %pI4\n", |
2358 | bond->dev->name, slave->dev->name, bond_slave_state(slave), | 2345 | slave->dev->name, bond_slave_state(slave), |
2359 | bond->params.arp_validate, slave_do_arp_validate(bond, slave), | 2346 | bond->params.arp_validate, slave_do_arp_validate(bond, slave), |
2360 | &sip, &tip); | 2347 | &sip, &tip); |
2361 | 2348 | ||
2362 | curr_active_slave = rcu_dereference(bond->curr_active_slave); | 2349 | curr_active_slave = rcu_dereference(bond->curr_active_slave); |
2363 | 2350 | ||
@@ -2447,14 +2434,12 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2447 | * is closed. | 2434 | * is closed. |
2448 | */ | 2435 | */ |
2449 | if (!oldcurrent) { | 2436 | if (!oldcurrent) { |
2450 | pr_info("%s: link status definitely up for interface %s\n", | 2437 | netdev_info(bond->dev, "link status definitely up for interface %s\n", |
2451 | bond->dev->name, | 2438 | slave->dev->name); |
2452 | slave->dev->name); | ||
2453 | do_failover = 1; | 2439 | do_failover = 1; |
2454 | } else { | 2440 | } else { |
2455 | pr_info("%s: interface %s is now up\n", | 2441 | netdev_info(bond->dev, "interface %s is now up\n", |
2456 | bond->dev->name, | 2442 | slave->dev->name); |
2457 | slave->dev->name); | ||
2458 | } | 2443 | } |
2459 | } | 2444 | } |
2460 | } else { | 2445 | } else { |
@@ -2473,8 +2458,8 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2473 | if (slave->link_failure_count < UINT_MAX) | 2458 | if (slave->link_failure_count < UINT_MAX) |
2474 | slave->link_failure_count++; | 2459 | slave->link_failure_count++; |
2475 | 2460 | ||
2476 | pr_info("%s: interface %s is now down\n", | 2461 | netdev_info(bond->dev, "interface %s is now down\n", |
2477 | bond->dev->name, slave->dev->name); | 2462 | slave->dev->name); |
2478 | 2463 | ||
2479 | if (slave == oldcurrent) | 2464 | if (slave == oldcurrent) |
2480 | do_failover = 1; | 2465 | do_failover = 1; |
@@ -2627,8 +2612,8 @@ static void bond_ab_arp_commit(struct bonding *bond) | |||
2627 | RCU_INIT_POINTER(bond->current_arp_slave, NULL); | 2612 | RCU_INIT_POINTER(bond->current_arp_slave, NULL); |
2628 | } | 2613 | } |
2629 | 2614 | ||
2630 | pr_info("%s: link status definitely up for interface %s\n", | 2615 | netdev_info(bond->dev, "link status definitely up for interface %s\n", |
2631 | bond->dev->name, slave->dev->name); | 2616 | slave->dev->name); |
2632 | 2617 | ||
2633 | if (!rtnl_dereference(bond->curr_active_slave) || | 2618 | if (!rtnl_dereference(bond->curr_active_slave) || |
2634 | (slave == bond->primary_slave)) | 2619 | (slave == bond->primary_slave)) |
@@ -2646,8 +2631,8 @@ static void bond_ab_arp_commit(struct bonding *bond) | |||
2646 | bond_set_slave_inactive_flags(slave, | 2631 | bond_set_slave_inactive_flags(slave, |
2647 | BOND_SLAVE_NOTIFY_NOW); | 2632 | BOND_SLAVE_NOTIFY_NOW); |
2648 | 2633 | ||
2649 | pr_info("%s: link status definitely down for interface %s, disabling it\n", | 2634 | netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n", |
2650 | bond->dev->name, slave->dev->name); | 2635 | slave->dev->name); |
2651 | 2636 | ||
2652 | if (slave == rtnl_dereference(bond->curr_active_slave)) { | 2637 | if (slave == rtnl_dereference(bond->curr_active_slave)) { |
2653 | RCU_INIT_POINTER(bond->current_arp_slave, NULL); | 2638 | RCU_INIT_POINTER(bond->current_arp_slave, NULL); |
@@ -2657,9 +2642,8 @@ static void bond_ab_arp_commit(struct bonding *bond) | |||
2657 | continue; | 2642 | continue; |
2658 | 2643 | ||
2659 | default: | 2644 | default: |
2660 | pr_err("%s: impossible: new_link %d on slave %s\n", | 2645 | netdev_err(bond->dev, "impossible: new_link %d on slave %s\n", |
2661 | bond->dev->name, slave->new_link, | 2646 | slave->new_link, slave->dev->name); |
2662 | slave->dev->name); | ||
2663 | continue; | 2647 | continue; |
2664 | } | 2648 | } |
2665 | 2649 | ||
@@ -2690,9 +2674,9 @@ static bool bond_ab_arp_probe(struct bonding *bond) | |||
2690 | bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER; | 2674 | bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER; |
2691 | 2675 | ||
2692 | if (curr_arp_slave && curr_active_slave) | 2676 | if (curr_arp_slave && curr_active_slave) |
2693 | pr_info("PROBE: c_arp %s && cas %s BAD\n", | 2677 | netdev_info(bond->dev, "PROBE: c_arp %s && cas %s BAD\n", |
2694 | curr_arp_slave->dev->name, | 2678 | curr_arp_slave->dev->name, |
2695 | curr_active_slave->dev->name); | 2679 | curr_active_slave->dev->name); |
2696 | 2680 | ||
2697 | if (curr_active_slave) { | 2681 | if (curr_active_slave) { |
2698 | bond_arp_send_all(bond, curr_active_slave); | 2682 | bond_arp_send_all(bond, curr_active_slave); |
@@ -2733,8 +2717,8 @@ static bool bond_ab_arp_probe(struct bonding *bond) | |||
2733 | bond_set_slave_inactive_flags(slave, | 2717 | bond_set_slave_inactive_flags(slave, |
2734 | BOND_SLAVE_NOTIFY_LATER); | 2718 | BOND_SLAVE_NOTIFY_LATER); |
2735 | 2719 | ||
2736 | pr_info("%s: backup interface %s is now down\n", | 2720 | netdev_info(bond->dev, "backup interface %s is now down\n", |
2737 | bond->dev->name, slave->dev->name); | 2721 | slave->dev->name); |
2738 | } | 2722 | } |
2739 | if (slave == curr_arp_slave) | 2723 | if (slave == curr_arp_slave) |
2740 | found = true; | 2724 | found = true; |
@@ -2930,9 +2914,8 @@ static int bond_slave_netdev_event(unsigned long event, | |||
2930 | break; | 2914 | break; |
2931 | } | 2915 | } |
2932 | 2916 | ||
2933 | pr_info("%s: Primary slave changed to %s, reselecting active slave\n", | 2917 | netdev_info(bond->dev, "Primary slave changed to %s, reselecting active slave\n", |
2934 | bond->dev->name, | 2918 | bond->primary_slave ? slave_dev->name : "none"); |
2935 | bond->primary_slave ? slave_dev->name : "none"); | ||
2936 | 2919 | ||
2937 | block_netpoll_tx(); | 2920 | block_netpoll_tx(); |
2938 | write_lock_bh(&bond->curr_slave_lock); | 2921 | write_lock_bh(&bond->curr_slave_lock); |
@@ -2967,19 +2950,18 @@ static int bond_netdev_event(struct notifier_block *this, | |||
2967 | { | 2950 | { |
2968 | struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); | 2951 | struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); |
2969 | 2952 | ||
2970 | pr_debug("event_dev: %s, event: %lx\n", | 2953 | netdev_dbg(event_dev, "event: %lx\n", event); |
2971 | event_dev ? event_dev->name : "None", event); | ||
2972 | 2954 | ||
2973 | if (!(event_dev->priv_flags & IFF_BONDING)) | 2955 | if (!(event_dev->priv_flags & IFF_BONDING)) |
2974 | return NOTIFY_DONE; | 2956 | return NOTIFY_DONE; |
2975 | 2957 | ||
2976 | if (event_dev->flags & IFF_MASTER) { | 2958 | if (event_dev->flags & IFF_MASTER) { |
2977 | pr_debug("IFF_MASTER\n"); | 2959 | netdev_dbg(event_dev, "IFF_MASTER\n"); |
2978 | return bond_master_netdev_event(event, event_dev); | 2960 | return bond_master_netdev_event(event, event_dev); |
2979 | } | 2961 | } |
2980 | 2962 | ||
2981 | if (event_dev->flags & IFF_SLAVE) { | 2963 | if (event_dev->flags & IFF_SLAVE) { |
2982 | pr_debug("IFF_SLAVE\n"); | 2964 | netdev_dbg(event_dev, "IFF_SLAVE\n"); |
2983 | return bond_slave_netdev_event(event, event_dev); | 2965 | return bond_slave_netdev_event(event, event_dev); |
2984 | } | 2966 | } |
2985 | 2967 | ||
@@ -3221,7 +3203,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
3221 | struct net *net; | 3203 | struct net *net; |
3222 | int res = 0; | 3204 | int res = 0; |
3223 | 3205 | ||
3224 | pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd); | 3206 | netdev_dbg(bond_dev, "bond_ioctl: cmd=%d\n", cmd); |
3225 | 3207 | ||
3226 | switch (cmd) { | 3208 | switch (cmd) { |
3227 | case SIOCGMIIPHY: | 3209 | case SIOCGMIIPHY: |
@@ -3291,12 +3273,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
3291 | 3273 | ||
3292 | slave_dev = __dev_get_by_name(net, ifr->ifr_slave); | 3274 | slave_dev = __dev_get_by_name(net, ifr->ifr_slave); |
3293 | 3275 | ||
3294 | pr_debug("slave_dev=%p:\n", slave_dev); | 3276 | netdev_dbg(bond_dev, "slave_dev=%p:\n", slave_dev); |
3295 | 3277 | ||
3296 | if (!slave_dev) | 3278 | if (!slave_dev) |
3297 | return -ENODEV; | 3279 | return -ENODEV; |
3298 | 3280 | ||
3299 | pr_debug("slave_dev->name=%s:\n", slave_dev->name); | 3281 | netdev_dbg(bond_dev, "slave_dev->name=%s:\n", slave_dev->name); |
3300 | switch (cmd) { | 3282 | switch (cmd) { |
3301 | case BOND_ENSLAVE_OLD: | 3283 | case BOND_ENSLAVE_OLD: |
3302 | case SIOCBONDENSLAVE: | 3284 | case SIOCBONDENSLAVE: |
@@ -3423,8 +3405,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) | |||
3423 | struct list_head *iter; | 3405 | struct list_head *iter; |
3424 | int res = 0; | 3406 | int res = 0; |
3425 | 3407 | ||
3426 | pr_debug("bond=%p, name=%s, new_mtu=%d\n", | 3408 | netdev_dbg(bond_dev, "bond=%p, new_mtu=%d\n", bond, new_mtu); |
3427 | bond, bond_dev ? bond_dev->name : "None", new_mtu); | ||
3428 | 3409 | ||
3429 | /* Can't hold bond->lock with bh disabled here since | 3410 | /* Can't hold bond->lock with bh disabled here since |
3430 | * some base drivers panic. On the other hand we can't | 3411 | * some base drivers panic. On the other hand we can't |
@@ -3442,8 +3423,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) | |||
3442 | */ | 3423 | */ |
3443 | 3424 | ||
3444 | bond_for_each_slave(bond, slave, iter) { | 3425 | bond_for_each_slave(bond, slave, iter) { |
3445 | pr_debug("s %p c_m %p\n", | 3426 | netdev_dbg(bond_dev, "s %p c_m %p\n", |
3446 | slave, slave->dev->netdev_ops->ndo_change_mtu); | 3427 | slave, slave->dev->netdev_ops->ndo_change_mtu); |
3447 | 3428 | ||
3448 | res = dev_set_mtu(slave->dev, new_mtu); | 3429 | res = dev_set_mtu(slave->dev, new_mtu); |
3449 | 3430 | ||
@@ -3456,7 +3437,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) | |||
3456 | * means changing their mtu from timer context, which | 3437 | * means changing their mtu from timer context, which |
3457 | * is probably not a good idea. | 3438 | * is probably not a good idea. |
3458 | */ | 3439 | */ |
3459 | pr_debug("err %d %s\n", res, slave->dev->name); | 3440 | netdev_dbg(bond_dev, "err %d %s\n", res, |
3441 | slave->dev->name); | ||
3460 | goto unwind; | 3442 | goto unwind; |
3461 | } | 3443 | } |
3462 | } | 3444 | } |
@@ -3475,8 +3457,8 @@ unwind: | |||
3475 | 3457 | ||
3476 | tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu); | 3458 | tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu); |
3477 | if (tmp_res) { | 3459 | if (tmp_res) { |
3478 | pr_debug("unwind err %d dev %s\n", | 3460 | netdev_dbg(bond_dev, "unwind err %d dev %s\n", |
3479 | tmp_res, rollback_slave->dev->name); | 3461 | tmp_res, rollback_slave->dev->name); |
3480 | } | 3462 | } |
3481 | } | 3463 | } |
3482 | 3464 | ||
@@ -3502,8 +3484,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
3502 | return bond_alb_set_mac_address(bond_dev, addr); | 3484 | return bond_alb_set_mac_address(bond_dev, addr); |
3503 | 3485 | ||
3504 | 3486 | ||
3505 | pr_debug("bond=%p, name=%s\n", | 3487 | netdev_dbg(bond_dev, "bond=%p\n", bond); |
3506 | bond, bond_dev ? bond_dev->name : "None"); | ||
3507 | 3488 | ||
3508 | /* If fail_over_mac is enabled, do nothing and return success. | 3489 | /* If fail_over_mac is enabled, do nothing and return success. |
3509 | * Returning an error causes ifenslave to fail. | 3490 | * Returning an error causes ifenslave to fail. |
@@ -3531,7 +3512,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
3531 | */ | 3512 | */ |
3532 | 3513 | ||
3533 | bond_for_each_slave(bond, slave, iter) { | 3514 | bond_for_each_slave(bond, slave, iter) { |
3534 | pr_debug("slave %p %s\n", slave, slave->dev->name); | 3515 | netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name); |
3535 | res = dev_set_mac_address(slave->dev, addr); | 3516 | res = dev_set_mac_address(slave->dev, addr); |
3536 | if (res) { | 3517 | if (res) { |
3537 | /* TODO: consider downing the slave | 3518 | /* TODO: consider downing the slave |
@@ -3540,7 +3521,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
3540 | * breakage anyway until ARP finish | 3521 | * breakage anyway until ARP finish |
3541 | * updating, so... | 3522 | * updating, so... |
3542 | */ | 3523 | */ |
3543 | pr_debug("err %d %s\n", res, slave->dev->name); | 3524 | netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name); |
3544 | goto unwind; | 3525 | goto unwind; |
3545 | } | 3526 | } |
3546 | } | 3527 | } |
@@ -3562,8 +3543,8 @@ unwind: | |||
3562 | 3543 | ||
3563 | tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa); | 3544 | tmp_res = dev_set_mac_address(rollback_slave->dev, &tmp_sa); |
3564 | if (tmp_res) { | 3545 | if (tmp_res) { |
3565 | pr_debug("unwind err %d dev %s\n", | 3546 | netdev_dbg(bond_dev, "unwind err %d dev %s\n", |
3566 | tmp_res, rollback_slave->dev->name); | 3547 | tmp_res, rollback_slave->dev->name); |
3567 | } | 3548 | } |
3568 | } | 3549 | } |
3569 | 3550 | ||
@@ -3810,8 +3791,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev | |||
3810 | return bond_tlb_xmit(skb, dev); | 3791 | return bond_tlb_xmit(skb, dev); |
3811 | default: | 3792 | default: |
3812 | /* Should never happen, mode already checked */ | 3793 | /* Should never happen, mode already checked */ |
3813 | pr_err("%s: Error: Unknown bonding mode %d\n", | 3794 | netdev_err(dev, "Unknown bonding mode %d\n", BOND_MODE(bond)); |
3814 | dev->name, BOND_MODE(bond)); | ||
3815 | WARN_ON_ONCE(1); | 3795 | WARN_ON_ONCE(1); |
3816 | dev_kfree_skb_any(skb); | 3796 | dev_kfree_skb_any(skb); |
3817 | return NETDEV_TX_OK; | 3797 | return NETDEV_TX_OK; |
@@ -3991,7 +3971,7 @@ static void bond_uninit(struct net_device *bond_dev) | |||
3991 | /* Release the bonded slaves */ | 3971 | /* Release the bonded slaves */ |
3992 | bond_for_each_slave(bond, slave, iter) | 3972 | bond_for_each_slave(bond, slave, iter) |
3993 | __bond_release_one(bond_dev, slave->dev, true); | 3973 | __bond_release_one(bond_dev, slave->dev, true); |
3994 | pr_info("%s: Released all slaves\n", bond_dev->name); | 3974 | netdev_info(bond_dev, "Released all slaves\n"); |
3995 | 3975 | ||
3996 | list_del(&bond->bond_list); | 3976 | list_del(&bond->bond_list); |
3997 | 3977 | ||
@@ -4380,7 +4360,7 @@ static int bond_init(struct net_device *bond_dev) | |||
4380 | struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id); | 4360 | struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id); |
4381 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); | 4361 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); |
4382 | 4362 | ||
4383 | pr_debug("Begin bond_init for %s\n", bond_dev->name); | 4363 | netdev_dbg(bond_dev, "Begin bond_init\n"); |
4384 | 4364 | ||
4385 | /* | 4365 | /* |
4386 | * Initialize locks that may be required during | 4366 | * Initialize locks that may be required during |
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index 4d97e23eb497..d163e112f04c 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c | |||
@@ -9,8 +9,6 @@ | |||
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
14 | #include <linux/module.h> | 12 | #include <linux/module.h> |
15 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
16 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
@@ -181,8 +179,7 @@ static int bond_changelink(struct net_device *bond_dev, | |||
181 | int arp_interval = nla_get_u32(data[IFLA_BOND_ARP_INTERVAL]); | 179 | int arp_interval = nla_get_u32(data[IFLA_BOND_ARP_INTERVAL]); |
182 | 180 | ||
183 | if (arp_interval && miimon) { | 181 | if (arp_interval && miimon) { |
184 | pr_err("%s: ARP monitoring cannot be used with MII monitoring\n", | 182 | netdev_err(bond->dev, "ARP monitoring cannot be used with MII monitoring\n"); |
185 | bond->dev->name); | ||
186 | return -EINVAL; | 183 | return -EINVAL; |
187 | } | 184 | } |
188 | 185 | ||
@@ -207,8 +204,7 @@ static int bond_changelink(struct net_device *bond_dev, | |||
207 | i++; | 204 | i++; |
208 | } | 205 | } |
209 | if (i == 0 && bond->params.arp_interval) | 206 | if (i == 0 && bond->params.arp_interval) |
210 | pr_warn("%s: Removing last arp target with arp_interval on\n", | 207 | netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n"); |
211 | bond->dev->name); | ||
212 | if (err) | 208 | if (err) |
213 | return err; | 209 | return err; |
214 | } | 210 | } |
@@ -216,8 +212,7 @@ static int bond_changelink(struct net_device *bond_dev, | |||
216 | int arp_validate = nla_get_u32(data[IFLA_BOND_ARP_VALIDATE]); | 212 | int arp_validate = nla_get_u32(data[IFLA_BOND_ARP_VALIDATE]); |
217 | 213 | ||
218 | if (arp_validate && miimon) { | 214 | if (arp_validate && miimon) { |
219 | pr_err("%s: ARP validating cannot be used with MII monitoring\n", | 215 | netdev_err(bond->dev, "ARP validating cannot be used with MII monitoring\n"); |
220 | bond->dev->name); | ||
221 | return -EINVAL; | 216 | return -EINVAL; |
222 | } | 217 | } |
223 | 218 | ||
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index cf720ce1b69e..dc73463c2c23 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c | |||
@@ -9,8 +9,6 @@ | |||
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
14 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
15 | #include <linux/if.h> | 13 | #include <linux/if.h> |
16 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
@@ -544,9 +542,8 @@ static void bond_opt_dep_print(struct bonding *bond, | |||
544 | params = &bond->params; | 542 | params = &bond->params; |
545 | modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode); | 543 | modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode); |
546 | if (test_bit(params->mode, &opt->unsuppmodes)) | 544 | if (test_bit(params->mode, &opt->unsuppmodes)) |
547 | pr_err("%s: option %s: mode dependency failed, not supported in mode %s(%llu)\n", | 545 | netdev_err(bond->dev, "option %s: mode dependency failed, not supported in mode %s(%llu)\n", |
548 | bond->dev->name, opt->name, | 546 | opt->name, modeval->string, modeval->value); |
549 | modeval->string, modeval->value); | ||
550 | } | 547 | } |
551 | 548 | ||
552 | static void bond_opt_error_interpret(struct bonding *bond, | 549 | static void bond_opt_error_interpret(struct bonding *bond, |
@@ -564,31 +561,30 @@ static void bond_opt_error_interpret(struct bonding *bond, | |||
564 | p = strchr(val->string, '\n'); | 561 | p = strchr(val->string, '\n'); |
565 | if (p) | 562 | if (p) |
566 | *p = '\0'; | 563 | *p = '\0'; |
567 | pr_err("%s: option %s: invalid value (%s)\n", | 564 | netdev_err(bond->dev, "option %s: invalid value (%s)\n", |
568 | bond->dev->name, opt->name, val->string); | 565 | opt->name, val->string); |
569 | } else { | 566 | } else { |
570 | pr_err("%s: option %s: invalid value (%llu)\n", | 567 | netdev_err(bond->dev, "option %s: invalid value (%llu)\n", |
571 | bond->dev->name, opt->name, val->value); | 568 | opt->name, val->value); |
572 | } | 569 | } |
573 | } | 570 | } |
574 | minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); | 571 | minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); |
575 | maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); | 572 | maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); |
576 | if (!maxval) | 573 | if (!maxval) |
577 | break; | 574 | break; |
578 | pr_err("%s: option %s: allowed values %llu - %llu\n", | 575 | netdev_err(bond->dev, "option %s: allowed values %llu - %llu\n", |
579 | bond->dev->name, opt->name, minval ? minval->value : 0, | 576 | opt->name, minval ? minval->value : 0, maxval->value); |
580 | maxval->value); | ||
581 | break; | 577 | break; |
582 | case -EACCES: | 578 | case -EACCES: |
583 | bond_opt_dep_print(bond, opt); | 579 | bond_opt_dep_print(bond, opt); |
584 | break; | 580 | break; |
585 | case -ENOTEMPTY: | 581 | case -ENOTEMPTY: |
586 | pr_err("%s: option %s: unable to set because the bond device has slaves\n", | 582 | netdev_err(bond->dev, "option %s: unable to set because the bond device has slaves\n", |
587 | bond->dev->name, opt->name); | 583 | opt->name); |
588 | break; | 584 | break; |
589 | case -EBUSY: | 585 | case -EBUSY: |
590 | pr_err("%s: option %s: unable to set because the bond device is up\n", | 586 | netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n", |
591 | bond->dev->name, opt->name); | 587 | opt->name); |
592 | break; | 588 | break; |
593 | default: | 589 | default: |
594 | break; | 590 | break; |
@@ -675,14 +671,14 @@ static int bond_option_mode_set(struct bonding *bond, | |||
675 | const struct bond_opt_value *newval) | 671 | const struct bond_opt_value *newval) |
676 | { | 672 | { |
677 | if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { | 673 | if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { |
678 | pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", | 674 | netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n", |
679 | bond->dev->name, newval->string); | 675 | newval->string); |
680 | /* disable arp monitoring */ | 676 | /* disable arp monitoring */ |
681 | bond->params.arp_interval = 0; | 677 | bond->params.arp_interval = 0; |
682 | /* set miimon to default value */ | 678 | /* set miimon to default value */ |
683 | bond->params.miimon = BOND_DEFAULT_MIIMON; | 679 | bond->params.miimon = BOND_DEFAULT_MIIMON; |
684 | pr_info("%s: Setting MII monitoring interval to %d\n", | 680 | netdev_info(bond->dev, "Setting MII monitoring interval to %d\n", |
685 | bond->dev->name, bond->params.miimon); | 681 | bond->params.miimon); |
686 | } | 682 | } |
687 | 683 | ||
688 | /* don't cache arp_validate between modes */ | 684 | /* don't cache arp_validate between modes */ |
@@ -723,14 +719,14 @@ static int bond_option_active_slave_set(struct bonding *bond, | |||
723 | 719 | ||
724 | if (slave_dev) { | 720 | if (slave_dev) { |
725 | if (!netif_is_bond_slave(slave_dev)) { | 721 | if (!netif_is_bond_slave(slave_dev)) { |
726 | pr_err("Device %s is not bonding slave\n", | 722 | netdev_err(bond->dev, "Device %s is not bonding slave\n", |
727 | slave_dev->name); | 723 | slave_dev->name); |
728 | return -EINVAL; | 724 | return -EINVAL; |
729 | } | 725 | } |
730 | 726 | ||
731 | if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { | 727 | if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { |
732 | pr_err("%s: Device %s is not our slave\n", | 728 | netdev_err(bond->dev, "Device %s is not our slave\n", |
733 | bond->dev->name, slave_dev->name); | 729 | slave_dev->name); |
734 | return -EINVAL; | 730 | return -EINVAL; |
735 | } | 731 | } |
736 | } | 732 | } |
@@ -740,7 +736,7 @@ static int bond_option_active_slave_set(struct bonding *bond, | |||
740 | 736 | ||
741 | /* check to see if we are clearing active */ | 737 | /* check to see if we are clearing active */ |
742 | if (!slave_dev) { | 738 | if (!slave_dev) { |
743 | pr_info("%s: Clearing current active slave\n", bond->dev->name); | 739 | netdev_info(bond->dev, "Clearing current active slave\n"); |
744 | RCU_INIT_POINTER(bond->curr_active_slave, NULL); | 740 | RCU_INIT_POINTER(bond->curr_active_slave, NULL); |
745 | bond_select_active_slave(bond); | 741 | bond_select_active_slave(bond); |
746 | } else { | 742 | } else { |
@@ -751,18 +747,18 @@ static int bond_option_active_slave_set(struct bonding *bond, | |||
751 | 747 | ||
752 | if (new_active == old_active) { | 748 | if (new_active == old_active) { |
753 | /* do nothing */ | 749 | /* do nothing */ |
754 | pr_info("%s: %s is already the current active slave\n", | 750 | netdev_info(bond->dev, "%s is already the current active slave\n", |
755 | bond->dev->name, new_active->dev->name); | 751 | new_active->dev->name); |
756 | } else { | 752 | } else { |
757 | if (old_active && (new_active->link == BOND_LINK_UP) && | 753 | if (old_active && (new_active->link == BOND_LINK_UP) && |
758 | bond_slave_is_up(new_active)) { | 754 | bond_slave_is_up(new_active)) { |
759 | pr_info("%s: Setting %s as active slave\n", | 755 | netdev_info(bond->dev, "Setting %s as active slave\n", |
760 | bond->dev->name, new_active->dev->name); | 756 | new_active->dev->name); |
761 | bond_change_active_slave(bond, new_active); | 757 | bond_change_active_slave(bond, new_active); |
762 | } else { | 758 | } else { |
763 | pr_err("%s: Could not set %s as active slave; either %s is down or the link is down\n", | 759 | netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n", |
764 | bond->dev->name, new_active->dev->name, | 760 | new_active->dev->name, |
765 | new_active->dev->name); | 761 | new_active->dev->name); |
766 | ret = -EINVAL; | 762 | ret = -EINVAL; |
767 | } | 763 | } |
768 | } | 764 | } |
@@ -781,20 +777,17 @@ static int bond_option_active_slave_set(struct bonding *bond, | |||
781 | static int bond_option_miimon_set(struct bonding *bond, | 777 | static int bond_option_miimon_set(struct bonding *bond, |
782 | const struct bond_opt_value *newval) | 778 | const struct bond_opt_value *newval) |
783 | { | 779 | { |
784 | pr_info("%s: Setting MII monitoring interval to %llu\n", | 780 | netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n", |
785 | bond->dev->name, newval->value); | 781 | newval->value); |
786 | bond->params.miimon = newval->value; | 782 | bond->params.miimon = newval->value; |
787 | if (bond->params.updelay) | 783 | if (bond->params.updelay) |
788 | pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value\n", | 784 | netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n", |
789 | bond->dev->name, | ||
790 | bond->params.updelay * bond->params.miimon); | 785 | bond->params.updelay * bond->params.miimon); |
791 | if (bond->params.downdelay) | 786 | if (bond->params.downdelay) |
792 | pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n", | 787 | netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n", |
793 | bond->dev->name, | 788 | bond->params.downdelay * bond->params.miimon); |
794 | bond->params.downdelay * bond->params.miimon); | ||
795 | if (newval->value && bond->params.arp_interval) { | 789 | if (newval->value && bond->params.arp_interval) { |
796 | pr_info("%s: MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n", | 790 | netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n"); |
797 | bond->dev->name); | ||
798 | bond->params.arp_interval = 0; | 791 | bond->params.arp_interval = 0; |
799 | if (bond->params.arp_validate) | 792 | if (bond->params.arp_validate) |
800 | bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; | 793 | bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; |
@@ -826,20 +819,18 @@ static int bond_option_updelay_set(struct bonding *bond, | |||
826 | int value = newval->value; | 819 | int value = newval->value; |
827 | 820 | ||
828 | if (!bond->params.miimon) { | 821 | if (!bond->params.miimon) { |
829 | pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", | 822 | netdev_err(bond->dev, "Unable to set up delay as MII monitoring is disabled\n"); |
830 | bond->dev->name); | ||
831 | return -EPERM; | 823 | return -EPERM; |
832 | } | 824 | } |
833 | if ((value % bond->params.miimon) != 0) { | 825 | if ((value % bond->params.miimon) != 0) { |
834 | pr_warn("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", | 826 | netdev_warn(bond->dev, "up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", |
835 | bond->dev->name, value, | 827 | value, bond->params.miimon, |
836 | bond->params.miimon, | 828 | (value / bond->params.miimon) * |
837 | (value / bond->params.miimon) * | 829 | bond->params.miimon); |
838 | bond->params.miimon); | ||
839 | } | 830 | } |
840 | bond->params.updelay = value / bond->params.miimon; | 831 | bond->params.updelay = value / bond->params.miimon; |
841 | pr_info("%s: Setting up delay to %d\n", | 832 | netdev_info(bond->dev, "Setting up delay to %d\n", |
842 | bond->dev->name, bond->params.updelay * bond->params.miimon); | 833 | bond->params.updelay * bond->params.miimon); |
843 | 834 | ||
844 | return 0; | 835 | return 0; |
845 | } | 836 | } |
@@ -850,20 +841,18 @@ static int bond_option_downdelay_set(struct bonding *bond, | |||
850 | int value = newval->value; | 841 | int value = newval->value; |
851 | 842 | ||
852 | if (!bond->params.miimon) { | 843 | if (!bond->params.miimon) { |
853 | pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", | 844 | netdev_err(bond->dev, "Unable to set down delay as MII monitoring is disabled\n"); |
854 | bond->dev->name); | ||
855 | return -EPERM; | 845 | return -EPERM; |
856 | } | 846 | } |
857 | if ((value % bond->params.miimon) != 0) { | 847 | if ((value % bond->params.miimon) != 0) { |
858 | pr_warn("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", | 848 | netdev_warn(bond->dev, "down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", |
859 | bond->dev->name, value, | 849 | value, bond->params.miimon, |
860 | bond->params.miimon, | 850 | (value / bond->params.miimon) * |
861 | (value / bond->params.miimon) * | 851 | bond->params.miimon); |
862 | bond->params.miimon); | ||
863 | } | 852 | } |
864 | bond->params.downdelay = value / bond->params.miimon; | 853 | bond->params.downdelay = value / bond->params.miimon; |
865 | pr_info("%s: Setting down delay to %d\n", | 854 | netdev_info(bond->dev, "Setting down delay to %d\n", |
866 | bond->dev->name, bond->params.downdelay * bond->params.miimon); | 855 | bond->params.downdelay * bond->params.miimon); |
867 | 856 | ||
868 | return 0; | 857 | return 0; |
869 | } | 858 | } |
@@ -871,8 +860,8 @@ static int bond_option_downdelay_set(struct bonding *bond, | |||
871 | static int bond_option_use_carrier_set(struct bonding *bond, | 860 | static int bond_option_use_carrier_set(struct bonding *bond, |
872 | const struct bond_opt_value *newval) | 861 | const struct bond_opt_value *newval) |
873 | { | 862 | { |
874 | pr_info("%s: Setting use_carrier to %llu\n", | 863 | netdev_info(bond->dev, "Setting use_carrier to %llu\n", |
875 | bond->dev->name, newval->value); | 864 | newval->value); |
876 | bond->params.use_carrier = newval->value; | 865 | bond->params.use_carrier = newval->value; |
877 | 866 | ||
878 | return 0; | 867 | return 0; |
@@ -885,18 +874,16 @@ static int bond_option_use_carrier_set(struct bonding *bond, | |||
885 | static int bond_option_arp_interval_set(struct bonding *bond, | 874 | static int bond_option_arp_interval_set(struct bonding *bond, |
886 | const struct bond_opt_value *newval) | 875 | const struct bond_opt_value *newval) |
887 | { | 876 | { |
888 | pr_info("%s: Setting ARP monitoring interval to %llu\n", | 877 | netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n", |
889 | bond->dev->name, newval->value); | 878 | newval->value); |
890 | bond->params.arp_interval = newval->value; | 879 | bond->params.arp_interval = newval->value; |
891 | if (newval->value) { | 880 | if (newval->value) { |
892 | if (bond->params.miimon) { | 881 | if (bond->params.miimon) { |
893 | pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring\n", | 882 | netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n"); |
894 | bond->dev->name, bond->dev->name); | ||
895 | bond->params.miimon = 0; | 883 | bond->params.miimon = 0; |
896 | } | 884 | } |
897 | if (!bond->params.arp_targets[0]) | 885 | if (!bond->params.arp_targets[0]) |
898 | pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified\n", | 886 | netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n"); |
899 | bond->dev->name); | ||
900 | } | 887 | } |
901 | if (bond->dev->flags & IFF_UP) { | 888 | if (bond->dev->flags & IFF_UP) { |
902 | /* If the interface is up, we may need to fire off | 889 | /* If the interface is up, we may need to fire off |
@@ -940,24 +927,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target) | |||
940 | int ind; | 927 | int ind; |
941 | 928 | ||
942 | if (!bond_is_ip_target_ok(target)) { | 929 | if (!bond_is_ip_target_ok(target)) { |
943 | pr_err("%s: invalid ARP target %pI4 specified for addition\n", | 930 | netdev_err(bond->dev, "invalid ARP target %pI4 specified for addition\n", |
944 | bond->dev->name, &target); | 931 | &target); |
945 | return -EINVAL; | 932 | return -EINVAL; |
946 | } | 933 | } |
947 | 934 | ||
948 | if (bond_get_targets_ip(targets, target) != -1) { /* dup */ | 935 | if (bond_get_targets_ip(targets, target) != -1) { /* dup */ |
949 | pr_err("%s: ARP target %pI4 is already present\n", | 936 | netdev_err(bond->dev, "ARP target %pI4 is already present\n", |
950 | bond->dev->name, &target); | 937 | &target); |
951 | return -EINVAL; | 938 | return -EINVAL; |
952 | } | 939 | } |
953 | 940 | ||
954 | ind = bond_get_targets_ip(targets, 0); /* first free slot */ | 941 | ind = bond_get_targets_ip(targets, 0); /* first free slot */ |
955 | if (ind == -1) { | 942 | if (ind == -1) { |
956 | pr_err("%s: ARP target table is full!\n", bond->dev->name); | 943 | netdev_err(bond->dev, "ARP target table is full!\n"); |
957 | return -EINVAL; | 944 | return -EINVAL; |
958 | } | 945 | } |
959 | 946 | ||
960 | pr_info("%s: Adding ARP target %pI4\n", bond->dev->name, &target); | 947 | netdev_info(bond->dev, "Adding ARP target %pI4\n", &target); |
961 | 948 | ||
962 | _bond_options_arp_ip_target_set(bond, ind, target, jiffies); | 949 | _bond_options_arp_ip_target_set(bond, ind, target, jiffies); |
963 | 950 | ||
@@ -985,23 +972,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target) | |||
985 | int ind, i; | 972 | int ind, i; |
986 | 973 | ||
987 | if (!bond_is_ip_target_ok(target)) { | 974 | if (!bond_is_ip_target_ok(target)) { |
988 | pr_err("%s: invalid ARP target %pI4 specified for removal\n", | 975 | netdev_err(bond->dev, "invalid ARP target %pI4 specified for removal\n", |
989 | bond->dev->name, &target); | 976 | &target); |
990 | return -EINVAL; | 977 | return -EINVAL; |
991 | } | 978 | } |
992 | 979 | ||
993 | ind = bond_get_targets_ip(targets, target); | 980 | ind = bond_get_targets_ip(targets, target); |
994 | if (ind == -1) { | 981 | if (ind == -1) { |
995 | pr_err("%s: unable to remove nonexistent ARP target %pI4\n", | 982 | netdev_err(bond->dev, "unable to remove nonexistent ARP target %pI4\n", |
996 | bond->dev->name, &target); | 983 | &target); |
997 | return -EINVAL; | 984 | return -EINVAL; |
998 | } | 985 | } |
999 | 986 | ||
1000 | if (ind == 0 && !targets[1] && bond->params.arp_interval) | 987 | if (ind == 0 && !targets[1] && bond->params.arp_interval) |
1001 | pr_warn("%s: Removing last arp target with arp_interval on\n", | 988 | netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n"); |
1002 | bond->dev->name); | ||
1003 | 989 | ||
1004 | pr_info("%s: Removing ARP target %pI4\n", bond->dev->name, &target); | 990 | netdev_info(bond->dev, "Removing ARP target %pI4\n", &target); |
1005 | 991 | ||
1006 | /* not to race with bond_arp_rcv */ | 992 | /* not to race with bond_arp_rcv */ |
1007 | write_lock_bh(&bond->lock); | 993 | write_lock_bh(&bond->lock); |
@@ -1040,8 +1026,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, | |||
1040 | 1026 | ||
1041 | if (newval->string) { | 1027 | if (newval->string) { |
1042 | if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) { | 1028 | if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) { |
1043 | pr_err("%s: invalid ARP target %pI4 specified\n", | 1029 | netdev_err(bond->dev, "invalid ARP target %pI4 specified\n", |
1044 | bond->dev->name, &target); | 1030 | &target); |
1045 | return ret; | 1031 | return ret; |
1046 | } | 1032 | } |
1047 | if (newval->string[0] == '+') | 1033 | if (newval->string[0] == '+') |
@@ -1049,8 +1035,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, | |||
1049 | else if (newval->string[0] == '-') | 1035 | else if (newval->string[0] == '-') |
1050 | ret = bond_option_arp_ip_target_rem(bond, target); | 1036 | ret = bond_option_arp_ip_target_rem(bond, target); |
1051 | else | 1037 | else |
1052 | pr_err("no command found in arp_ip_targets file for bond %s - use +<addr> or -<addr>\n", | 1038 | netdev_err(bond->dev, "no command found in arp_ip_targets file - use +<addr> or -<addr>\n"); |
1053 | bond->dev->name); | ||
1054 | } else { | 1039 | } else { |
1055 | target = newval->value; | 1040 | target = newval->value; |
1056 | ret = bond_option_arp_ip_target_add(bond, target); | 1041 | ret = bond_option_arp_ip_target_add(bond, target); |
@@ -1062,8 +1047,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, | |||
1062 | static int bond_option_arp_validate_set(struct bonding *bond, | 1047 | static int bond_option_arp_validate_set(struct bonding *bond, |
1063 | const struct bond_opt_value *newval) | 1048 | const struct bond_opt_value *newval) |
1064 | { | 1049 | { |
1065 | pr_info("%s: Setting arp_validate to %s (%llu)\n", | 1050 | netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n", |
1066 | bond->dev->name, newval->string, newval->value); | 1051 | newval->string, newval->value); |
1067 | 1052 | ||
1068 | if (bond->dev->flags & IFF_UP) { | 1053 | if (bond->dev->flags & IFF_UP) { |
1069 | if (!newval->value) | 1054 | if (!newval->value) |
@@ -1079,8 +1064,8 @@ static int bond_option_arp_validate_set(struct bonding *bond, | |||
1079 | static int bond_option_arp_all_targets_set(struct bonding *bond, | 1064 | static int bond_option_arp_all_targets_set(struct bonding *bond, |
1080 | const struct bond_opt_value *newval) | 1065 | const struct bond_opt_value *newval) |
1081 | { | 1066 | { |
1082 | pr_info("%s: Setting arp_all_targets to %s (%llu)\n", | 1067 | netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n", |
1083 | bond->dev->name, newval->string, newval->value); | 1068 | newval->string, newval->value); |
1084 | bond->params.arp_all_targets = newval->value; | 1069 | bond->params.arp_all_targets = newval->value; |
1085 | 1070 | ||
1086 | return 0; | 1071 | return 0; |
@@ -1102,7 +1087,7 @@ static int bond_option_primary_set(struct bonding *bond, | |||
1102 | *p = '\0'; | 1087 | *p = '\0'; |
1103 | /* check to see if we are clearing primary */ | 1088 | /* check to see if we are clearing primary */ |
1104 | if (!strlen(primary)) { | 1089 | if (!strlen(primary)) { |
1105 | pr_info("%s: Setting primary slave to None\n", bond->dev->name); | 1090 | netdev_info(bond->dev, "Setting primary slave to None\n"); |
1106 | bond->primary_slave = NULL; | 1091 | bond->primary_slave = NULL; |
1107 | memset(bond->params.primary, 0, sizeof(bond->params.primary)); | 1092 | memset(bond->params.primary, 0, sizeof(bond->params.primary)); |
1108 | bond_select_active_slave(bond); | 1093 | bond_select_active_slave(bond); |
@@ -1111,8 +1096,8 @@ static int bond_option_primary_set(struct bonding *bond, | |||
1111 | 1096 | ||
1112 | bond_for_each_slave(bond, slave, iter) { | 1097 | bond_for_each_slave(bond, slave, iter) { |
1113 | if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) { | 1098 | if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) { |
1114 | pr_info("%s: Setting %s as primary slave\n", | 1099 | netdev_info(bond->dev, "Setting %s as primary slave\n", |
1115 | bond->dev->name, slave->dev->name); | 1100 | slave->dev->name); |
1116 | bond->primary_slave = slave; | 1101 | bond->primary_slave = slave; |
1117 | strcpy(bond->params.primary, slave->dev->name); | 1102 | strcpy(bond->params.primary, slave->dev->name); |
1118 | bond_select_active_slave(bond); | 1103 | bond_select_active_slave(bond); |
@@ -1121,15 +1106,15 @@ static int bond_option_primary_set(struct bonding *bond, | |||
1121 | } | 1106 | } |
1122 | 1107 | ||
1123 | if (bond->primary_slave) { | 1108 | if (bond->primary_slave) { |
1124 | pr_info("%s: Setting primary slave to None\n", bond->dev->name); | 1109 | netdev_info(bond->dev, "Setting primary slave to None\n"); |
1125 | bond->primary_slave = NULL; | 1110 | bond->primary_slave = NULL; |
1126 | bond_select_active_slave(bond); | 1111 | bond_select_active_slave(bond); |
1127 | } | 1112 | } |
1128 | strncpy(bond->params.primary, primary, IFNAMSIZ); | 1113 | strncpy(bond->params.primary, primary, IFNAMSIZ); |
1129 | bond->params.primary[IFNAMSIZ - 1] = 0; | 1114 | bond->params.primary[IFNAMSIZ - 1] = 0; |
1130 | 1115 | ||
1131 | pr_info("%s: Recording %s as primary, but it has not been enslaved to %s yet\n", | 1116 | netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n", |
1132 | bond->dev->name, primary, bond->dev->name); | 1117 | primary, bond->dev->name); |
1133 | 1118 | ||
1134 | out: | 1119 | out: |
1135 | write_unlock_bh(&bond->curr_slave_lock); | 1120 | write_unlock_bh(&bond->curr_slave_lock); |
@@ -1142,8 +1127,8 @@ out: | |||
1142 | static int bond_option_primary_reselect_set(struct bonding *bond, | 1127 | static int bond_option_primary_reselect_set(struct bonding *bond, |
1143 | const struct bond_opt_value *newval) | 1128 | const struct bond_opt_value *newval) |
1144 | { | 1129 | { |
1145 | pr_info("%s: Setting primary_reselect to %s (%llu)\n", | 1130 | netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n", |
1146 | bond->dev->name, newval->string, newval->value); | 1131 | newval->string, newval->value); |
1147 | bond->params.primary_reselect = newval->value; | 1132 | bond->params.primary_reselect = newval->value; |
1148 | 1133 | ||
1149 | block_netpoll_tx(); | 1134 | block_netpoll_tx(); |
@@ -1158,8 +1143,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond, | |||
1158 | static int bond_option_fail_over_mac_set(struct bonding *bond, | 1143 | static int bond_option_fail_over_mac_set(struct bonding *bond, |
1159 | const struct bond_opt_value *newval) | 1144 | const struct bond_opt_value *newval) |
1160 | { | 1145 | { |
1161 | pr_info("%s: Setting fail_over_mac to %s (%llu)\n", | 1146 | netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n", |
1162 | bond->dev->name, newval->string, newval->value); | 1147 | newval->string, newval->value); |
1163 | bond->params.fail_over_mac = newval->value; | 1148 | bond->params.fail_over_mac = newval->value; |
1164 | 1149 | ||
1165 | return 0; | 1150 | return 0; |
@@ -1168,8 +1153,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond, | |||
1168 | static int bond_option_xmit_hash_policy_set(struct bonding *bond, | 1153 | static int bond_option_xmit_hash_policy_set(struct bonding *bond, |
1169 | const struct bond_opt_value *newval) | 1154 | const struct bond_opt_value *newval) |
1170 | { | 1155 | { |
1171 | pr_info("%s: Setting xmit hash policy to %s (%llu)\n", | 1156 | netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n", |
1172 | bond->dev->name, newval->string, newval->value); | 1157 | newval->string, newval->value); |
1173 | bond->params.xmit_policy = newval->value; | 1158 | bond->params.xmit_policy = newval->value; |
1174 | 1159 | ||
1175 | return 0; | 1160 | return 0; |
@@ -1178,8 +1163,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond, | |||
1178 | static int bond_option_resend_igmp_set(struct bonding *bond, | 1163 | static int bond_option_resend_igmp_set(struct bonding *bond, |
1179 | const struct bond_opt_value *newval) | 1164 | const struct bond_opt_value *newval) |
1180 | { | 1165 | { |
1181 | pr_info("%s: Setting resend_igmp to %llu\n", | 1166 | netdev_info(bond->dev, "Setting resend_igmp to %llu\n", |
1182 | bond->dev->name, newval->value); | 1167 | newval->value); |
1183 | bond->params.resend_igmp = newval->value; | 1168 | bond->params.resend_igmp = newval->value; |
1184 | 1169 | ||
1185 | return 0; | 1170 | return 0; |
@@ -1217,8 +1202,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond, | |||
1217 | static int bond_option_min_links_set(struct bonding *bond, | 1202 | static int bond_option_min_links_set(struct bonding *bond, |
1218 | const struct bond_opt_value *newval) | 1203 | const struct bond_opt_value *newval) |
1219 | { | 1204 | { |
1220 | pr_info("%s: Setting min links value to %llu\n", | 1205 | netdev_info(bond->dev, "Setting min links value to %llu\n", |
1221 | bond->dev->name, newval->value); | 1206 | newval->value); |
1222 | bond->params.min_links = newval->value; | 1207 | bond->params.min_links = newval->value; |
1223 | 1208 | ||
1224 | return 0; | 1209 | return 0; |
@@ -1253,8 +1238,8 @@ static int bond_option_pps_set(struct bonding *bond, | |||
1253 | static int bond_option_lacp_rate_set(struct bonding *bond, | 1238 | static int bond_option_lacp_rate_set(struct bonding *bond, |
1254 | const struct bond_opt_value *newval) | 1239 | const struct bond_opt_value *newval) |
1255 | { | 1240 | { |
1256 | pr_info("%s: Setting LACP rate to %s (%llu)\n", | 1241 | netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n", |
1257 | bond->dev->name, newval->string, newval->value); | 1242 | newval->string, newval->value); |
1258 | bond->params.lacp_fast = newval->value; | 1243 | bond->params.lacp_fast = newval->value; |
1259 | bond_3ad_update_lacp_rate(bond); | 1244 | bond_3ad_update_lacp_rate(bond); |
1260 | 1245 | ||
@@ -1264,8 +1249,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond, | |||
1264 | static int bond_option_ad_select_set(struct bonding *bond, | 1249 | static int bond_option_ad_select_set(struct bonding *bond, |
1265 | const struct bond_opt_value *newval) | 1250 | const struct bond_opt_value *newval) |
1266 | { | 1251 | { |
1267 | pr_info("%s: Setting ad_select to %s (%llu)\n", | 1252 | netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n", |
1268 | bond->dev->name, newval->string, newval->value); | 1253 | newval->string, newval->value); |
1269 | bond->params.ad_select = newval->value; | 1254 | bond->params.ad_select = newval->value; |
1270 | 1255 | ||
1271 | return 0; | 1256 | return 0; |
@@ -1326,7 +1311,7 @@ out: | |||
1326 | return ret; | 1311 | return ret; |
1327 | 1312 | ||
1328 | err_no_cmd: | 1313 | err_no_cmd: |
1329 | pr_info("invalid input for queue_id set for %s\n", bond->dev->name); | 1314 | netdev_info(bond->dev, "invalid input for queue_id set\n"); |
1330 | ret = -EPERM; | 1315 | ret = -EPERM; |
1331 | goto out; | 1316 | goto out; |
1332 | 1317 | ||
@@ -1348,20 +1333,20 @@ static int bond_option_slaves_set(struct bonding *bond, | |||
1348 | 1333 | ||
1349 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); | 1334 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); |
1350 | if (!dev) { | 1335 | if (!dev) { |
1351 | pr_info("%s: interface %s does not exist!\n", | 1336 | netdev_info(bond->dev, "interface %s does not exist!\n", |
1352 | bond->dev->name, ifname); | 1337 | ifname); |
1353 | ret = -ENODEV; | 1338 | ret = -ENODEV; |
1354 | goto out; | 1339 | goto out; |
1355 | } | 1340 | } |
1356 | 1341 | ||
1357 | switch (command[0]) { | 1342 | switch (command[0]) { |
1358 | case '+': | 1343 | case '+': |
1359 | pr_info("%s: Adding slave %s\n", bond->dev->name, dev->name); | 1344 | netdev_info(bond->dev, "Adding slave %s\n", dev->name); |
1360 | ret = bond_enslave(bond->dev, dev); | 1345 | ret = bond_enslave(bond->dev, dev); |
1361 | break; | 1346 | break; |
1362 | 1347 | ||
1363 | case '-': | 1348 | case '-': |
1364 | pr_info("%s: Removing slave %s\n", bond->dev->name, dev->name); | 1349 | netdev_info(bond->dev, "Removing slave %s\n", dev->name); |
1365 | ret = bond_release(bond->dev, dev); | 1350 | ret = bond_release(bond->dev, dev); |
1366 | break; | 1351 | break; |
1367 | 1352 | ||
@@ -1373,8 +1358,7 @@ out: | |||
1373 | return ret; | 1358 | return ret; |
1374 | 1359 | ||
1375 | err_no_cmd: | 1360 | err_no_cmd: |
1376 | pr_err("no command found in slaves file for bond %s - use +ifname or -ifname\n", | 1361 | netdev_err(bond->dev, "no command found in slaves file - use +ifname or -ifname\n"); |
1377 | bond->dev->name); | ||
1378 | ret = -EPERM; | 1362 | ret = -EPERM; |
1379 | goto out; | 1363 | goto out; |
1380 | } | 1364 | } |
@@ -1382,8 +1366,8 @@ err_no_cmd: | |||
1382 | static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, | 1366 | static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, |
1383 | const struct bond_opt_value *newval) | 1367 | const struct bond_opt_value *newval) |
1384 | { | 1368 | { |
1385 | pr_info("%s: Setting dynamic-lb to %s (%llu)\n", | 1369 | netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n", |
1386 | bond->dev->name, newval->string, newval->value); | 1370 | newval->string, newval->value); |
1387 | bond->params.tlb_dynamic_lb = newval->value; | 1371 | bond->params.tlb_dynamic_lb = newval->value; |
1388 | 1372 | ||
1389 | return 0; | 1373 | return 0; |
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c index b215b479bb3a..de62c0385dfb 100644 --- a/drivers/net/bonding/bond_procfs.c +++ b/drivers/net/bonding/bond_procfs.c | |||
@@ -252,8 +252,8 @@ void bond_create_proc_entry(struct bonding *bond) | |||
252 | S_IRUGO, bn->proc_dir, | 252 | S_IRUGO, bn->proc_dir, |
253 | &bond_info_fops, bond); | 253 | &bond_info_fops, bond); |
254 | if (bond->proc_entry == NULL) | 254 | if (bond->proc_entry == NULL) |
255 | pr_warn("Warning: Cannot create /proc/net/%s/%s\n", | 255 | netdev_warn(bond_dev, "Cannot create /proc/net/%s/%s\n", |
256 | DRV_NAME, bond_dev->name); | 256 | DRV_NAME, bond_dev->name); |
257 | else | 257 | else |
258 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); | 258 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); |
259 | } | 259 | } |