Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'bonding-next'

Veaceslav Falico says:

====================
bonding: convert pr_* to netdev_*

Currently bonding uses pr_info/warn/etc. function to print something, while
it's encouraged to use netdev_info/warn/etc. in net/.

This patchset converts them where possible (i.e. where we have a working
net_device). Also, convert pr_ratelimit* to net_() and remove the pr_fmt,
to unify netdev_* and pr_* outputs.
====================

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

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