diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:33:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:33:18 -0500 |
commit | 59be2e04e50ac9947e4356c10099f49977f5f74d (patch) | |
tree | 56aa00a4499a1543da8728cb84b10bec5b211280 | |
parent | e69381b4175ba162229646f6753ff1d87c24d468 (diff) | |
parent | 503914cf4a4b5dbe3f844e0a92f412ae99fde70e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
net: sh_eth alignment fix for sh7724 using NET_IP_ALIGN V2
ixgbe: allow tx of pre-formatted vlan tagged packets
ixgbe: Fix 82598 premature copper PHY link indicatation
ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters
bcm63xx_enet: fix compilation failure after get_stats_count removal
packet: dont call sleeping functions while holding rcu_read_lock()
tcp: Revert per-route SACK/DSACK/TIMESTAMP changes.
ipvs: zero usvc and udest
netfilter: fix crashes in bridge netfilter caused by fragment jumps
ipv6: reassembly: use seperate reassembly queues for conntrack and local delivery
sky2: leave PCI config space writeable
sky2: print Optima chip name
x25: Update maintainer.
ipvs: fix synchronization on connection close
netfilter: xtables: document minimal required version
drivers/net/bonding/: : use pr_fmt
can: CAN_MCP251X should depend on HAS_DMA
drivers/net/usb: Correct code taking the size of a pointer
drivers/net/cpmac.c: Correct code taking the size of a pointer
drivers/net/sfc: Correct code taking the size of a pointer
...
52 files changed, 745 insertions, 886 deletions
diff --git a/Documentation/Changes b/Documentation/Changes index 6d0f1efc5bf6..f08b313cd235 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -49,6 +49,8 @@ o oprofile 0.9 # oprofiled --version | |||
49 | o udev 081 # udevinfo -V | 49 | o udev 081 # udevinfo -V |
50 | o grub 0.93 # grub --version | 50 | o grub 0.93 # grub --version |
51 | o mcelog 0.6 | 51 | o mcelog 0.6 |
52 | o iptables 1.4.1 # iptables -V | ||
53 | |||
52 | 54 | ||
53 | Kernel compilation | 55 | Kernel compilation |
54 | ================== | 56 | ================== |
diff --git a/MAINTAINERS b/MAINTAINERS index 0a32c3ec6b1c..d6a27110a747 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -5991,9 +5991,9 @@ F: sound/soc/codecs/wm8350.* | |||
5991 | F: sound/soc/codecs/wm8400.* | 5991 | F: sound/soc/codecs/wm8400.* |
5992 | 5992 | ||
5993 | X.25 NETWORK LAYER | 5993 | X.25 NETWORK LAYER |
5994 | M: Henner Eisen <eis@baty.hanse.de> | 5994 | M: Andrew Hendry <andrew.hendry@gmail.com> |
5995 | L: linux-x25@vger.kernel.org | 5995 | L: linux-x25@vger.kernel.org |
5996 | S: Maintained | 5996 | S: Odd Fixes |
5997 | F: Documentation/networking/x25* | 5997 | F: Documentation/networking/x25* |
5998 | F: include/net/x25* | 5998 | F: include/net/x25* |
5999 | F: net/x25/ | 5999 | F: net/x25/ |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index f734b345ac71..25a4c86f839b 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -557,7 +557,7 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) { | |||
557 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); | 557 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); |
558 | } /* while */ | 558 | } /* while */ |
559 | // Move this VCI number into this location of the CBR Sched table. | 559 | // Move this VCI number into this location of the CBR Sched table. |
560 | memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex,sizeof(TstSchedTbl)); | 560 | memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex, sizeof(*TstSchedTbl)); |
561 | dev->CbrRemEntries--; | 561 | dev->CbrRemEntries--; |
562 | toBeAssigned--; | 562 | toBeAssigned--; |
563 | } /* while */ | 563 | } /* while */ |
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c index 1f6c5486d715..0bd47d32ec42 100644 --- a/drivers/net/bcm63xx_enet.c +++ b/drivers/net/bcm63xx_enet.c | |||
@@ -1245,9 +1245,15 @@ static void bcm_enet_get_drvinfo(struct net_device *netdev, | |||
1245 | drvinfo->n_stats = BCM_ENET_STATS_LEN; | 1245 | drvinfo->n_stats = BCM_ENET_STATS_LEN; |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | static int bcm_enet_get_stats_count(struct net_device *netdev) | 1248 | static int bcm_enet_get_sset_count(struct net_device *netdev, |
1249 | int string_set) | ||
1249 | { | 1250 | { |
1250 | return BCM_ENET_STATS_LEN; | 1251 | switch (string_set) { |
1252 | case ETH_SS_STATS: | ||
1253 | return BCM_ENET_STATS_LEN; | ||
1254 | default: | ||
1255 | return -EINVAL; | ||
1256 | } | ||
1251 | } | 1257 | } |
1252 | 1258 | ||
1253 | static void bcm_enet_get_strings(struct net_device *netdev, | 1259 | static void bcm_enet_get_strings(struct net_device *netdev, |
@@ -1473,7 +1479,7 @@ static int bcm_enet_set_pauseparam(struct net_device *dev, | |||
1473 | 1479 | ||
1474 | static struct ethtool_ops bcm_enet_ethtool_ops = { | 1480 | static struct ethtool_ops bcm_enet_ethtool_ops = { |
1475 | .get_strings = bcm_enet_get_strings, | 1481 | .get_strings = bcm_enet_get_strings, |
1476 | .get_stats_count = bcm_enet_get_stats_count, | 1482 | .get_sset_count = bcm_enet_get_sset_count, |
1477 | .get_ethtool_stats = bcm_enet_get_ethtool_stats, | 1483 | .get_ethtool_stats = bcm_enet_get_ethtool_stats, |
1478 | .get_settings = bcm_enet_get_settings, | 1484 | .get_settings = bcm_enet_get_settings, |
1479 | .set_settings = bcm_enet_set_settings, | 1485 | .set_settings = bcm_enet_set_settings, |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index d69e6838f21e..0fb7a4964e75 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
24 | #include <linux/if_ether.h> | 26 | #include <linux/if_ether.h> |
25 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
@@ -352,7 +354,8 @@ static u16 __get_link_speed(struct port *port) | |||
352 | } | 354 | } |
353 | } | 355 | } |
354 | 356 | ||
355 | pr_debug("Port %d Received link speed %d update from adapter\n", port->actor_port_number, speed); | 357 | pr_debug("Port %d Received link speed %d update from adapter\n", |
358 | port->actor_port_number, speed); | ||
356 | return speed; | 359 | return speed; |
357 | } | 360 | } |
358 | 361 | ||
@@ -378,12 +381,14 @@ static u8 __get_duplex(struct port *port) | |||
378 | switch (slave->duplex) { | 381 | switch (slave->duplex) { |
379 | case DUPLEX_FULL: | 382 | case DUPLEX_FULL: |
380 | retval=0x1; | 383 | retval=0x1; |
381 | pr_debug("Port %d Received status full duplex update from adapter\n", port->actor_port_number); | 384 | pr_debug("Port %d Received status full duplex update from adapter\n", |
385 | port->actor_port_number); | ||
382 | break; | 386 | break; |
383 | case DUPLEX_HALF: | 387 | case DUPLEX_HALF: |
384 | default: | 388 | default: |
385 | retval=0x0; | 389 | retval=0x0; |
386 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", port->actor_port_number); | 390 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", |
391 | port->actor_port_number); | ||
387 | break; | 392 | break; |
388 | } | 393 | } |
389 | } | 394 | } |
@@ -980,7 +985,9 @@ static void ad_mux_machine(struct port *port) | |||
980 | 985 | ||
981 | // check if the state machine was changed | 986 | // check if the state machine was changed |
982 | if (port->sm_mux_state != last_state) { | 987 | if (port->sm_mux_state != last_state) { |
983 | pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_mux_state); | 988 | pr_debug("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n", |
989 | port->actor_port_number, last_state, | ||
990 | port->sm_mux_state); | ||
984 | switch (port->sm_mux_state) { | 991 | switch (port->sm_mux_state) { |
985 | case AD_MUX_DETACHED: | 992 | case AD_MUX_DETACHED: |
986 | __detach_bond_from_agg(port); | 993 | __detach_bond_from_agg(port); |
@@ -1079,7 +1086,9 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) | |||
1079 | 1086 | ||
1080 | // check if the State machine was changed or new lacpdu arrived | 1087 | // check if the State machine was changed or new lacpdu arrived |
1081 | if ((port->sm_rx_state != last_state) || (lacpdu)) { | 1088 | if ((port->sm_rx_state != last_state) || (lacpdu)) { |
1082 | pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_rx_state); | 1089 | pr_debug("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n", |
1090 | port->actor_port_number, last_state, | ||
1091 | port->sm_rx_state); | ||
1083 | switch (port->sm_rx_state) { | 1092 | switch (port->sm_rx_state) { |
1084 | case AD_RX_INITIALIZE: | 1093 | case AD_RX_INITIALIZE: |
1085 | if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) { | 1094 | if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_BITS)) { |
@@ -1126,9 +1135,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) | |||
1126 | // detect loopback situation | 1135 | // detect loopback situation |
1127 | if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { | 1136 | if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { |
1128 | // INFO_RECEIVED_LOOPBACK_FRAMES | 1137 | // INFO_RECEIVED_LOOPBACK_FRAMES |
1129 | pr_err(DRV_NAME ": %s: An illegal loopback occurred on " | 1138 | pr_err("%s: An illegal loopback occurred on adapter (%s).\n" |
1130 | "adapter (%s). Check the configuration to verify that all " | 1139 | "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", |
1131 | "Adapters are connected to 802.3ad compliant switch ports\n", | ||
1132 | port->slave->dev->master->name, port->slave->dev->name); | 1140 | port->slave->dev->master->name, port->slave->dev->name); |
1133 | __release_rx_machine_lock(port); | 1141 | __release_rx_machine_lock(port); |
1134 | return; | 1142 | return; |
@@ -1166,7 +1174,8 @@ static void ad_tx_machine(struct port *port) | |||
1166 | __update_lacpdu_from_port(port); | 1174 | __update_lacpdu_from_port(port); |
1167 | 1175 | ||
1168 | if (ad_lacpdu_send(port) >= 0) { | 1176 | if (ad_lacpdu_send(port) >= 0) { |
1169 | pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); | 1177 | pr_debug("Sent LACPDU on port %d\n", |
1178 | port->actor_port_number); | ||
1170 | 1179 | ||
1171 | /* mark ntt as false, so it will not be sent again until | 1180 | /* mark ntt as false, so it will not be sent again until |
1172 | demanded */ | 1181 | demanded */ |
@@ -1241,7 +1250,9 @@ static void ad_periodic_machine(struct port *port) | |||
1241 | 1250 | ||
1242 | // check if the state machine was changed | 1251 | // check if the state machine was changed |
1243 | if (port->sm_periodic_state != last_state) { | 1252 | if (port->sm_periodic_state != last_state) { |
1244 | pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", port->actor_port_number, last_state, port->sm_periodic_state); | 1253 | pr_debug("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n", |
1254 | port->actor_port_number, last_state, | ||
1255 | port->sm_periodic_state); | ||
1245 | switch (port->sm_periodic_state) { | 1256 | switch (port->sm_periodic_state) { |
1246 | case AD_NO_PERIODIC: | 1257 | case AD_NO_PERIODIC: |
1247 | port->sm_periodic_timer_counter = 0; // zero timer | 1258 | port->sm_periodic_timer_counter = 0; // zero timer |
@@ -1298,7 +1309,9 @@ static void ad_port_selection_logic(struct port *port) | |||
1298 | port->next_port_in_aggregator=NULL; | 1309 | port->next_port_in_aggregator=NULL; |
1299 | port->actor_port_aggregator_identifier=0; | 1310 | port->actor_port_aggregator_identifier=0; |
1300 | 1311 | ||
1301 | pr_debug("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier); | 1312 | pr_debug("Port %d left LAG %d\n", |
1313 | port->actor_port_number, | ||
1314 | temp_aggregator->aggregator_identifier); | ||
1302 | // if the aggregator is empty, clear its parameters, and set it ready to be attached | 1315 | // if the aggregator is empty, clear its parameters, and set it ready to be attached |
1303 | if (!temp_aggregator->lag_ports) { | 1316 | if (!temp_aggregator->lag_ports) { |
1304 | ad_clear_agg(temp_aggregator); | 1317 | ad_clear_agg(temp_aggregator); |
@@ -1307,9 +1320,7 @@ static void ad_port_selection_logic(struct port *port) | |||
1307 | } | 1320 | } |
1308 | } | 1321 | } |
1309 | if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list | 1322 | if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list |
1310 | pr_warning(DRV_NAME ": %s: Warning: Port %d (on %s) " | 1323 | pr_warning("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", |
1311 | "was related to aggregator %d but was not " | ||
1312 | "on its port list\n", | ||
1313 | port->slave->dev->master->name, | 1324 | port->slave->dev->master->name, |
1314 | port->actor_port_number, | 1325 | port->actor_port_number, |
1315 | port->slave->dev->name, | 1326 | port->slave->dev->name, |
@@ -1343,7 +1354,9 @@ static void ad_port_selection_logic(struct port *port) | |||
1343 | port->next_port_in_aggregator=aggregator->lag_ports; | 1354 | port->next_port_in_aggregator=aggregator->lag_ports; |
1344 | port->aggregator->num_of_ports++; | 1355 | port->aggregator->num_of_ports++; |
1345 | aggregator->lag_ports=port; | 1356 | aggregator->lag_ports=port; |
1346 | pr_debug("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1357 | pr_debug("Port %d joined LAG %d(existing LAG)\n", |
1358 | port->actor_port_number, | ||
1359 | port->aggregator->aggregator_identifier); | ||
1347 | 1360 | ||
1348 | // mark this port as selected | 1361 | // mark this port as selected |
1349 | port->sm_vars |= AD_PORT_SELECTED; | 1362 | port->sm_vars |= AD_PORT_SELECTED; |
@@ -1380,10 +1393,11 @@ static void ad_port_selection_logic(struct port *port) | |||
1380 | // mark this port as selected | 1393 | // mark this port as selected |
1381 | port->sm_vars |= AD_PORT_SELECTED; | 1394 | port->sm_vars |= AD_PORT_SELECTED; |
1382 | 1395 | ||
1383 | pr_debug("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1396 | pr_debug("Port %d joined LAG %d(new LAG)\n", |
1397 | port->actor_port_number, | ||
1398 | port->aggregator->aggregator_identifier); | ||
1384 | } else { | 1399 | } else { |
1385 | pr_err(DRV_NAME ": %s: Port %d (on %s) did not find " | 1400 | pr_err("%s: Port %d (on %s) did not find a suitable aggregator\n", |
1386 | "a suitable aggregator\n", | ||
1387 | port->slave->dev->master->name, | 1401 | port->slave->dev->master->name, |
1388 | port->actor_port_number, port->slave->dev->name); | 1402 | port->actor_port_number, port->slave->dev->name); |
1389 | } | 1403 | } |
@@ -1460,8 +1474,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, | |||
1460 | break; | 1474 | break; |
1461 | 1475 | ||
1462 | default: | 1476 | default: |
1463 | pr_warning(DRV_NAME | 1477 | pr_warning("%s: Impossible agg select mode %d\n", |
1464 | ": %s: Impossible agg select mode %d\n", | ||
1465 | curr->slave->dev->master->name, | 1478 | curr->slave->dev->master->name, |
1466 | __get_agg_selection_mode(curr->lag_ports)); | 1479 | __get_agg_selection_mode(curr->lag_ports)); |
1467 | break; | 1480 | break; |
@@ -1546,40 +1559,38 @@ static void ad_agg_selection_logic(struct aggregator *agg) | |||
1546 | // if there is new best aggregator, activate it | 1559 | // if there is new best aggregator, activate it |
1547 | if (best) { | 1560 | if (best) { |
1548 | pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1561 | pr_debug("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1549 | best->aggregator_identifier, best->num_of_ports, | 1562 | best->aggregator_identifier, best->num_of_ports, |
1550 | best->actor_oper_aggregator_key, | 1563 | best->actor_oper_aggregator_key, |
1551 | best->partner_oper_aggregator_key, | 1564 | best->partner_oper_aggregator_key, |
1552 | best->is_individual, best->is_active); | 1565 | best->is_individual, best->is_active); |
1553 | pr_debug("best ports %p slave %p %s\n", | 1566 | pr_debug("best ports %p slave %p %s\n", |
1554 | best->lag_ports, best->slave, | 1567 | best->lag_ports, best->slave, |
1555 | best->slave ? best->slave->dev->name : "NULL"); | 1568 | best->slave ? best->slave->dev->name : "NULL"); |
1556 | 1569 | ||
1557 | for (agg = __get_first_agg(best->lag_ports); agg; | 1570 | for (agg = __get_first_agg(best->lag_ports); agg; |
1558 | agg = __get_next_agg(agg)) { | 1571 | agg = __get_next_agg(agg)) { |
1559 | 1572 | ||
1560 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1573 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1561 | agg->aggregator_identifier, agg->num_of_ports, | 1574 | agg->aggregator_identifier, agg->num_of_ports, |
1562 | agg->actor_oper_aggregator_key, | 1575 | agg->actor_oper_aggregator_key, |
1563 | agg->partner_oper_aggregator_key, | 1576 | agg->partner_oper_aggregator_key, |
1564 | agg->is_individual, agg->is_active); | 1577 | agg->is_individual, agg->is_active); |
1565 | } | 1578 | } |
1566 | 1579 | ||
1567 | // check if any partner replys | 1580 | // check if any partner replys |
1568 | if (best->is_individual) { | 1581 | if (best->is_individual) { |
1569 | pr_warning(DRV_NAME ": %s: Warning: No 802.3ad" | 1582 | pr_warning("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", |
1570 | " response from the link partner for any" | 1583 | best->slave->dev->master->name); |
1571 | " adapters in the bond\n", | ||
1572 | best->slave->dev->master->name); | ||
1573 | } | 1584 | } |
1574 | 1585 | ||
1575 | best->is_active = 1; | 1586 | best->is_active = 1; |
1576 | pr_debug("LAG %d chosen as the active LAG\n", | 1587 | pr_debug("LAG %d chosen as the active LAG\n", |
1577 | best->aggregator_identifier); | 1588 | best->aggregator_identifier); |
1578 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", | 1589 | pr_debug("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", |
1579 | best->aggregator_identifier, best->num_of_ports, | 1590 | best->aggregator_identifier, best->num_of_ports, |
1580 | best->actor_oper_aggregator_key, | 1591 | best->actor_oper_aggregator_key, |
1581 | best->partner_oper_aggregator_key, | 1592 | best->partner_oper_aggregator_key, |
1582 | best->is_individual, best->is_active); | 1593 | best->is_individual, best->is_active); |
1583 | 1594 | ||
1584 | // disable the ports that were related to the former active_aggregator | 1595 | // disable the ports that were related to the former active_aggregator |
1585 | if (active) { | 1596 | if (active) { |
@@ -1633,7 +1644,8 @@ static void ad_clear_agg(struct aggregator *aggregator) | |||
1633 | aggregator->lag_ports = NULL; | 1644 | aggregator->lag_ports = NULL; |
1634 | aggregator->is_active = 0; | 1645 | aggregator->is_active = 0; |
1635 | aggregator->num_of_ports = 0; | 1646 | aggregator->num_of_ports = 0; |
1636 | pr_debug("LAG %d was cleared\n", aggregator->aggregator_identifier); | 1647 | pr_debug("LAG %d was cleared\n", |
1648 | aggregator->aggregator_identifier); | ||
1637 | } | 1649 | } |
1638 | } | 1650 | } |
1639 | 1651 | ||
@@ -1728,7 +1740,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast) | |||
1728 | static void ad_enable_collecting_distributing(struct port *port) | 1740 | static void ad_enable_collecting_distributing(struct port *port) |
1729 | { | 1741 | { |
1730 | if (port->aggregator->is_active) { | 1742 | if (port->aggregator->is_active) { |
1731 | pr_debug("Enabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1743 | pr_debug("Enabling port %d(LAG %d)\n", |
1744 | port->actor_port_number, | ||
1745 | port->aggregator->aggregator_identifier); | ||
1732 | __enable_port(port); | 1746 | __enable_port(port); |
1733 | } | 1747 | } |
1734 | } | 1748 | } |
@@ -1741,7 +1755,9 @@ static void ad_enable_collecting_distributing(struct port *port) | |||
1741 | static void ad_disable_collecting_distributing(struct port *port) | 1755 | static void ad_disable_collecting_distributing(struct port *port) |
1742 | { | 1756 | { |
1743 | if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { | 1757 | if (port->aggregator && MAC_ADDRESS_COMPARE(&(port->aggregator->partner_system), &(null_mac_addr))) { |
1744 | pr_debug("Disabling port %d(LAG %d)\n", port->actor_port_number, port->aggregator->aggregator_identifier); | 1758 | pr_debug("Disabling port %d(LAG %d)\n", |
1759 | port->actor_port_number, | ||
1760 | port->aggregator->aggregator_identifier); | ||
1745 | __disable_port(port); | 1761 | __disable_port(port); |
1746 | } | 1762 | } |
1747 | } | 1763 | } |
@@ -1779,7 +1795,8 @@ static void ad_marker_info_send(struct port *port) | |||
1779 | 1795 | ||
1780 | // send the marker information | 1796 | // send the marker information |
1781 | if (ad_marker_send(port, &marker) >= 0) { | 1797 | if (ad_marker_send(port, &marker) >= 0) { |
1782 | pr_debug("Sent Marker Information on port %d\n", port->actor_port_number); | 1798 | pr_debug("Sent Marker Information on port %d\n", |
1799 | port->actor_port_number); | ||
1783 | } | 1800 | } |
1784 | } | 1801 | } |
1785 | #endif | 1802 | #endif |
@@ -1803,7 +1820,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info, | |||
1803 | // send the marker response | 1820 | // send the marker response |
1804 | 1821 | ||
1805 | if (ad_marker_send(port, &marker) >= 0) { | 1822 | if (ad_marker_send(port, &marker) >= 0) { |
1806 | pr_debug("Sent Marker Response on port %d\n", port->actor_port_number); | 1823 | pr_debug("Sent Marker Response on port %d\n", |
1824 | port->actor_port_number); | ||
1807 | } | 1825 | } |
1808 | } | 1826 | } |
1809 | 1827 | ||
@@ -1889,8 +1907,7 @@ int bond_3ad_bind_slave(struct slave *slave) | |||
1889 | struct aggregator *aggregator; | 1907 | struct aggregator *aggregator; |
1890 | 1908 | ||
1891 | if (bond == NULL) { | 1909 | if (bond == NULL) { |
1892 | pr_err(DRV_NAME ": %s: The slave %s is not attached to " | 1910 | pr_err("%s: The slave %s is not attached to its bond\n", |
1893 | "its bond\n", | ||
1894 | slave->dev->master->name, slave->dev->name); | 1911 | slave->dev->master->name, slave->dev->name); |
1895 | return -1; | 1912 | return -1; |
1896 | } | 1913 | } |
@@ -1966,13 +1983,13 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1966 | 1983 | ||
1967 | // if slave is null, the whole port is not initialized | 1984 | // if slave is null, the whole port is not initialized |
1968 | if (!port->slave) { | 1985 | if (!port->slave) { |
1969 | pr_warning(DRV_NAME ": Warning: %s: Trying to " | 1986 | pr_warning("Warning: %s: Trying to unbind an uninitialized port on %s\n", |
1970 | "unbind an uninitialized port on %s\n", | ||
1971 | slave->dev->master->name, slave->dev->name); | 1987 | slave->dev->master->name, slave->dev->name); |
1972 | return; | 1988 | return; |
1973 | } | 1989 | } |
1974 | 1990 | ||
1975 | pr_debug("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier); | 1991 | pr_debug("Unbinding Link Aggregation Group %d\n", |
1992 | aggregator->aggregator_identifier); | ||
1976 | 1993 | ||
1977 | /* Tell the partner that this port is not suitable for aggregation */ | 1994 | /* Tell the partner that this port is not suitable for aggregation */ |
1978 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; | 1995 | port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; |
@@ -1996,10 +2013,12 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
1996 | // if new aggregator found, copy the aggregator's parameters | 2013 | // if new aggregator found, copy the aggregator's parameters |
1997 | // and connect the related lag_ports to the new aggregator | 2014 | // and connect the related lag_ports to the new aggregator |
1998 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { | 2015 | if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { |
1999 | pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); | 2016 | pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", |
2017 | aggregator->aggregator_identifier, | ||
2018 | new_aggregator->aggregator_identifier); | ||
2000 | 2019 | ||
2001 | if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { | 2020 | if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { |
2002 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2021 | pr_info("%s: Removing an active aggregator\n", |
2003 | aggregator->slave->dev->master->name); | 2022 | aggregator->slave->dev->master->name); |
2004 | // select new active aggregator | 2023 | // select new active aggregator |
2005 | select_new_active_agg = 1; | 2024 | select_new_active_agg = 1; |
@@ -2030,8 +2049,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2030 | ad_agg_selection_logic(__get_first_agg(port)); | 2049 | ad_agg_selection_logic(__get_first_agg(port)); |
2031 | } | 2050 | } |
2032 | } else { | 2051 | } else { |
2033 | pr_warning(DRV_NAME ": %s: Warning: unbinding aggregator, " | 2052 | pr_warning("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n", |
2034 | "and could not find a new aggregator for its ports\n", | ||
2035 | slave->dev->master->name); | 2053 | slave->dev->master->name); |
2036 | } | 2054 | } |
2037 | } else { // in case that the only port related to this aggregator is the one we want to remove | 2055 | } else { // in case that the only port related to this aggregator is the one we want to remove |
@@ -2039,7 +2057,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2039 | // clear the aggregator | 2057 | // clear the aggregator |
2040 | ad_clear_agg(aggregator); | 2058 | ad_clear_agg(aggregator); |
2041 | if (select_new_active_agg) { | 2059 | if (select_new_active_agg) { |
2042 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2060 | pr_info("%s: Removing an active aggregator\n", |
2043 | slave->dev->master->name); | 2061 | slave->dev->master->name); |
2044 | // select new active aggregator | 2062 | // select new active aggregator |
2045 | ad_agg_selection_logic(__get_first_agg(port)); | 2063 | ad_agg_selection_logic(__get_first_agg(port)); |
@@ -2066,7 +2084,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2066 | // clear the aggregator | 2084 | // clear the aggregator |
2067 | ad_clear_agg(temp_aggregator); | 2085 | ad_clear_agg(temp_aggregator); |
2068 | if (select_new_active_agg) { | 2086 | if (select_new_active_agg) { |
2069 | pr_info(DRV_NAME ": %s: Removing an active aggregator\n", | 2087 | pr_info("%s: Removing an active aggregator\n", |
2070 | slave->dev->master->name); | 2088 | slave->dev->master->name); |
2071 | // select new active aggregator | 2089 | // select new active aggregator |
2072 | ad_agg_selection_logic(__get_first_agg(port)); | 2090 | ad_agg_selection_logic(__get_first_agg(port)); |
@@ -2115,8 +2133,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2115 | // select the active aggregator for the bond | 2133 | // select the active aggregator for the bond |
2116 | if ((port = __get_first_port(bond))) { | 2134 | if ((port = __get_first_port(bond))) { |
2117 | if (!port->slave) { | 2135 | if (!port->slave) { |
2118 | pr_warning(DRV_NAME ": %s: Warning: bond's first port is " | 2136 | pr_warning("%s: Warning: bond's first port is uninitialized\n", |
2119 | "uninitialized\n", bond->dev->name); | 2137 | bond->dev->name); |
2120 | goto re_arm; | 2138 | goto re_arm; |
2121 | } | 2139 | } |
2122 | 2140 | ||
@@ -2129,8 +2147,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work) | |||
2129 | // for each port run the state machines | 2147 | // for each port run the state machines |
2130 | for (port = __get_first_port(bond); port; port = __get_next_port(port)) { | 2148 | for (port = __get_first_port(bond); port; port = __get_next_port(port)) { |
2131 | if (!port->slave) { | 2149 | if (!port->slave) { |
2132 | pr_warning(DRV_NAME ": %s: Warning: Found an uninitialized " | 2150 | pr_warning("%s: Warning: Found an uninitialized port\n", |
2133 | "port\n", bond->dev->name); | 2151 | bond->dev->name); |
2134 | goto re_arm; | 2152 | goto re_arm; |
2135 | } | 2153 | } |
2136 | 2154 | ||
@@ -2171,15 +2189,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2171 | port = &(SLAVE_AD_INFO(slave).port); | 2189 | port = &(SLAVE_AD_INFO(slave).port); |
2172 | 2190 | ||
2173 | if (!port->slave) { | 2191 | if (!port->slave) { |
2174 | pr_warning(DRV_NAME ": %s: Warning: port of slave %s " | 2192 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", |
2175 | "is uninitialized\n", | ||
2176 | slave->dev->name, slave->dev->master->name); | 2193 | slave->dev->name, slave->dev->master->name); |
2177 | return; | 2194 | return; |
2178 | } | 2195 | } |
2179 | 2196 | ||
2180 | switch (lacpdu->subtype) { | 2197 | switch (lacpdu->subtype) { |
2181 | case AD_TYPE_LACPDU: | 2198 | case AD_TYPE_LACPDU: |
2182 | pr_debug("Received LACPDU on port %d\n", port->actor_port_number); | 2199 | pr_debug("Received LACPDU on port %d\n", |
2200 | port->actor_port_number); | ||
2183 | ad_rx_machine(lacpdu, port); | 2201 | ad_rx_machine(lacpdu, port); |
2184 | break; | 2202 | break; |
2185 | 2203 | ||
@@ -2188,17 +2206,20 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2188 | 2206 | ||
2189 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2207 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
2190 | case AD_MARKER_INFORMATION_SUBTYPE: | 2208 | case AD_MARKER_INFORMATION_SUBTYPE: |
2191 | pr_debug("Received Marker Information on port %d\n", port->actor_port_number); | 2209 | pr_debug("Received Marker Information on port %d\n", |
2210 | port->actor_port_number); | ||
2192 | ad_marker_info_received((struct bond_marker *)lacpdu, port); | 2211 | ad_marker_info_received((struct bond_marker *)lacpdu, port); |
2193 | break; | 2212 | break; |
2194 | 2213 | ||
2195 | case AD_MARKER_RESPONSE_SUBTYPE: | 2214 | case AD_MARKER_RESPONSE_SUBTYPE: |
2196 | pr_debug("Received Marker Response on port %d\n", port->actor_port_number); | 2215 | pr_debug("Received Marker Response on port %d\n", |
2216 | port->actor_port_number); | ||
2197 | ad_marker_response_received((struct bond_marker *)lacpdu, port); | 2217 | ad_marker_response_received((struct bond_marker *)lacpdu, port); |
2198 | break; | 2218 | break; |
2199 | 2219 | ||
2200 | default: | 2220 | default: |
2201 | pr_debug("Received an unknown Marker subtype on slot %d\n", port->actor_port_number); | 2221 | pr_debug("Received an unknown Marker subtype on slot %d\n", |
2222 | port->actor_port_number); | ||
2202 | } | 2223 | } |
2203 | } | 2224 | } |
2204 | } | 2225 | } |
@@ -2218,8 +2239,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) | |||
2218 | 2239 | ||
2219 | // if slave is null, the whole port is not initialized | 2240 | // if slave is null, the whole port is not initialized |
2220 | if (!port->slave) { | 2241 | if (!port->slave) { |
2221 | pr_warning(DRV_NAME ": Warning: %s: speed " | 2242 | pr_warning("Warning: %s: speed changed for uninitialized port on %s\n", |
2222 | "changed for uninitialized port on %s\n", | ||
2223 | slave->dev->master->name, slave->dev->name); | 2243 | slave->dev->master->name, slave->dev->name); |
2224 | return; | 2244 | return; |
2225 | } | 2245 | } |
@@ -2246,8 +2266,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2246 | 2266 | ||
2247 | // if slave is null, the whole port is not initialized | 2267 | // if slave is null, the whole port is not initialized |
2248 | if (!port->slave) { | 2268 | if (!port->slave) { |
2249 | pr_warning(DRV_NAME ": %s: Warning: duplex changed " | 2269 | pr_warning("%s: Warning: duplex changed for uninitialized port on %s\n", |
2250 | "for uninitialized port on %s\n", | ||
2251 | slave->dev->master->name, slave->dev->name); | 2270 | slave->dev->master->name, slave->dev->name); |
2252 | return; | 2271 | return; |
2253 | } | 2272 | } |
@@ -2275,8 +2294,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) | |||
2275 | 2294 | ||
2276 | // if slave is null, the whole port is not initialized | 2295 | // if slave is null, the whole port is not initialized |
2277 | if (!port->slave) { | 2296 | if (!port->slave) { |
2278 | pr_warning(DRV_NAME ": Warning: %s: link status changed for " | 2297 | pr_warning("Warning: %s: link status changed for uninitialized port on %s\n", |
2279 | "uninitialized port on %s\n", | ||
2280 | slave->dev->master->name, slave->dev->name); | 2298 | slave->dev->master->name, slave->dev->name); |
2281 | return; | 2299 | return; |
2282 | } | 2300 | } |
@@ -2381,8 +2399,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2381 | } | 2399 | } |
2382 | 2400 | ||
2383 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { | 2401 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { |
2384 | pr_debug(DRV_NAME ": %s: Error: " | 2402 | pr_debug("%s: Error: bond_3ad_get_active_agg_info failed\n", |
2385 | "bond_3ad_get_active_agg_info failed\n", dev->name); | 2403 | dev->name); |
2386 | goto out; | 2404 | goto out; |
2387 | } | 2405 | } |
2388 | 2406 | ||
@@ -2391,8 +2409,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2391 | 2409 | ||
2392 | if (slaves_in_agg == 0) { | 2410 | if (slaves_in_agg == 0) { |
2393 | /*the aggregator is empty*/ | 2411 | /*the aggregator is empty*/ |
2394 | pr_debug(DRV_NAME ": %s: Error: active aggregator is empty\n", | 2412 | pr_debug("%s: Error: active aggregator is empty\n", dev->name); |
2395 | dev->name); | ||
2396 | goto out; | 2413 | goto out; |
2397 | } | 2414 | } |
2398 | 2415 | ||
@@ -2410,8 +2427,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | |||
2410 | } | 2427 | } |
2411 | 2428 | ||
2412 | if (slave_agg_no >= 0) { | 2429 | if (slave_agg_no >= 0) { |
2413 | pr_err(DRV_NAME ": %s: Error: Couldn't find a slave to tx on " | 2430 | pr_err("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n", |
2414 | "for aggregator ID %d\n", dev->name, agg_id); | 2431 | dev->name, agg_id); |
2415 | goto out; | 2432 | goto out; |
2416 | } | 2433 | } |
2417 | 2434 | ||
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 00ab51ef3129..40fdc41446cc 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
24 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
25 | #include <linux/etherdevice.h> | 27 | #include <linux/etherdevice.h> |
@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond) | |||
201 | 203 | ||
202 | new_hashtbl = kzalloc(size, GFP_KERNEL); | 204 | new_hashtbl = kzalloc(size, GFP_KERNEL); |
203 | if (!new_hashtbl) { | 205 | if (!new_hashtbl) { |
204 | pr_err(DRV_NAME | 206 | pr_err("%s: Error: Failed to allocate TLB hash table\n", |
205 | ": %s: Error: Failed to allocate TLB hash table\n", | ||
206 | bond->dev->name); | 207 | bond->dev->name); |
207 | return -1; | 208 | return -1; |
208 | } | 209 | } |
@@ -514,8 +515,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
514 | client_info->slave->dev->dev_addr, | 515 | client_info->slave->dev->dev_addr, |
515 | client_info->mac_dst); | 516 | client_info->mac_dst); |
516 | if (!skb) { | 517 | if (!skb) { |
517 | pr_err(DRV_NAME | 518 | pr_err("%s: Error: failed to create an ARP packet\n", |
518 | ": %s: Error: failed to create an ARP packet\n", | ||
519 | client_info->slave->dev->master->name); | 519 | client_info->slave->dev->master->name); |
520 | continue; | 520 | continue; |
521 | } | 521 | } |
@@ -525,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
525 | if (client_info->tag) { | 525 | if (client_info->tag) { |
526 | skb = vlan_put_tag(skb, client_info->vlan_id); | 526 | skb = vlan_put_tag(skb, client_info->vlan_id); |
527 | if (!skb) { | 527 | if (!skb) { |
528 | pr_err(DRV_NAME | 528 | pr_err("%s: Error: failed to insert VLAN tag\n", |
529 | ": %s: Error: failed to insert VLAN tag\n", | ||
530 | client_info->slave->dev->master->name); | 529 | client_info->slave->dev->master->name); |
531 | continue; | 530 | continue; |
532 | } | 531 | } |
@@ -609,9 +608,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) | |||
609 | client_info = &(bond_info->rx_hashtbl[hash_index]); | 608 | client_info = &(bond_info->rx_hashtbl[hash_index]); |
610 | 609 | ||
611 | if (!client_info->slave) { | 610 | if (!client_info->slave) { |
612 | pr_err(DRV_NAME | 611 | pr_err("%s: Error: found a client with no channel in the client's hash table\n", |
613 | ": %s: Error: found a client with no channel in " | ||
614 | "the client's hash table\n", | ||
615 | bond->dev->name); | 612 | bond->dev->name); |
616 | continue; | 613 | continue; |
617 | } | 614 | } |
@@ -806,8 +803,7 @@ static int rlb_initialize(struct bonding *bond) | |||
806 | 803 | ||
807 | new_hashtbl = kmalloc(size, GFP_KERNEL); | 804 | new_hashtbl = kmalloc(size, GFP_KERNEL); |
808 | if (!new_hashtbl) { | 805 | if (!new_hashtbl) { |
809 | pr_err(DRV_NAME | 806 | pr_err("%s: Error: Failed to allocate RLB hash table\n", |
810 | ": %s: Error: Failed to allocate RLB hash table\n", | ||
811 | bond->dev->name); | 807 | bond->dev->name); |
812 | return -1; | 808 | return -1; |
813 | } | 809 | } |
@@ -928,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | |||
928 | 924 | ||
929 | skb = vlan_put_tag(skb, vlan->vlan_id); | 925 | skb = vlan_put_tag(skb, vlan->vlan_id); |
930 | if (!skb) { | 926 | if (!skb) { |
931 | pr_err(DRV_NAME | 927 | pr_err("%s: Error: failed to insert VLAN tag\n", |
932 | ": %s: Error: failed to insert VLAN tag\n", | ||
933 | bond->dev->name); | 928 | bond->dev->name); |
934 | continue; | 929 | continue; |
935 | } | 930 | } |
@@ -958,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) | |||
958 | memcpy(s_addr.sa_data, addr, dev->addr_len); | 953 | memcpy(s_addr.sa_data, addr, dev->addr_len); |
959 | s_addr.sa_family = dev->type; | 954 | s_addr.sa_family = dev->type; |
960 | if (dev_set_mac_address(dev, &s_addr)) { | 955 | if (dev_set_mac_address(dev, &s_addr)) { |
961 | pr_err(DRV_NAME | 956 | pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n" |
962 | ": %s: Error: dev_set_mac_address of dev %s failed! ALB " | 957 | "ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", |
963 | "mode requires that the base driver support setting " | ||
964 | "the hw address also when the network device's " | ||
965 | "interface is open\n", | ||
966 | dev->master->name, dev->name); | 958 | dev->master->name, dev->name); |
967 | return -EOPNOTSUPP; | 959 | return -EOPNOTSUPP; |
968 | } | 960 | } |
@@ -1169,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1169 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, | 1161 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, |
1170 | bond->alb_info.rlb_enabled); | 1162 | bond->alb_info.rlb_enabled); |
1171 | 1163 | ||
1172 | pr_warning(DRV_NAME | 1164 | pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", |
1173 | ": %s: Warning: the hw address of slave %s is " | ||
1174 | "in use by the bond; giving it the hw address " | ||
1175 | "of %s\n", | ||
1176 | bond->dev->name, slave->dev->name, | 1165 | bond->dev->name, slave->dev->name, |
1177 | free_mac_slave->dev->name); | 1166 | free_mac_slave->dev->name); |
1178 | 1167 | ||
1179 | } else if (has_bond_addr) { | 1168 | } else if (has_bond_addr) { |
1180 | pr_err(DRV_NAME | 1169 | 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", |
1181 | ": %s: Error: the hw address of slave %s is in use by the " | ||
1182 | "bond; couldn't find a slave with a free hw address to " | ||
1183 | "give it (this should not have happened)\n", | ||
1184 | bond->dev->name, slave->dev->name); | 1170 | bond->dev->name, slave->dev->name); |
1185 | return -EFAULT; | 1171 | return -EFAULT; |
1186 | } | 1172 | } |
diff --git a/drivers/net/bonding/bond_ipv6.c b/drivers/net/bonding/bond_ipv6.c index b72e1dc8cf8f..6dd64cf3cb76 100644 --- a/drivers/net/bonding/bond_ipv6.c +++ b/drivers/net/bonding/bond_ipv6.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/types.h> | 25 | #include <linux/types.h> |
24 | #include <linux/if_vlan.h> | 26 | #include <linux/if_vlan.h> |
25 | #include <net/ipv6.h> | 27 | #include <net/ipv6.h> |
@@ -74,20 +76,20 @@ static void bond_na_send(struct net_device *slave_dev, | |||
74 | addrconf_addr_solict_mult(daddr, &mcaddr); | 76 | addrconf_addr_solict_mult(daddr, &mcaddr); |
75 | 77 | ||
76 | pr_debug("ipv6 na on slave %s: dest %pI6, src %pI6\n", | 78 | pr_debug("ipv6 na on slave %s: dest %pI6, src %pI6\n", |
77 | slave_dev->name, &mcaddr, daddr); | 79 | slave_dev->name, &mcaddr, daddr); |
78 | 80 | ||
79 | skb = ndisc_build_skb(slave_dev, &mcaddr, daddr, &icmp6h, daddr, | 81 | skb = ndisc_build_skb(slave_dev, &mcaddr, daddr, &icmp6h, daddr, |
80 | ND_OPT_TARGET_LL_ADDR); | 82 | ND_OPT_TARGET_LL_ADDR); |
81 | 83 | ||
82 | if (!skb) { | 84 | if (!skb) { |
83 | pr_err(DRV_NAME ": NA packet allocation failed\n"); | 85 | pr_err("NA packet allocation failed\n"); |
84 | return; | 86 | return; |
85 | } | 87 | } |
86 | 88 | ||
87 | if (vlan_id) { | 89 | if (vlan_id) { |
88 | skb = vlan_put_tag(skb, vlan_id); | 90 | skb = vlan_put_tag(skb, vlan_id); |
89 | if (!skb) { | 91 | if (!skb) { |
90 | pr_err(DRV_NAME ": failed to insert VLAN tag\n"); | 92 | pr_err("failed to insert VLAN tag\n"); |
91 | return; | 93 | return; |
92 | } | 94 | } |
93 | } | 95 | } |
@@ -109,8 +111,8 @@ void bond_send_unsolicited_na(struct bonding *bond) | |||
109 | struct inet6_dev *idev; | 111 | struct inet6_dev *idev; |
110 | int is_router; | 112 | int is_router; |
111 | 113 | ||
112 | pr_debug("bond_send_unsol_na: bond %s slave %s\n", bond->dev->name, | 114 | pr_debug("%s: bond %s slave %s\n", bond->dev->name, |
113 | slave ? slave->dev->name : "NULL"); | 115 | __func__, slave ? slave->dev->name : "NULL"); |
114 | 116 | ||
115 | if (!slave || !bond->send_unsol_na || | 117 | if (!slave || !bond->send_unsol_na || |
116 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) | 118 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index af9b9c4eb496..3f0071cfe56b 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -31,6 +31,8 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
35 | |||
34 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
35 | #include <linux/module.h> | 37 | #include <linux/module.h> |
36 | #include <linux/types.h> | 38 | #include <linux/types.h> |
@@ -260,7 +262,7 @@ static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id) | |||
260 | struct vlan_entry *vlan; | 262 | struct vlan_entry *vlan; |
261 | 263 | ||
262 | pr_debug("bond: %s, vlan id %d\n", | 264 | pr_debug("bond: %s, vlan id %d\n", |
263 | (bond ? bond->dev->name : "None"), vlan_id); | 265 | (bond ? bond->dev->name : "None"), vlan_id); |
264 | 266 | ||
265 | vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL); | 267 | vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL); |
266 | if (!vlan) | 268 | if (!vlan) |
@@ -303,8 +305,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) | |||
303 | if (bond_is_lb(bond)) | 305 | if (bond_is_lb(bond)) |
304 | bond_alb_clear_vlan(bond, vlan_id); | 306 | bond_alb_clear_vlan(bond, vlan_id); |
305 | 307 | ||
306 | pr_debug("removed VLAN ID %d from bond %s\n", vlan_id, | 308 | pr_debug("removed VLAN ID %d from bond %s\n", |
307 | bond->dev->name); | 309 | vlan_id, bond->dev->name); |
308 | 310 | ||
309 | kfree(vlan); | 311 | kfree(vlan); |
310 | 312 | ||
@@ -323,8 +325,8 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) | |||
323 | } | 325 | } |
324 | } | 326 | } |
325 | 327 | ||
326 | pr_debug("couldn't find VLAN ID %d in bond %s\n", vlan_id, | 328 | pr_debug("couldn't find VLAN ID %d in bond %s\n", |
327 | bond->dev->name); | 329 | vlan_id, bond->dev->name); |
328 | 330 | ||
329 | out: | 331 | out: |
330 | write_unlock_bh(&bond->lock); | 332 | write_unlock_bh(&bond->lock); |
@@ -348,7 +350,7 @@ static int bond_has_challenged_slaves(struct bonding *bond) | |||
348 | bond_for_each_slave(bond, slave, i) { | 350 | bond_for_each_slave(bond, slave, i) { |
349 | if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) { | 351 | if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) { |
350 | pr_debug("found VLAN challenged slave - %s\n", | 352 | pr_debug("found VLAN challenged slave - %s\n", |
351 | slave->dev->name); | 353 | slave->dev->name); |
352 | return 1; | 354 | return 1; |
353 | } | 355 | } |
354 | } | 356 | } |
@@ -499,8 +501,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) | |||
499 | 501 | ||
500 | res = bond_add_vlan(bond, vid); | 502 | res = bond_add_vlan(bond, vid); |
501 | if (res) { | 503 | if (res) { |
502 | pr_err(DRV_NAME | 504 | pr_err("%s: Error: Failed to add vlan id %d\n", |
503 | ": %s: Error: Failed to add vlan id %d\n", | ||
504 | bond_dev->name, vid); | 505 | bond_dev->name, vid); |
505 | } | 506 | } |
506 | } | 507 | } |
@@ -534,8 +535,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) | |||
534 | 535 | ||
535 | res = bond_del_vlan(bond, vid); | 536 | res = bond_del_vlan(bond, vid); |
536 | if (res) { | 537 | if (res) { |
537 | pr_err(DRV_NAME | 538 | pr_err("%s: Error: Failed to remove vlan id %d\n", |
538 | ": %s: Error: Failed to remove vlan id %d\n", | ||
539 | bond_dev->name, vid); | 539 | bond_dev->name, vid); |
540 | } | 540 | } |
541 | } | 541 | } |
@@ -1053,8 +1053,7 @@ static void bond_do_fail_over_mac(struct bonding *bond, | |||
1053 | 1053 | ||
1054 | rv = dev_set_mac_address(new_active->dev, &saddr); | 1054 | rv = dev_set_mac_address(new_active->dev, &saddr); |
1055 | if (rv) { | 1055 | if (rv) { |
1056 | pr_err(DRV_NAME | 1056 | pr_err("%s: Error %d setting MAC of slave %s\n", |
1057 | ": %s: Error %d setting MAC of slave %s\n", | ||
1058 | bond->dev->name, -rv, new_active->dev->name); | 1057 | bond->dev->name, -rv, new_active->dev->name); |
1059 | goto out; | 1058 | goto out; |
1060 | } | 1059 | } |
@@ -1067,16 +1066,14 @@ static void bond_do_fail_over_mac(struct bonding *bond, | |||
1067 | 1066 | ||
1068 | rv = dev_set_mac_address(old_active->dev, &saddr); | 1067 | rv = dev_set_mac_address(old_active->dev, &saddr); |
1069 | if (rv) | 1068 | if (rv) |
1070 | pr_err(DRV_NAME | 1069 | pr_err("%s: Error %d setting MAC of slave %s\n", |
1071 | ": %s: Error %d setting MAC of slave %s\n", | ||
1072 | bond->dev->name, -rv, new_active->dev->name); | 1070 | bond->dev->name, -rv, new_active->dev->name); |
1073 | out: | 1071 | out: |
1074 | read_lock(&bond->lock); | 1072 | read_lock(&bond->lock); |
1075 | write_lock_bh(&bond->curr_slave_lock); | 1073 | write_lock_bh(&bond->curr_slave_lock); |
1076 | break; | 1074 | break; |
1077 | default: | 1075 | default: |
1078 | pr_err(DRV_NAME | 1076 | pr_err("%s: bond_do_fail_over_mac impossible: bad policy %d\n", |
1079 | ": %s: bond_do_fail_over_mac impossible: bad policy %d\n", | ||
1080 | bond->dev->name, bond->params.fail_over_mac); | 1077 | bond->dev->name, bond->params.fail_over_mac); |
1081 | break; | 1078 | break; |
1082 | } | 1079 | } |
@@ -1178,11 +1175,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1178 | 1175 | ||
1179 | if (new_active->link == BOND_LINK_BACK) { | 1176 | if (new_active->link == BOND_LINK_BACK) { |
1180 | if (USES_PRIMARY(bond->params.mode)) { | 1177 | if (USES_PRIMARY(bond->params.mode)) { |
1181 | pr_info(DRV_NAME | 1178 | pr_info("%s: making interface %s the new active one %d ms earlier.\n", |
1182 | ": %s: making interface %s the new " | 1179 | bond->dev->name, new_active->dev->name, |
1183 | "active one %d ms earlier.\n", | 1180 | (bond->params.updelay - new_active->delay) * bond->params.miimon); |
1184 | bond->dev->name, new_active->dev->name, | ||
1185 | (bond->params.updelay - new_active->delay) * bond->params.miimon); | ||
1186 | } | 1181 | } |
1187 | 1182 | ||
1188 | new_active->delay = 0; | 1183 | new_active->delay = 0; |
@@ -1195,10 +1190,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1195 | bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); | 1190 | bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP); |
1196 | } else { | 1191 | } else { |
1197 | if (USES_PRIMARY(bond->params.mode)) { | 1192 | if (USES_PRIMARY(bond->params.mode)) { |
1198 | pr_info(DRV_NAME | 1193 | pr_info("%s: making interface %s the new active one.\n", |
1199 | ": %s: making interface %s the new " | 1194 | bond->dev->name, new_active->dev->name); |
1200 | "active one.\n", | ||
1201 | bond->dev->name, new_active->dev->name); | ||
1202 | } | 1195 | } |
1203 | } | 1196 | } |
1204 | } | 1197 | } |
@@ -1268,13 +1261,11 @@ void bond_select_active_slave(struct bonding *bond) | |||
1268 | return; | 1261 | return; |
1269 | 1262 | ||
1270 | if (netif_carrier_ok(bond->dev)) { | 1263 | if (netif_carrier_ok(bond->dev)) { |
1271 | pr_info(DRV_NAME | 1264 | pr_info("%s: first active interface up!\n", |
1272 | ": %s: first active interface up!\n", | 1265 | bond->dev->name); |
1273 | bond->dev->name); | ||
1274 | } else { | 1266 | } else { |
1275 | pr_info(DRV_NAME ": %s: " | 1267 | pr_info("%s: now running without any active interface !\n", |
1276 | "now running without any active interface !\n", | 1268 | bond->dev->name); |
1277 | bond->dev->name); | ||
1278 | } | 1269 | } |
1279 | } | 1270 | } |
1280 | } | 1271 | } |
@@ -1423,16 +1414,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1423 | 1414 | ||
1424 | if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && | 1415 | if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && |
1425 | slave_ops->ndo_do_ioctl == NULL) { | 1416 | slave_ops->ndo_do_ioctl == NULL) { |
1426 | pr_warning(DRV_NAME | 1417 | pr_warning("%s: Warning: no link monitoring support for %s\n", |
1427 | ": %s: Warning: no link monitoring support for %s\n", | 1418 | bond_dev->name, slave_dev->name); |
1428 | bond_dev->name, slave_dev->name); | ||
1429 | } | 1419 | } |
1430 | 1420 | ||
1431 | /* bond must be initialized by bond_open() before enslaving */ | 1421 | /* bond must be initialized by bond_open() before enslaving */ |
1432 | if (!(bond_dev->flags & IFF_UP)) { | 1422 | if (!(bond_dev->flags & IFF_UP)) { |
1433 | pr_warning(DRV_NAME | 1423 | pr_warning("%s: master_dev is not up in bond_enslave\n", |
1434 | " %s: master_dev is not up in bond_enslave\n", | 1424 | bond_dev->name); |
1435 | bond_dev->name); | ||
1436 | } | 1425 | } |
1437 | 1426 | ||
1438 | /* already enslaved */ | 1427 | /* already enslaved */ |
@@ -1446,19 +1435,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1446 | if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { | 1435 | if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { |
1447 | pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); | 1436 | pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); |
1448 | if (!list_empty(&bond->vlan_list)) { | 1437 | if (!list_empty(&bond->vlan_list)) { |
1449 | pr_err(DRV_NAME | 1438 | pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n", |
1450 | ": %s: Error: cannot enslave VLAN " | 1439 | bond_dev->name, slave_dev->name, bond_dev->name); |
1451 | "challenged slave %s on VLAN enabled " | ||
1452 | "bond %s\n", bond_dev->name, slave_dev->name, | ||
1453 | bond_dev->name); | ||
1454 | return -EPERM; | 1440 | return -EPERM; |
1455 | } else { | 1441 | } else { |
1456 | pr_warning(DRV_NAME | 1442 | pr_warning("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", |
1457 | ": %s: Warning: enslaved VLAN challenged " | 1443 | bond_dev->name, slave_dev->name, |
1458 | "slave %s. Adding VLANs will be blocked as " | 1444 | slave_dev->name, bond_dev->name); |
1459 | "long as %s is part of bond %s\n", | ||
1460 | bond_dev->name, slave_dev->name, slave_dev->name, | ||
1461 | bond_dev->name); | ||
1462 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; | 1445 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; |
1463 | } | 1446 | } |
1464 | } else { | 1447 | } else { |
@@ -1478,8 +1461,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1478 | * enslaving it; the old ifenslave will not. | 1461 | * enslaving it; the old ifenslave will not. |
1479 | */ | 1462 | */ |
1480 | if ((slave_dev->flags & IFF_UP)) { | 1463 | if ((slave_dev->flags & IFF_UP)) { |
1481 | pr_err(DRV_NAME ": %s is up. " | 1464 | pr_err("%s is up. This may be due to an out of date ifenslave.\n", |
1482 | "This may be due to an out of date ifenslave.\n", | ||
1483 | slave_dev->name); | 1465 | slave_dev->name); |
1484 | res = -EPERM; | 1466 | res = -EPERM; |
1485 | goto err_undo_flags; | 1467 | goto err_undo_flags; |
@@ -1495,7 +1477,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1495 | if (bond->slave_cnt == 0) { | 1477 | if (bond->slave_cnt == 0) { |
1496 | if (bond_dev->type != slave_dev->type) { | 1478 | if (bond_dev->type != slave_dev->type) { |
1497 | pr_debug("%s: change device type from %d to %d\n", | 1479 | pr_debug("%s: change device type from %d to %d\n", |
1498 | bond_dev->name, bond_dev->type, slave_dev->type); | 1480 | bond_dev->name, |
1481 | bond_dev->type, slave_dev->type); | ||
1499 | 1482 | ||
1500 | netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); | 1483 | netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); |
1501 | 1484 | ||
@@ -1507,28 +1490,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1507 | netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); | 1490 | netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); |
1508 | } | 1491 | } |
1509 | } else if (bond_dev->type != slave_dev->type) { | 1492 | } else if (bond_dev->type != slave_dev->type) { |
1510 | pr_err(DRV_NAME ": %s ether type (%d) is different " | 1493 | pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n", |
1511 | "from other slaves (%d), can not enslave it.\n", | 1494 | slave_dev->name, |
1512 | slave_dev->name, | 1495 | slave_dev->type, bond_dev->type); |
1513 | slave_dev->type, bond_dev->type); | 1496 | res = -EINVAL; |
1514 | res = -EINVAL; | 1497 | goto err_undo_flags; |
1515 | goto err_undo_flags; | ||
1516 | } | 1498 | } |
1517 | 1499 | ||
1518 | if (slave_ops->ndo_set_mac_address == NULL) { | 1500 | if (slave_ops->ndo_set_mac_address == NULL) { |
1519 | if (bond->slave_cnt == 0) { | 1501 | if (bond->slave_cnt == 0) { |
1520 | pr_warning(DRV_NAME | 1502 | pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active.", |
1521 | ": %s: Warning: The first slave device " | 1503 | bond_dev->name); |
1522 | "specified does not support setting the MAC " | ||
1523 | "address. Setting fail_over_mac to active.", | ||
1524 | bond_dev->name); | ||
1525 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; | 1504 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; |
1526 | } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) { | 1505 | } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) { |
1527 | pr_err(DRV_NAME | 1506 | 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", |
1528 | ": %s: Error: The slave device specified " | 1507 | bond_dev->name); |
1529 | "does not support setting the MAC address, " | ||
1530 | "but fail_over_mac is not set to active.\n" | ||
1531 | , bond_dev->name); | ||
1532 | res = -EOPNOTSUPP; | 1508 | res = -EOPNOTSUPP; |
1533 | goto err_undo_flags; | 1509 | goto err_undo_flags; |
1534 | } | 1510 | } |
@@ -1655,22 +1631,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1655 | * supported); thus, we don't need to change | 1631 | * supported); thus, we don't need to change |
1656 | * the messages for netif_carrier. | 1632 | * the messages for netif_carrier. |
1657 | */ | 1633 | */ |
1658 | pr_warning(DRV_NAME | 1634 | pr_warning("%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", |
1659 | ": %s: Warning: MII and ETHTOOL support not " | ||
1660 | "available for interface %s, and " | ||
1661 | "arp_interval/arp_ip_target module parameters " | ||
1662 | "not specified, thus bonding will not detect " | ||
1663 | "link failures! see bonding.txt for details.\n", | ||
1664 | bond_dev->name, slave_dev->name); | 1635 | bond_dev->name, slave_dev->name); |
1665 | } else if (link_reporting == -1) { | 1636 | } else if (link_reporting == -1) { |
1666 | /* unable get link status using mii/ethtool */ | 1637 | /* unable get link status using mii/ethtool */ |
1667 | pr_warning(DRV_NAME | 1638 | pr_warning("%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", |
1668 | ": %s: Warning: can't get link status from " | 1639 | bond_dev->name, slave_dev->name); |
1669 | "interface %s; the network driver associated " | ||
1670 | "with this interface does not support MII or " | ||
1671 | "ETHTOOL link status reporting, thus miimon " | ||
1672 | "has no effect on this interface.\n", | ||
1673 | bond_dev->name, slave_dev->name); | ||
1674 | } | 1640 | } |
1675 | } | 1641 | } |
1676 | 1642 | ||
@@ -1678,34 +1644,27 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1678 | if (!bond->params.miimon || | 1644 | if (!bond->params.miimon || |
1679 | (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { | 1645 | (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { |
1680 | if (bond->params.updelay) { | 1646 | if (bond->params.updelay) { |
1681 | pr_debug("Initial state of slave_dev is " | 1647 | pr_debug("Initial state of slave_dev is BOND_LINK_BACK\n"); |
1682 | "BOND_LINK_BACK\n"); | ||
1683 | new_slave->link = BOND_LINK_BACK; | 1648 | new_slave->link = BOND_LINK_BACK; |
1684 | new_slave->delay = bond->params.updelay; | 1649 | new_slave->delay = bond->params.updelay; |
1685 | } else { | 1650 | } else { |
1686 | pr_debug("Initial state of slave_dev is " | 1651 | pr_debug("Initial state of slave_dev is BOND_LINK_UP\n"); |
1687 | "BOND_LINK_UP\n"); | ||
1688 | new_slave->link = BOND_LINK_UP; | 1652 | new_slave->link = BOND_LINK_UP; |
1689 | } | 1653 | } |
1690 | new_slave->jiffies = jiffies; | 1654 | new_slave->jiffies = jiffies; |
1691 | } else { | 1655 | } else { |
1692 | pr_debug("Initial state of slave_dev is " | 1656 | pr_debug("Initial state of slave_dev is BOND_LINK_DOWN\n"); |
1693 | "BOND_LINK_DOWN\n"); | ||
1694 | new_slave->link = BOND_LINK_DOWN; | 1657 | new_slave->link = BOND_LINK_DOWN; |
1695 | } | 1658 | } |
1696 | 1659 | ||
1697 | if (bond_update_speed_duplex(new_slave) && | 1660 | if (bond_update_speed_duplex(new_slave) && |
1698 | (new_slave->link != BOND_LINK_DOWN)) { | 1661 | (new_slave->link != BOND_LINK_DOWN)) { |
1699 | pr_warning(DRV_NAME | 1662 | pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n", |
1700 | ": %s: Warning: failed to get speed and duplex from %s, " | 1663 | bond_dev->name, new_slave->dev->name); |
1701 | "assumed to be 100Mb/sec and Full.\n", | ||
1702 | bond_dev->name, new_slave->dev->name); | ||
1703 | 1664 | ||
1704 | if (bond->params.mode == BOND_MODE_8023AD) { | 1665 | if (bond->params.mode == BOND_MODE_8023AD) { |
1705 | pr_warning(DRV_NAME | 1666 | pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n", |
1706 | ": %s: Warning: Operation of 802.3ad mode requires ETHTOOL " | 1667 | bond_dev->name); |
1707 | "support in base driver for proper aggregator " | ||
1708 | "selection.\n", bond_dev->name); | ||
1709 | } | 1668 | } |
1710 | } | 1669 | } |
1711 | 1670 | ||
@@ -1777,11 +1736,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1777 | if (res) | 1736 | if (res) |
1778 | goto err_close; | 1737 | goto err_close; |
1779 | 1738 | ||
1780 | pr_info(DRV_NAME | 1739 | pr_info("%s: enslaving %s as a%s interface with a%s link.\n", |
1781 | ": %s: enslaving %s as a%s interface with a%s link.\n", | 1740 | bond_dev->name, slave_dev->name, |
1782 | bond_dev->name, slave_dev->name, | 1741 | new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup", |
1783 | new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup", | 1742 | new_slave->link != BOND_LINK_DOWN ? "n up" : " down"); |
1784 | new_slave->link != BOND_LINK_DOWN ? "n up" : " down"); | ||
1785 | 1743 | ||
1786 | /* enslave is successful */ | 1744 | /* enslave is successful */ |
1787 | return 0; | 1745 | return 0; |
@@ -1833,8 +1791,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1833 | /* slave is not a slave or master is not master of this slave */ | 1791 | /* slave is not a slave or master is not master of this slave */ |
1834 | if (!(slave_dev->flags & IFF_SLAVE) || | 1792 | if (!(slave_dev->flags & IFF_SLAVE) || |
1835 | (slave_dev->master != bond_dev)) { | 1793 | (slave_dev->master != bond_dev)) { |
1836 | pr_err(DRV_NAME | 1794 | pr_err("%s: Error: cannot release %s.\n", |
1837 | ": %s: Error: cannot release %s.\n", | ||
1838 | bond_dev->name, slave_dev->name); | 1795 | bond_dev->name, slave_dev->name); |
1839 | return -EINVAL; | 1796 | return -EINVAL; |
1840 | } | 1797 | } |
@@ -1844,9 +1801,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1844 | slave = bond_get_slave_by_dev(bond, slave_dev); | 1801 | slave = bond_get_slave_by_dev(bond, slave_dev); |
1845 | if (!slave) { | 1802 | if (!slave) { |
1846 | /* not a slave of this bond */ | 1803 | /* not a slave of this bond */ |
1847 | pr_info(DRV_NAME | 1804 | pr_info("%s: %s not enslaved\n", |
1848 | ": %s: %s not enslaved\n", | 1805 | bond_dev->name, slave_dev->name); |
1849 | bond_dev->name, slave_dev->name); | ||
1850 | write_unlock_bh(&bond->lock); | 1806 | write_unlock_bh(&bond->lock); |
1851 | return -EINVAL; | 1807 | return -EINVAL; |
1852 | } | 1808 | } |
@@ -1854,14 +1810,10 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1854 | if (!bond->params.fail_over_mac) { | 1810 | if (!bond->params.fail_over_mac) { |
1855 | if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && | 1811 | if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && |
1856 | bond->slave_cnt > 1) | 1812 | bond->slave_cnt > 1) |
1857 | pr_warning(DRV_NAME | 1813 | pr_warning("%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", |
1858 | ": %s: Warning: the permanent HWaddr of %s - " | 1814 | bond_dev->name, slave_dev->name, |
1859 | "%pM - is still in use by %s. " | 1815 | slave->perm_hwaddr, |
1860 | "Set the HWaddr of %s to a different address " | 1816 | bond_dev->name, slave_dev->name); |
1861 | "to avoid conflicts.\n", | ||
1862 | bond_dev->name, slave_dev->name, | ||
1863 | slave->perm_hwaddr, | ||
1864 | bond_dev->name, slave_dev->name); | ||
1865 | } | 1817 | } |
1866 | 1818 | ||
1867 | /* Inform AD package of unbinding of slave. */ | 1819 | /* Inform AD package of unbinding of slave. */ |
@@ -1872,12 +1824,10 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1872 | bond_3ad_unbind_slave(slave); | 1824 | bond_3ad_unbind_slave(slave); |
1873 | } | 1825 | } |
1874 | 1826 | ||
1875 | pr_info(DRV_NAME | 1827 | pr_info("%s: releasing %s interface %s\n", |
1876 | ": %s: releasing %s interface %s\n", | 1828 | bond_dev->name, |
1877 | bond_dev->name, | 1829 | (slave->state == BOND_STATE_ACTIVE) ? "active" : "backup", |
1878 | (slave->state == BOND_STATE_ACTIVE) | 1830 | slave_dev->name); |
1879 | ? "active" : "backup", | ||
1880 | slave_dev->name); | ||
1881 | 1831 | ||
1882 | oldcurrent = bond->curr_active_slave; | 1832 | oldcurrent = bond->curr_active_slave; |
1883 | 1833 | ||
@@ -1934,21 +1884,15 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1934 | if (list_empty(&bond->vlan_list)) { | 1884 | if (list_empty(&bond->vlan_list)) { |
1935 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; | 1885 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; |
1936 | } else { | 1886 | } else { |
1937 | pr_warning(DRV_NAME | 1887 | pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n", |
1938 | ": %s: Warning: clearing HW address of %s while it " | 1888 | bond_dev->name, bond_dev->name); |
1939 | "still has VLANs.\n", | 1889 | pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n", |
1940 | bond_dev->name, bond_dev->name); | 1890 | bond_dev->name); |
1941 | pr_warning(DRV_NAME | ||
1942 | ": %s: When re-adding slaves, make sure the bond's " | ||
1943 | "HW address matches its VLANs'.\n", | ||
1944 | bond_dev->name); | ||
1945 | } | 1891 | } |
1946 | } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && | 1892 | } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && |
1947 | !bond_has_challenged_slaves(bond)) { | 1893 | !bond_has_challenged_slaves(bond)) { |
1948 | pr_info(DRV_NAME | 1894 | pr_info("%s: last VLAN challenged slave %s left bond %s. VLAN blocking is removed\n", |
1949 | ": %s: last VLAN challenged slave %s " | 1895 | bond_dev->name, slave_dev->name, bond_dev->name); |
1950 | "left bond %s. VLAN blocking is removed\n", | ||
1951 | bond_dev->name, slave_dev->name, bond_dev->name); | ||
1952 | bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; | 1896 | bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; |
1953 | } | 1897 | } |
1954 | 1898 | ||
@@ -2011,8 +1955,8 @@ int bond_release_and_destroy(struct net_device *bond_dev, | |||
2011 | 1955 | ||
2012 | ret = bond_release(bond_dev, slave_dev); | 1956 | ret = bond_release(bond_dev, slave_dev); |
2013 | if ((ret == 0) && (bond->slave_cnt == 0)) { | 1957 | if ((ret == 0) && (bond->slave_cnt == 0)) { |
2014 | pr_info(DRV_NAME ": %s: destroying bond %s.\n", | 1958 | pr_info("%s: destroying bond %s.\n", |
2015 | bond_dev->name, bond_dev->name); | 1959 | bond_dev->name, bond_dev->name); |
2016 | unregister_netdevice(bond_dev); | 1960 | unregister_netdevice(bond_dev); |
2017 | } | 1961 | } |
2018 | return ret; | 1962 | return ret; |
@@ -2116,19 +2060,13 @@ static int bond_release_all(struct net_device *bond_dev) | |||
2116 | if (list_empty(&bond->vlan_list)) | 2060 | if (list_empty(&bond->vlan_list)) |
2117 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; | 2061 | bond_dev->features |= NETIF_F_VLAN_CHALLENGED; |
2118 | else { | 2062 | else { |
2119 | pr_warning(DRV_NAME | 2063 | pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n", |
2120 | ": %s: Warning: clearing HW address of %s while it " | 2064 | bond_dev->name, bond_dev->name); |
2121 | "still has VLANs.\n", | 2065 | pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n", |
2122 | bond_dev->name, bond_dev->name); | 2066 | bond_dev->name); |
2123 | pr_warning(DRV_NAME | ||
2124 | ": %s: When re-adding slaves, make sure the bond's " | ||
2125 | "HW address matches its VLANs'.\n", | ||
2126 | bond_dev->name); | ||
2127 | } | 2067 | } |
2128 | 2068 | ||
2129 | pr_info(DRV_NAME | 2069 | pr_info("%s: released all slaves\n", bond_dev->name); |
2130 | ": %s: released all slaves\n", | ||
2131 | bond_dev->name); | ||
2132 | 2070 | ||
2133 | out: | 2071 | out: |
2134 | write_unlock_bh(&bond->lock); | 2072 | write_unlock_bh(&bond->lock); |
@@ -2254,16 +2192,14 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
2254 | slave->link = BOND_LINK_FAIL; | 2192 | slave->link = BOND_LINK_FAIL; |
2255 | slave->delay = bond->params.downdelay; | 2193 | slave->delay = bond->params.downdelay; |
2256 | if (slave->delay) { | 2194 | if (slave->delay) { |
2257 | pr_info(DRV_NAME | 2195 | pr_info("%s: link status down for %sinterface %s, disabling it in %d ms.\n", |
2258 | ": %s: link status down for %s" | 2196 | bond->dev->name, |
2259 | "interface %s, disabling it in %d ms.\n", | 2197 | (bond->params.mode == |
2260 | bond->dev->name, | 2198 | BOND_MODE_ACTIVEBACKUP) ? |
2261 | (bond->params.mode == | 2199 | ((slave->state == BOND_STATE_ACTIVE) ? |
2262 | BOND_MODE_ACTIVEBACKUP) ? | 2200 | "active " : "backup ") : "", |
2263 | ((slave->state == BOND_STATE_ACTIVE) ? | 2201 | slave->dev->name, |
2264 | "active " : "backup ") : "", | 2202 | bond->params.downdelay * bond->params.miimon); |
2265 | slave->dev->name, | ||
2266 | bond->params.downdelay * bond->params.miimon); | ||
2267 | } | 2203 | } |
2268 | /*FALLTHRU*/ | 2204 | /*FALLTHRU*/ |
2269 | case BOND_LINK_FAIL: | 2205 | case BOND_LINK_FAIL: |
@@ -2273,13 +2209,11 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
2273 | */ | 2209 | */ |
2274 | slave->link = BOND_LINK_UP; | 2210 | slave->link = BOND_LINK_UP; |
2275 | slave->jiffies = jiffies; | 2211 | slave->jiffies = jiffies; |
2276 | pr_info(DRV_NAME | 2212 | pr_info("%s: link status up again after %d ms for interface %s.\n", |
2277 | ": %s: link status up again after %d " | 2213 | bond->dev->name, |
2278 | "ms for interface %s.\n", | 2214 | (bond->params.downdelay - slave->delay) * |
2279 | bond->dev->name, | 2215 | bond->params.miimon, |
2280 | (bond->params.downdelay - slave->delay) * | 2216 | slave->dev->name); |
2281 | bond->params.miimon, | ||
2282 | slave->dev->name); | ||
2283 | continue; | 2217 | continue; |
2284 | } | 2218 | } |
2285 | 2219 | ||
@@ -2300,25 +2234,21 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
2300 | slave->delay = bond->params.updelay; | 2234 | slave->delay = bond->params.updelay; |
2301 | 2235 | ||
2302 | if (slave->delay) { | 2236 | if (slave->delay) { |
2303 | pr_info(DRV_NAME | 2237 | pr_info("%s: link status up for interface %s, enabling it in %d ms.\n", |
2304 | ": %s: link status up for " | 2238 | bond->dev->name, slave->dev->name, |
2305 | "interface %s, enabling it in %d ms.\n", | 2239 | ignore_updelay ? 0 : |
2306 | bond->dev->name, slave->dev->name, | 2240 | bond->params.updelay * |
2307 | ignore_updelay ? 0 : | 2241 | bond->params.miimon); |
2308 | bond->params.updelay * | ||
2309 | bond->params.miimon); | ||
2310 | } | 2242 | } |
2311 | /*FALLTHRU*/ | 2243 | /*FALLTHRU*/ |
2312 | case BOND_LINK_BACK: | 2244 | case BOND_LINK_BACK: |
2313 | if (!link_state) { | 2245 | if (!link_state) { |
2314 | slave->link = BOND_LINK_DOWN; | 2246 | slave->link = BOND_LINK_DOWN; |
2315 | pr_info(DRV_NAME | 2247 | pr_info("%s: link status down again after %d ms for interface %s.\n", |
2316 | ": %s: link status down again after %d " | 2248 | bond->dev->name, |
2317 | "ms for interface %s.\n", | 2249 | (bond->params.updelay - slave->delay) * |
2318 | bond->dev->name, | 2250 | bond->params.miimon, |
2319 | (bond->params.updelay - slave->delay) * | 2251 | slave->dev->name); |
2320 | bond->params.miimon, | ||
2321 | slave->dev->name); | ||
2322 | 2252 | ||
2323 | continue; | 2253 | continue; |
2324 | } | 2254 | } |
@@ -2366,10 +2296,8 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2366 | slave->state = BOND_STATE_BACKUP; | 2296 | slave->state = BOND_STATE_BACKUP; |
2367 | } | 2297 | } |
2368 | 2298 | ||
2369 | pr_info(DRV_NAME | 2299 | pr_info("%s: link status definitely up for interface %s.\n", |
2370 | ": %s: link status definitely " | 2300 | bond->dev->name, slave->dev->name); |
2371 | "up for interface %s.\n", | ||
2372 | bond->dev->name, slave->dev->name); | ||
2373 | 2301 | ||
2374 | /* notify ad that the link status has changed */ | 2302 | /* notify ad that the link status has changed */ |
2375 | if (bond->params.mode == BOND_MODE_8023AD) | 2303 | if (bond->params.mode == BOND_MODE_8023AD) |
@@ -2395,10 +2323,8 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2395 | bond->params.mode == BOND_MODE_8023AD) | 2323 | bond->params.mode == BOND_MODE_8023AD) |
2396 | bond_set_slave_inactive_flags(slave); | 2324 | bond_set_slave_inactive_flags(slave); |
2397 | 2325 | ||
2398 | pr_info(DRV_NAME | 2326 | pr_info("%s: link status definitely down for interface %s, disabling it\n", |
2399 | ": %s: link status definitely down for " | 2327 | bond->dev->name, slave->dev->name); |
2400 | "interface %s, disabling it\n", | ||
2401 | bond->dev->name, slave->dev->name); | ||
2402 | 2328 | ||
2403 | if (bond->params.mode == BOND_MODE_8023AD) | 2329 | if (bond->params.mode == BOND_MODE_8023AD) |
2404 | bond_3ad_handle_link_change(slave, | 2330 | bond_3ad_handle_link_change(slave, |
@@ -2414,8 +2340,7 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2414 | continue; | 2340 | continue; |
2415 | 2341 | ||
2416 | default: | 2342 | default: |
2417 | pr_err(DRV_NAME | 2343 | pr_err("%s: invalid new link %d on slave %s\n", |
2418 | ": %s: invalid new link %d on slave %s\n", | ||
2419 | bond->dev->name, slave->new_link, | 2344 | bond->dev->name, slave->new_link, |
2420 | slave->dev->name); | 2345 | slave->dev->name); |
2421 | slave->new_link = BOND_LINK_NOCHANGE; | 2346 | slave->new_link = BOND_LINK_NOCHANGE; |
@@ -2534,19 +2459,19 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ | |||
2534 | struct sk_buff *skb; | 2459 | struct sk_buff *skb; |
2535 | 2460 | ||
2536 | pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op, | 2461 | pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op, |
2537 | slave_dev->name, dest_ip, src_ip, vlan_id); | 2462 | slave_dev->name, dest_ip, src_ip, vlan_id); |
2538 | 2463 | ||
2539 | skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, | 2464 | skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, |
2540 | NULL, slave_dev->dev_addr, NULL); | 2465 | NULL, slave_dev->dev_addr, NULL); |
2541 | 2466 | ||
2542 | if (!skb) { | 2467 | if (!skb) { |
2543 | pr_err(DRV_NAME ": ARP packet allocation failed\n"); | 2468 | pr_err("ARP packet allocation failed\n"); |
2544 | return; | 2469 | return; |
2545 | } | 2470 | } |
2546 | if (vlan_id) { | 2471 | if (vlan_id) { |
2547 | skb = vlan_put_tag(skb, vlan_id); | 2472 | skb = vlan_put_tag(skb, vlan_id); |
2548 | if (!skb) { | 2473 | if (!skb) { |
2549 | pr_err(DRV_NAME ": failed to insert VLAN tag\n"); | 2474 | pr_err("failed to insert VLAN tag\n"); |
2550 | return; | 2475 | return; |
2551 | } | 2476 | } |
2552 | } | 2477 | } |
@@ -2586,9 +2511,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2586 | rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl); | 2511 | rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl); |
2587 | if (rv) { | 2512 | if (rv) { |
2588 | if (net_ratelimit()) { | 2513 | if (net_ratelimit()) { |
2589 | pr_warning(DRV_NAME | 2514 | pr_warning("%s: no route to arp_ip_target %pI4\n", |
2590 | ": %s: no route to arp_ip_target %pI4\n", | 2515 | bond->dev->name, &fl.fl4_dst); |
2591 | bond->dev->name, &fl.fl4_dst); | ||
2592 | } | 2516 | } |
2593 | continue; | 2517 | continue; |
2594 | } | 2518 | } |
@@ -2623,10 +2547,9 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2623 | } | 2547 | } |
2624 | 2548 | ||
2625 | if (net_ratelimit()) { | 2549 | if (net_ratelimit()) { |
2626 | pr_warning(DRV_NAME | 2550 | pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", |
2627 | ": %s: no path to arp_ip_target %pI4 via rt.dev %s\n", | 2551 | bond->dev->name, &fl.fl4_dst, |
2628 | bond->dev->name, &fl.fl4_dst, | 2552 | rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); |
2629 | rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); | ||
2630 | } | 2553 | } |
2631 | ip_rt_put(rt); | 2554 | ip_rt_put(rt); |
2632 | } | 2555 | } |
@@ -2644,8 +2567,8 @@ static void bond_send_gratuitous_arp(struct bonding *bond) | |||
2644 | struct vlan_entry *vlan; | 2567 | struct vlan_entry *vlan; |
2645 | struct net_device *vlan_dev; | 2568 | struct net_device *vlan_dev; |
2646 | 2569 | ||
2647 | pr_debug("bond_send_grat_arp: bond %s slave %s\n", bond->dev->name, | 2570 | pr_debug("bond_send_grat_arp: bond %s slave %s\n", |
2648 | slave ? slave->dev->name : "NULL"); | 2571 | bond->dev->name, slave ? slave->dev->name : "NULL"); |
2649 | 2572 | ||
2650 | if (!slave || !bond->send_grat_arp || | 2573 | if (!slave || !bond->send_grat_arp || |
2651 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) | 2574 | test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) |
@@ -2674,7 +2597,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2674 | 2597 | ||
2675 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { | 2598 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { |
2676 | pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", | 2599 | pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", |
2677 | &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); | 2600 | &sip, &tip, i, &targets[i], |
2601 | bond_has_this_ip(bond, tip)); | ||
2678 | if (sip == targets[i]) { | 2602 | if (sip == targets[i]) { |
2679 | if (bond_has_this_ip(bond, tip)) | 2603 | if (bond_has_this_ip(bond, tip)) |
2680 | slave->last_arp_rx = jiffies; | 2604 | slave->last_arp_rx = jiffies; |
@@ -2698,8 +2622,8 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack | |||
2698 | read_lock(&bond->lock); | 2622 | read_lock(&bond->lock); |
2699 | 2623 | ||
2700 | pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", | 2624 | pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", |
2701 | bond->dev->name, skb->dev ? skb->dev->name : "NULL", | 2625 | bond->dev->name, skb->dev ? skb->dev->name : "NULL", |
2702 | orig_dev ? orig_dev->name : "NULL"); | 2626 | orig_dev ? orig_dev->name : "NULL"); |
2703 | 2627 | ||
2704 | slave = bond_get_slave_by_dev(bond, orig_dev); | 2628 | slave = bond_get_slave_by_dev(bond, orig_dev); |
2705 | if (!slave || !slave_do_arp_validate(bond, slave)) | 2629 | if (!slave || !slave_do_arp_validate(bond, slave)) |
@@ -2724,9 +2648,9 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack | |||
2724 | memcpy(&tip, arp_ptr, 4); | 2648 | memcpy(&tip, arp_ptr, 4); |
2725 | 2649 | ||
2726 | pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", | 2650 | pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", |
2727 | bond->dev->name, slave->dev->name, slave->state, | 2651 | bond->dev->name, slave->dev->name, slave->state, |
2728 | bond->params.arp_validate, slave_do_arp_validate(bond, slave), | 2652 | bond->params.arp_validate, slave_do_arp_validate(bond, slave), |
2729 | &sip, &tip); | 2653 | &sip, &tip); |
2730 | 2654 | ||
2731 | /* | 2655 | /* |
2732 | * Backup slaves won't see the ARP reply, but do come through | 2656 | * Backup slaves won't see the ARP reply, but do come through |
@@ -2800,17 +2724,14 @@ void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2800 | * is closed. | 2724 | * is closed. |
2801 | */ | 2725 | */ |
2802 | if (!oldcurrent) { | 2726 | if (!oldcurrent) { |
2803 | pr_info(DRV_NAME | 2727 | pr_info("%s: link status definitely up for interface %s, ", |
2804 | ": %s: link status definitely " | 2728 | bond->dev->name, |
2805 | "up for interface %s, ", | 2729 | slave->dev->name); |
2806 | bond->dev->name, | ||
2807 | slave->dev->name); | ||
2808 | do_failover = 1; | 2730 | do_failover = 1; |
2809 | } else { | 2731 | } else { |
2810 | pr_info(DRV_NAME | 2732 | pr_info("%s: interface %s is now up\n", |
2811 | ": %s: interface %s is now up\n", | 2733 | bond->dev->name, |
2812 | bond->dev->name, | 2734 | slave->dev->name); |
2813 | slave->dev->name); | ||
2814 | } | 2735 | } |
2815 | } | 2736 | } |
2816 | } else { | 2737 | } else { |
@@ -2829,10 +2750,9 @@ void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2829 | if (slave->link_failure_count < UINT_MAX) | 2750 | if (slave->link_failure_count < UINT_MAX) |
2830 | slave->link_failure_count++; | 2751 | slave->link_failure_count++; |
2831 | 2752 | ||
2832 | pr_info(DRV_NAME | 2753 | pr_info("%s: interface %s is now down.\n", |
2833 | ": %s: interface %s is now down.\n", | 2754 | bond->dev->name, |
2834 | bond->dev->name, | 2755 | slave->dev->name); |
2835 | slave->dev->name); | ||
2836 | 2756 | ||
2837 | if (slave == oldcurrent) | 2757 | if (slave == oldcurrent) |
2838 | do_failover = 1; | 2758 | do_failover = 1; |
@@ -2965,9 +2885,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
2965 | slave->link = BOND_LINK_UP; | 2885 | slave->link = BOND_LINK_UP; |
2966 | bond->current_arp_slave = NULL; | 2886 | bond->current_arp_slave = NULL; |
2967 | 2887 | ||
2968 | pr_info(DRV_NAME | 2888 | pr_info("%s: link status definitely up for interface %s.\n", |
2969 | ": %s: link status definitely " | ||
2970 | "up for interface %s.\n", | ||
2971 | bond->dev->name, slave->dev->name); | 2889 | bond->dev->name, slave->dev->name); |
2972 | 2890 | ||
2973 | if (!bond->curr_active_slave || | 2891 | if (!bond->curr_active_slave || |
@@ -2985,9 +2903,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
2985 | slave->link = BOND_LINK_DOWN; | 2903 | slave->link = BOND_LINK_DOWN; |
2986 | bond_set_slave_inactive_flags(slave); | 2904 | bond_set_slave_inactive_flags(slave); |
2987 | 2905 | ||
2988 | pr_info(DRV_NAME | 2906 | pr_info("%s: link status definitely down for interface %s, disabling it\n", |
2989 | ": %s: link status definitely down for " | ||
2990 | "interface %s, disabling it\n", | ||
2991 | bond->dev->name, slave->dev->name); | 2907 | bond->dev->name, slave->dev->name); |
2992 | 2908 | ||
2993 | if (slave == bond->curr_active_slave) { | 2909 | if (slave == bond->curr_active_slave) { |
@@ -2998,8 +2914,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
2998 | continue; | 2914 | continue; |
2999 | 2915 | ||
3000 | default: | 2916 | default: |
3001 | pr_err(DRV_NAME | 2917 | pr_err("%s: impossible: new_link %d on slave %s\n", |
3002 | ": %s: impossible: new_link %d on slave %s\n", | ||
3003 | bond->dev->name, slave->new_link, | 2918 | bond->dev->name, slave->new_link, |
3004 | slave->dev->name); | 2919 | slave->dev->name); |
3005 | continue; | 2920 | continue; |
@@ -3028,9 +2943,9 @@ static void bond_ab_arp_probe(struct bonding *bond) | |||
3028 | read_lock(&bond->curr_slave_lock); | 2943 | read_lock(&bond->curr_slave_lock); |
3029 | 2944 | ||
3030 | if (bond->current_arp_slave && bond->curr_active_slave) | 2945 | if (bond->current_arp_slave && bond->curr_active_slave) |
3031 | pr_info(DRV_NAME "PROBE: c_arp %s && cas %s BAD\n", | 2946 | pr_info("PROBE: c_arp %s && cas %s BAD\n", |
3032 | bond->current_arp_slave->dev->name, | 2947 | bond->current_arp_slave->dev->name, |
3033 | bond->curr_active_slave->dev->name); | 2948 | bond->curr_active_slave->dev->name); |
3034 | 2949 | ||
3035 | if (bond->curr_active_slave) { | 2950 | if (bond->curr_active_slave) { |
3036 | bond_arp_send_all(bond, bond->curr_active_slave); | 2951 | bond_arp_send_all(bond, bond->curr_active_slave); |
@@ -3078,9 +2993,8 @@ static void bond_ab_arp_probe(struct bonding *bond) | |||
3078 | 2993 | ||
3079 | bond_set_slave_inactive_flags(slave); | 2994 | bond_set_slave_inactive_flags(slave); |
3080 | 2995 | ||
3081 | pr_info(DRV_NAME | 2996 | pr_info("%s: backup interface %s is now down.\n", |
3082 | ": %s: backup interface %s is now down.\n", | 2997 | bond->dev->name, slave->dev->name); |
3083 | bond->dev->name, slave->dev->name); | ||
3084 | } | 2998 | } |
3085 | } | 2999 | } |
3086 | } | 3000 | } |
@@ -3360,9 +3274,8 @@ static void bond_create_proc_entry(struct bonding *bond) | |||
3360 | S_IRUGO, bn->proc_dir, | 3274 | S_IRUGO, bn->proc_dir, |
3361 | &bond_info_fops, bond); | 3275 | &bond_info_fops, bond); |
3362 | if (bond->proc_entry == NULL) | 3276 | if (bond->proc_entry == NULL) |
3363 | pr_warning(DRV_NAME | 3277 | pr_warning("Warning: Cannot create /proc/net/%s/%s\n", |
3364 | ": Warning: Cannot create /proc/net/%s/%s\n", | 3278 | DRV_NAME, bond_dev->name); |
3365 | DRV_NAME, bond_dev->name); | ||
3366 | else | 3279 | else |
3367 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); | 3280 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); |
3368 | } | 3281 | } |
@@ -3388,9 +3301,8 @@ static void bond_create_proc_dir(struct bond_net *bn) | |||
3388 | if (!bn->proc_dir) { | 3301 | if (!bn->proc_dir) { |
3389 | bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); | 3302 | bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); |
3390 | if (!bn->proc_dir) | 3303 | if (!bn->proc_dir) |
3391 | pr_warning(DRV_NAME | 3304 | pr_warning("Warning: cannot create /proc/net/%s\n", |
3392 | ": Warning: cannot create /proc/net/%s\n", | 3305 | DRV_NAME); |
3393 | DRV_NAME); | ||
3394 | } | 3306 | } |
3395 | } | 3307 | } |
3396 | 3308 | ||
@@ -3539,8 +3451,8 @@ static int bond_netdev_event(struct notifier_block *this, | |||
3539 | struct net_device *event_dev = (struct net_device *)ptr; | 3451 | struct net_device *event_dev = (struct net_device *)ptr; |
3540 | 3452 | ||
3541 | pr_debug("event_dev: %s, event: %lx\n", | 3453 | pr_debug("event_dev: %s, event: %lx\n", |
3542 | (event_dev ? event_dev->name : "None"), | 3454 | event_dev ? event_dev->name : "None", |
3543 | event); | 3455 | event); |
3544 | 3456 | ||
3545 | if (!(event_dev->priv_flags & IFF_BONDING)) | 3457 | if (!(event_dev->priv_flags & IFF_BONDING)) |
3546 | return NOTIFY_DONE; | 3458 | return NOTIFY_DONE; |
@@ -3875,8 +3787,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
3875 | struct mii_ioctl_data *mii = NULL; | 3787 | struct mii_ioctl_data *mii = NULL; |
3876 | int res = 0; | 3788 | int res = 0; |
3877 | 3789 | ||
3878 | pr_debug("bond_ioctl: master=%s, cmd=%d\n", | 3790 | pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd); |
3879 | bond_dev->name, cmd); | ||
3880 | 3791 | ||
3881 | switch (cmd) { | 3792 | switch (cmd) { |
3882 | case SIOCGMIIPHY: | 3793 | case SIOCGMIIPHY: |
@@ -3945,12 +3856,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
3945 | 3856 | ||
3946 | slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave); | 3857 | slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave); |
3947 | 3858 | ||
3948 | pr_debug("slave_dev=%p: \n", slave_dev); | 3859 | pr_debug("slave_dev=%p:\n", slave_dev); |
3949 | 3860 | ||
3950 | if (!slave_dev) | 3861 | if (!slave_dev) |
3951 | res = -ENODEV; | 3862 | res = -ENODEV; |
3952 | else { | 3863 | else { |
3953 | pr_debug("slave_dev->name=%s: \n", slave_dev->name); | 3864 | pr_debug("slave_dev->name=%s:\n", slave_dev->name); |
3954 | switch (cmd) { | 3865 | switch (cmd) { |
3955 | case BOND_ENSLAVE_OLD: | 3866 | case BOND_ENSLAVE_OLD: |
3956 | case SIOCBONDENSLAVE: | 3867 | case SIOCBONDENSLAVE: |
@@ -4059,7 +3970,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) | |||
4059 | int i; | 3970 | int i; |
4060 | 3971 | ||
4061 | pr_debug("bond=%p, name=%s, new_mtu=%d\n", bond, | 3972 | pr_debug("bond=%p, name=%s, new_mtu=%d\n", bond, |
4062 | (bond_dev ? bond_dev->name : "None"), new_mtu); | 3973 | (bond_dev ? bond_dev->name : "None"), new_mtu); |
4063 | 3974 | ||
4064 | /* Can't hold bond->lock with bh disabled here since | 3975 | /* Can't hold bond->lock with bh disabled here since |
4065 | * some base drivers panic. On the other hand we can't | 3976 | * some base drivers panic. On the other hand we can't |
@@ -4077,8 +3988,10 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) | |||
4077 | */ | 3988 | */ |
4078 | 3989 | ||
4079 | bond_for_each_slave(bond, slave, i) { | 3990 | bond_for_each_slave(bond, slave, i) { |
4080 | pr_debug("s %p s->p %p c_m %p\n", slave, | 3991 | pr_debug("s %p s->p %p c_m %p\n", |
4081 | slave->prev, slave->dev->netdev_ops->ndo_change_mtu); | 3992 | slave, |
3993 | slave->prev, | ||
3994 | slave->dev->netdev_ops->ndo_change_mtu); | ||
4082 | 3995 | ||
4083 | res = dev_set_mtu(slave->dev, new_mtu); | 3996 | res = dev_set_mtu(slave->dev, new_mtu); |
4084 | 3997 | ||
@@ -4108,8 +4021,8 @@ unwind: | |||
4108 | 4021 | ||
4109 | tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu); | 4022 | tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu); |
4110 | if (tmp_res) { | 4023 | if (tmp_res) { |
4111 | pr_debug("unwind err %d dev %s\n", tmp_res, | 4024 | pr_debug("unwind err %d dev %s\n", |
4112 | slave->dev->name); | 4025 | tmp_res, slave->dev->name); |
4113 | } | 4026 | } |
4114 | } | 4027 | } |
4115 | 4028 | ||
@@ -4135,7 +4048,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) | |||
4135 | return bond_alb_set_mac_address(bond_dev, addr); | 4048 | return bond_alb_set_mac_address(bond_dev, addr); |
4136 | 4049 | ||
4137 | 4050 | ||
4138 | pr_debug("bond=%p, name=%s\n", bond, (bond_dev ? bond_dev->name : "None")); | 4051 | pr_debug("bond=%p, name=%s\n", |
4052 | bond, bond_dev ? bond_dev->name : "None"); | ||
4139 | 4053 | ||
4140 | /* | 4054 | /* |
4141 | * If fail_over_mac is set to active, do nothing and return | 4055 | * If fail_over_mac is set to active, do nothing and return |
@@ -4200,8 +4114,8 @@ unwind: | |||
4200 | 4114 | ||
4201 | tmp_res = dev_set_mac_address(slave->dev, &tmp_sa); | 4115 | tmp_res = dev_set_mac_address(slave->dev, &tmp_sa); |
4202 | if (tmp_res) { | 4116 | if (tmp_res) { |
4203 | pr_debug("unwind err %d dev %s\n", tmp_res, | 4117 | pr_debug("unwind err %d dev %s\n", |
4204 | slave->dev->name); | 4118 | tmp_res, slave->dev->name); |
4205 | } | 4119 | } |
4206 | } | 4120 | } |
4207 | 4121 | ||
@@ -4357,9 +4271,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) | |||
4357 | if (tx_dev) { | 4271 | if (tx_dev) { |
4358 | struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); | 4272 | struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); |
4359 | if (!skb2) { | 4273 | if (!skb2) { |
4360 | pr_err(DRV_NAME | 4274 | pr_err("%s: Error: bond_xmit_broadcast(): skb_clone() failed\n", |
4361 | ": %s: Error: bond_xmit_broadcast(): " | ||
4362 | "skb_clone() failed\n", | ||
4363 | bond_dev->name); | 4275 | bond_dev->name); |
4364 | continue; | 4276 | continue; |
4365 | } | 4277 | } |
@@ -4425,8 +4337,8 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4425 | return bond_alb_xmit(skb, dev); | 4337 | return bond_alb_xmit(skb, dev); |
4426 | default: | 4338 | default: |
4427 | /* Should never happen, mode already checked */ | 4339 | /* Should never happen, mode already checked */ |
4428 | pr_err(DRV_NAME ": %s: Error: Unknown bonding mode %d\n", | 4340 | pr_err("%s: Error: Unknown bonding mode %d\n", |
4429 | dev->name, bond->params.mode); | 4341 | dev->name, bond->params.mode); |
4430 | WARN_ON_ONCE(1); | 4342 | WARN_ON_ONCE(1); |
4431 | dev_kfree_skb(skb); | 4343 | dev_kfree_skb(skb); |
4432 | return NETDEV_TX_OK; | 4344 | return NETDEV_TX_OK; |
@@ -4462,10 +4374,8 @@ void bond_set_mode_ops(struct bonding *bond, int mode) | |||
4462 | break; | 4374 | break; |
4463 | default: | 4375 | default: |
4464 | /* Should never happen, mode already checked */ | 4376 | /* Should never happen, mode already checked */ |
4465 | pr_err(DRV_NAME | 4377 | pr_err("%s: Error: Unknown bonding mode %d\n", |
4466 | ": %s: Error: Unknown bonding mode %d\n", | 4378 | bond_dev->name, mode); |
4467 | bond_dev->name, | ||
4468 | mode); | ||
4469 | break; | 4379 | break; |
4470 | } | 4380 | } |
4471 | } | 4381 | } |
@@ -4650,8 +4560,7 @@ static int bond_check_params(struct bond_params *params) | |||
4650 | if (mode) { | 4560 | if (mode) { |
4651 | bond_mode = bond_parse_parm(mode, bond_mode_tbl); | 4561 | bond_mode = bond_parse_parm(mode, bond_mode_tbl); |
4652 | if (bond_mode == -1) { | 4562 | if (bond_mode == -1) { |
4653 | pr_err(DRV_NAME | 4563 | pr_err("Error: Invalid bonding mode \"%s\"\n", |
4654 | ": Error: Invalid bonding mode \"%s\"\n", | ||
4655 | mode == NULL ? "NULL" : mode); | 4564 | mode == NULL ? "NULL" : mode); |
4656 | return -EINVAL; | 4565 | return -EINVAL; |
4657 | } | 4566 | } |
@@ -4660,16 +4569,13 @@ static int bond_check_params(struct bond_params *params) | |||
4660 | if (xmit_hash_policy) { | 4569 | if (xmit_hash_policy) { |
4661 | if ((bond_mode != BOND_MODE_XOR) && | 4570 | if ((bond_mode != BOND_MODE_XOR) && |
4662 | (bond_mode != BOND_MODE_8023AD)) { | 4571 | (bond_mode != BOND_MODE_8023AD)) { |
4663 | pr_info(DRV_NAME | 4572 | pr_info("xmit_hash_policy param is irrelevant in mode %s\n", |
4664 | ": xmit_hash_policy param is irrelevant in" | ||
4665 | " mode %s\n", | ||
4666 | bond_mode_name(bond_mode)); | 4573 | bond_mode_name(bond_mode)); |
4667 | } else { | 4574 | } else { |
4668 | xmit_hashtype = bond_parse_parm(xmit_hash_policy, | 4575 | xmit_hashtype = bond_parse_parm(xmit_hash_policy, |
4669 | xmit_hashtype_tbl); | 4576 | xmit_hashtype_tbl); |
4670 | if (xmit_hashtype == -1) { | 4577 | if (xmit_hashtype == -1) { |
4671 | pr_err(DRV_NAME | 4578 | pr_err("Error: Invalid xmit_hash_policy \"%s\"\n", |
4672 | ": Error: Invalid xmit_hash_policy \"%s\"\n", | ||
4673 | xmit_hash_policy == NULL ? "NULL" : | 4579 | xmit_hash_policy == NULL ? "NULL" : |
4674 | xmit_hash_policy); | 4580 | xmit_hash_policy); |
4675 | return -EINVAL; | 4581 | return -EINVAL; |
@@ -4679,14 +4585,12 @@ static int bond_check_params(struct bond_params *params) | |||
4679 | 4585 | ||
4680 | if (lacp_rate) { | 4586 | if (lacp_rate) { |
4681 | if (bond_mode != BOND_MODE_8023AD) { | 4587 | if (bond_mode != BOND_MODE_8023AD) { |
4682 | pr_info(DRV_NAME | 4588 | pr_info("lacp_rate param is irrelevant in mode %s\n", |
4683 | ": lacp_rate param is irrelevant in mode %s\n", | 4589 | bond_mode_name(bond_mode)); |
4684 | bond_mode_name(bond_mode)); | ||
4685 | } else { | 4590 | } else { |
4686 | lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); | 4591 | lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); |
4687 | if (lacp_fast == -1) { | 4592 | if (lacp_fast == -1) { |
4688 | pr_err(DRV_NAME | 4593 | pr_err("Error: Invalid lacp rate \"%s\"\n", |
4689 | ": Error: Invalid lacp rate \"%s\"\n", | ||
4690 | lacp_rate == NULL ? "NULL" : lacp_rate); | 4594 | lacp_rate == NULL ? "NULL" : lacp_rate); |
4691 | return -EINVAL; | 4595 | return -EINVAL; |
4692 | } | 4596 | } |
@@ -4696,82 +4600,64 @@ static int bond_check_params(struct bond_params *params) | |||
4696 | if (ad_select) { | 4600 | if (ad_select) { |
4697 | params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); | 4601 | params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); |
4698 | if (params->ad_select == -1) { | 4602 | if (params->ad_select == -1) { |
4699 | pr_err(DRV_NAME | 4603 | pr_err("Error: Invalid ad_select \"%s\"\n", |
4700 | ": Error: Invalid ad_select \"%s\"\n", | ||
4701 | ad_select == NULL ? "NULL" : ad_select); | 4604 | ad_select == NULL ? "NULL" : ad_select); |
4702 | return -EINVAL; | 4605 | return -EINVAL; |
4703 | } | 4606 | } |
4704 | 4607 | ||
4705 | if (bond_mode != BOND_MODE_8023AD) { | 4608 | if (bond_mode != BOND_MODE_8023AD) { |
4706 | pr_warning(DRV_NAME | 4609 | pr_warning("ad_select param only affects 802.3ad mode\n"); |
4707 | ": ad_select param only affects 802.3ad mode\n"); | ||
4708 | } | 4610 | } |
4709 | } else { | 4611 | } else { |
4710 | params->ad_select = BOND_AD_STABLE; | 4612 | params->ad_select = BOND_AD_STABLE; |
4711 | } | 4613 | } |
4712 | 4614 | ||
4713 | if (max_bonds < 0) { | 4615 | if (max_bonds < 0) { |
4714 | pr_warning(DRV_NAME | 4616 | pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", |
4715 | ": Warning: max_bonds (%d) not in range %d-%d, so it " | 4617 | max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS); |
4716 | "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", | ||
4717 | max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS); | ||
4718 | max_bonds = BOND_DEFAULT_MAX_BONDS; | 4618 | max_bonds = BOND_DEFAULT_MAX_BONDS; |
4719 | } | 4619 | } |
4720 | 4620 | ||
4721 | if (miimon < 0) { | 4621 | if (miimon < 0) { |
4722 | pr_warning(DRV_NAME | 4622 | pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to %d\n", |
4723 | ": Warning: miimon module parameter (%d), " | 4623 | miimon, INT_MAX, BOND_LINK_MON_INTERV); |
4724 | "not in range 0-%d, so it was reset to %d\n", | ||
4725 | miimon, INT_MAX, BOND_LINK_MON_INTERV); | ||
4726 | miimon = BOND_LINK_MON_INTERV; | 4624 | miimon = BOND_LINK_MON_INTERV; |
4727 | } | 4625 | } |
4728 | 4626 | ||
4729 | if (updelay < 0) { | 4627 | if (updelay < 0) { |
4730 | pr_warning(DRV_NAME | 4628 | pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n", |
4731 | ": Warning: updelay module parameter (%d), " | 4629 | updelay, INT_MAX); |
4732 | "not in range 0-%d, so it was reset to 0\n", | ||
4733 | updelay, INT_MAX); | ||
4734 | updelay = 0; | 4630 | updelay = 0; |
4735 | } | 4631 | } |
4736 | 4632 | ||
4737 | if (downdelay < 0) { | 4633 | if (downdelay < 0) { |
4738 | pr_warning(DRV_NAME | 4634 | pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n", |
4739 | ": Warning: downdelay module parameter (%d), " | 4635 | downdelay, INT_MAX); |
4740 | "not in range 0-%d, so it was reset to 0\n", | ||
4741 | downdelay, INT_MAX); | ||
4742 | downdelay = 0; | 4636 | downdelay = 0; |
4743 | } | 4637 | } |
4744 | 4638 | ||
4745 | if ((use_carrier != 0) && (use_carrier != 1)) { | 4639 | if ((use_carrier != 0) && (use_carrier != 1)) { |
4746 | pr_warning(DRV_NAME | 4640 | pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n", |
4747 | ": Warning: use_carrier module parameter (%d), " | 4641 | use_carrier); |
4748 | "not of valid value (0/1), so it was set to 1\n", | ||
4749 | use_carrier); | ||
4750 | use_carrier = 1; | 4642 | use_carrier = 1; |
4751 | } | 4643 | } |
4752 | 4644 | ||
4753 | if (num_grat_arp < 0 || num_grat_arp > 255) { | 4645 | if (num_grat_arp < 0 || num_grat_arp > 255) { |
4754 | pr_warning(DRV_NAME | 4646 | pr_warning("Warning: num_grat_arp (%d) not in range 0-255 so it was reset to 1 \n", |
4755 | ": Warning: num_grat_arp (%d) not in range 0-255 so it " | 4647 | num_grat_arp); |
4756 | "was reset to 1 \n", num_grat_arp); | ||
4757 | num_grat_arp = 1; | 4648 | num_grat_arp = 1; |
4758 | } | 4649 | } |
4759 | 4650 | ||
4760 | if (num_unsol_na < 0 || num_unsol_na > 255) { | 4651 | if (num_unsol_na < 0 || num_unsol_na > 255) { |
4761 | pr_warning(DRV_NAME | 4652 | pr_warning("Warning: num_unsol_na (%d) not in range 0-255 so it was reset to 1 \n", |
4762 | ": Warning: num_unsol_na (%d) not in range 0-255 so it " | 4653 | num_unsol_na); |
4763 | "was reset to 1 \n", num_unsol_na); | ||
4764 | num_unsol_na = 1; | 4654 | num_unsol_na = 1; |
4765 | } | 4655 | } |
4766 | 4656 | ||
4767 | /* reset values for 802.3ad */ | 4657 | /* reset values for 802.3ad */ |
4768 | if (bond_mode == BOND_MODE_8023AD) { | 4658 | if (bond_mode == BOND_MODE_8023AD) { |
4769 | if (!miimon) { | 4659 | if (!miimon) { |
4770 | pr_warning(DRV_NAME | 4660 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n"); |
4771 | ": Warning: miimon must be specified, " | ||
4772 | "otherwise bonding will not detect link " | ||
4773 | "failure, speed and duplex which are " | ||
4774 | "essential for 802.3ad operation\n"); | ||
4775 | pr_warning("Forcing miimon to 100msec\n"); | 4661 | pr_warning("Forcing miimon to 100msec\n"); |
4776 | miimon = 100; | 4662 | miimon = 100; |
4777 | } | 4663 | } |
@@ -4781,24 +4667,15 @@ static int bond_check_params(struct bond_params *params) | |||
4781 | if ((bond_mode == BOND_MODE_TLB) || | 4667 | if ((bond_mode == BOND_MODE_TLB) || |
4782 | (bond_mode == BOND_MODE_ALB)) { | 4668 | (bond_mode == BOND_MODE_ALB)) { |
4783 | if (!miimon) { | 4669 | if (!miimon) { |
4784 | pr_warning(DRV_NAME | 4670 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n"); |
4785 | ": Warning: miimon must be specified, " | ||
4786 | "otherwise bonding will not detect link " | ||
4787 | "failure and link speed which are essential " | ||
4788 | "for TLB/ALB load balancing\n"); | ||
4789 | pr_warning("Forcing miimon to 100msec\n"); | 4671 | pr_warning("Forcing miimon to 100msec\n"); |
4790 | miimon = 100; | 4672 | miimon = 100; |
4791 | } | 4673 | } |
4792 | } | 4674 | } |
4793 | 4675 | ||
4794 | if (bond_mode == BOND_MODE_ALB) { | 4676 | if (bond_mode == BOND_MODE_ALB) { |
4795 | pr_notice(DRV_NAME | 4677 | pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n", |
4796 | ": In ALB mode you might experience client " | 4678 | updelay); |
4797 | "disconnections upon reconnection of a link if the " | ||
4798 | "bonding module updelay parameter (%d msec) is " | ||
4799 | "incompatible with the forwarding delay time of the " | ||
4800 | "switch\n", | ||
4801 | updelay); | ||
4802 | } | 4679 | } |
4803 | 4680 | ||
4804 | if (!miimon) { | 4681 | if (!miimon) { |
@@ -4806,49 +4683,37 @@ static int bond_check_params(struct bond_params *params) | |||
4806 | /* just warn the user the up/down delay will have | 4683 | /* just warn the user the up/down delay will have |
4807 | * no effect since miimon is zero... | 4684 | * no effect since miimon is zero... |
4808 | */ | 4685 | */ |
4809 | pr_warning(DRV_NAME | 4686 | pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n", |
4810 | ": Warning: miimon module parameter not set " | 4687 | updelay, downdelay); |
4811 | "and updelay (%d) or downdelay (%d) module " | ||
4812 | "parameter is set; updelay and downdelay have " | ||
4813 | "no effect unless miimon is set\n", | ||
4814 | updelay, downdelay); | ||
4815 | } | 4688 | } |
4816 | } else { | 4689 | } else { |
4817 | /* don't allow arp monitoring */ | 4690 | /* don't allow arp monitoring */ |
4818 | if (arp_interval) { | 4691 | if (arp_interval) { |
4819 | pr_warning(DRV_NAME | 4692 | pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n", |
4820 | ": Warning: miimon (%d) and arp_interval (%d) " | 4693 | miimon, arp_interval); |
4821 | "can't be used simultaneously, disabling ARP " | ||
4822 | "monitoring\n", | ||
4823 | miimon, arp_interval); | ||
4824 | arp_interval = 0; | 4694 | arp_interval = 0; |
4825 | } | 4695 | } |
4826 | 4696 | ||
4827 | if ((updelay % miimon) != 0) { | 4697 | if ((updelay % miimon) != 0) { |
4828 | pr_warning(DRV_NAME | 4698 | pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", |
4829 | ": Warning: updelay (%d) is not a multiple " | 4699 | updelay, miimon, |
4830 | "of miimon (%d), updelay rounded to %d ms\n", | 4700 | (updelay / miimon) * miimon); |
4831 | updelay, miimon, (updelay / miimon) * miimon); | ||
4832 | } | 4701 | } |
4833 | 4702 | ||
4834 | updelay /= miimon; | 4703 | updelay /= miimon; |
4835 | 4704 | ||
4836 | if ((downdelay % miimon) != 0) { | 4705 | if ((downdelay % miimon) != 0) { |
4837 | pr_warning(DRV_NAME | 4706 | pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n", |
4838 | ": Warning: downdelay (%d) is not a multiple " | 4707 | downdelay, miimon, |
4839 | "of miimon (%d), downdelay rounded to %d ms\n", | 4708 | (downdelay / miimon) * miimon); |
4840 | downdelay, miimon, | ||
4841 | (downdelay / miimon) * miimon); | ||
4842 | } | 4709 | } |
4843 | 4710 | ||
4844 | downdelay /= miimon; | 4711 | downdelay /= miimon; |
4845 | } | 4712 | } |
4846 | 4713 | ||
4847 | if (arp_interval < 0) { | 4714 | if (arp_interval < 0) { |
4848 | pr_warning(DRV_NAME | 4715 | pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to %d\n", |
4849 | ": Warning: arp_interval module parameter (%d) " | 4716 | arp_interval, INT_MAX, BOND_LINK_ARP_INTERV); |
4850 | ", not in range 0-%d, so it was reset to %d\n", | ||
4851 | arp_interval, INT_MAX, BOND_LINK_ARP_INTERV); | ||
4852 | arp_interval = BOND_LINK_ARP_INTERV; | 4717 | arp_interval = BOND_LINK_ARP_INTERV; |
4853 | } | 4718 | } |
4854 | 4719 | ||
@@ -4858,10 +4723,8 @@ static int bond_check_params(struct bond_params *params) | |||
4858 | /* not complete check, but should be good enough to | 4723 | /* not complete check, but should be good enough to |
4859 | catch mistakes */ | 4724 | catch mistakes */ |
4860 | if (!isdigit(arp_ip_target[arp_ip_count][0])) { | 4725 | if (!isdigit(arp_ip_target[arp_ip_count][0])) { |
4861 | pr_warning(DRV_NAME | 4726 | pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", |
4862 | ": Warning: bad arp_ip_target module parameter " | 4727 | arp_ip_target[arp_ip_count]); |
4863 | "(%s), ARP monitoring will not be performed\n", | ||
4864 | arp_ip_target[arp_ip_count]); | ||
4865 | arp_interval = 0; | 4728 | arp_interval = 0; |
4866 | } else { | 4729 | } else { |
4867 | __be32 ip = in_aton(arp_ip_target[arp_ip_count]); | 4730 | __be32 ip = in_aton(arp_ip_target[arp_ip_count]); |
@@ -4871,31 +4734,25 @@ static int bond_check_params(struct bond_params *params) | |||
4871 | 4734 | ||
4872 | if (arp_interval && !arp_ip_count) { | 4735 | if (arp_interval && !arp_ip_count) { |
4873 | /* don't allow arping if no arp_ip_target given... */ | 4736 | /* don't allow arping if no arp_ip_target given... */ |
4874 | pr_warning(DRV_NAME | 4737 | pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n", |
4875 | ": Warning: arp_interval module parameter (%d) " | 4738 | arp_interval); |
4876 | "specified without providing an arp_ip_target " | ||
4877 | "parameter, arp_interval was reset to 0\n", | ||
4878 | arp_interval); | ||
4879 | arp_interval = 0; | 4739 | arp_interval = 0; |
4880 | } | 4740 | } |
4881 | 4741 | ||
4882 | if (arp_validate) { | 4742 | if (arp_validate) { |
4883 | if (bond_mode != BOND_MODE_ACTIVEBACKUP) { | 4743 | if (bond_mode != BOND_MODE_ACTIVEBACKUP) { |
4884 | pr_err(DRV_NAME | 4744 | pr_err("arp_validate only supported in active-backup mode\n"); |
4885 | ": arp_validate only supported in active-backup mode\n"); | ||
4886 | return -EINVAL; | 4745 | return -EINVAL; |
4887 | } | 4746 | } |
4888 | if (!arp_interval) { | 4747 | if (!arp_interval) { |
4889 | pr_err(DRV_NAME | 4748 | pr_err("arp_validate requires arp_interval\n"); |
4890 | ": arp_validate requires arp_interval\n"); | ||
4891 | return -EINVAL; | 4749 | return -EINVAL; |
4892 | } | 4750 | } |
4893 | 4751 | ||
4894 | arp_validate_value = bond_parse_parm(arp_validate, | 4752 | arp_validate_value = bond_parse_parm(arp_validate, |
4895 | arp_validate_tbl); | 4753 | arp_validate_tbl); |
4896 | if (arp_validate_value == -1) { | 4754 | if (arp_validate_value == -1) { |
4897 | pr_err(DRV_NAME | 4755 | pr_err("Error: invalid arp_validate \"%s\"\n", |
4898 | ": Error: invalid arp_validate \"%s\"\n", | ||
4899 | arp_validate == NULL ? "NULL" : arp_validate); | 4756 | arp_validate == NULL ? "NULL" : arp_validate); |
4900 | return -EINVAL; | 4757 | return -EINVAL; |
4901 | } | 4758 | } |
@@ -4903,17 +4760,14 @@ static int bond_check_params(struct bond_params *params) | |||
4903 | arp_validate_value = 0; | 4760 | arp_validate_value = 0; |
4904 | 4761 | ||
4905 | if (miimon) { | 4762 | if (miimon) { |
4906 | pr_info(DRV_NAME | 4763 | pr_info("MII link monitoring set to %d ms\n", miimon); |
4907 | ": MII link monitoring set to %d ms\n", | ||
4908 | miimon); | ||
4909 | } else if (arp_interval) { | 4764 | } else if (arp_interval) { |
4910 | int i; | 4765 | int i; |
4911 | 4766 | ||
4912 | pr_info(DRV_NAME ": ARP monitoring set to %d ms," | 4767 | pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):", |
4913 | " validate %s, with %d target(s):", | 4768 | arp_interval, |
4914 | arp_interval, | 4769 | arp_validate_tbl[arp_validate_value].modename, |
4915 | arp_validate_tbl[arp_validate_value].modename, | 4770 | arp_ip_count); |
4916 | arp_ip_count); | ||
4917 | 4771 | ||
4918 | for (i = 0; i < arp_ip_count; i++) | 4772 | for (i = 0; i < arp_ip_count; i++) |
4919 | pr_info(" %s", arp_ip_target[i]); | 4773 | pr_info(" %s", arp_ip_target[i]); |
@@ -4924,21 +4778,15 @@ static int bond_check_params(struct bond_params *params) | |||
4924 | /* miimon and arp_interval not set, we need one so things | 4778 | /* miimon and arp_interval not set, we need one so things |
4925 | * work as expected, see bonding.txt for details | 4779 | * work as expected, see bonding.txt for details |
4926 | */ | 4780 | */ |
4927 | pr_warning(DRV_NAME | 4781 | pr_warning("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n"); |
4928 | ": Warning: either miimon or arp_interval and " | ||
4929 | "arp_ip_target module parameters must be specified, " | ||
4930 | "otherwise bonding will not detect link failures! see " | ||
4931 | "bonding.txt for details.\n"); | ||
4932 | } | 4782 | } |
4933 | 4783 | ||
4934 | if (primary && !USES_PRIMARY(bond_mode)) { | 4784 | if (primary && !USES_PRIMARY(bond_mode)) { |
4935 | /* currently, using a primary only makes sense | 4785 | /* currently, using a primary only makes sense |
4936 | * in active backup, TLB or ALB modes | 4786 | * in active backup, TLB or ALB modes |
4937 | */ | 4787 | */ |
4938 | pr_warning(DRV_NAME | 4788 | pr_warning("Warning: %s primary device specified but has no effect in %s mode\n", |
4939 | ": Warning: %s primary device specified but has no " | 4789 | primary, bond_mode_name(bond_mode)); |
4940 | "effect in %s mode\n", | ||
4941 | primary, bond_mode_name(bond_mode)); | ||
4942 | primary = NULL; | 4790 | primary = NULL; |
4943 | } | 4791 | } |
4944 | 4792 | ||
@@ -4946,8 +4794,7 @@ static int bond_check_params(struct bond_params *params) | |||
4946 | primary_reselect_value = bond_parse_parm(primary_reselect, | 4794 | primary_reselect_value = bond_parse_parm(primary_reselect, |
4947 | pri_reselect_tbl); | 4795 | pri_reselect_tbl); |
4948 | if (primary_reselect_value == -1) { | 4796 | if (primary_reselect_value == -1) { |
4949 | pr_err(DRV_NAME | 4797 | pr_err("Error: Invalid primary_reselect \"%s\"\n", |
4950 | ": Error: Invalid primary_reselect \"%s\"\n", | ||
4951 | primary_reselect == | 4798 | primary_reselect == |
4952 | NULL ? "NULL" : primary_reselect); | 4799 | NULL ? "NULL" : primary_reselect); |
4953 | return -EINVAL; | 4800 | return -EINVAL; |
@@ -4960,16 +4807,13 @@ static int bond_check_params(struct bond_params *params) | |||
4960 | fail_over_mac_value = bond_parse_parm(fail_over_mac, | 4807 | fail_over_mac_value = bond_parse_parm(fail_over_mac, |
4961 | fail_over_mac_tbl); | 4808 | fail_over_mac_tbl); |
4962 | if (fail_over_mac_value == -1) { | 4809 | if (fail_over_mac_value == -1) { |
4963 | pr_err(DRV_NAME | 4810 | pr_err("Error: invalid fail_over_mac \"%s\"\n", |
4964 | ": Error: invalid fail_over_mac \"%s\"\n", | ||
4965 | arp_validate == NULL ? "NULL" : arp_validate); | 4811 | arp_validate == NULL ? "NULL" : arp_validate); |
4966 | return -EINVAL; | 4812 | return -EINVAL; |
4967 | } | 4813 | } |
4968 | 4814 | ||
4969 | if (bond_mode != BOND_MODE_ACTIVEBACKUP) | 4815 | if (bond_mode != BOND_MODE_ACTIVEBACKUP) |
4970 | pr_warning(DRV_NAME | 4816 | pr_warning("Warning: fail_over_mac only affects active-backup mode.\n"); |
4971 | ": Warning: fail_over_mac only affects " | ||
4972 | "active-backup mode.\n"); | ||
4973 | } else { | 4817 | } else { |
4974 | fail_over_mac_value = BOND_FOM_NONE; | 4818 | fail_over_mac_value = BOND_FOM_NONE; |
4975 | } | 4819 | } |
@@ -5076,8 +4920,7 @@ int bond_create(struct net *net, const char *name) | |||
5076 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", | 4920 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", |
5077 | bond_setup); | 4921 | bond_setup); |
5078 | if (!bond_dev) { | 4922 | if (!bond_dev) { |
5079 | pr_err(DRV_NAME ": %s: eek! can't alloc netdev!\n", | 4923 | pr_err("%s: eek! can't alloc netdev!\n", name); |
5080 | name); | ||
5081 | res = -ENOMEM; | 4924 | res = -ENOMEM; |
5082 | goto out; | 4925 | goto out; |
5083 | } | 4926 | } |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 4e00b4f83641..5acd557cea9b 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -19,6 +19,9 @@ | |||
19 | * file called LICENSE. | 19 | * file called LICENSE. |
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | |||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
22 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
23 | #include <linux/module.h> | 26 | #include <linux/module.h> |
24 | #include <linux/device.h> | 27 | #include <linux/device.h> |
@@ -109,11 +112,10 @@ static ssize_t bonding_store_bonds(struct class *cls, | |||
109 | goto err_no_cmd; | 112 | goto err_no_cmd; |
110 | 113 | ||
111 | if (command[0] == '+') { | 114 | if (command[0] == '+') { |
112 | pr_info(DRV_NAME | 115 | pr_info("%s is being created...\n", ifname); |
113 | ": %s is being created...\n", ifname); | ||
114 | rv = bond_create(net, ifname); | 116 | rv = bond_create(net, ifname); |
115 | if (rv) { | 117 | if (rv) { |
116 | pr_info(DRV_NAME ": Bond creation failed.\n"); | 118 | pr_info("Bond creation failed.\n"); |
117 | res = rv; | 119 | res = rv; |
118 | } | 120 | } |
119 | } else if (command[0] == '-') { | 121 | } else if (command[0] == '-') { |
@@ -122,12 +124,10 @@ static ssize_t bonding_store_bonds(struct class *cls, | |||
122 | rtnl_lock(); | 124 | rtnl_lock(); |
123 | bond_dev = bond_get_by_name(net, ifname); | 125 | bond_dev = bond_get_by_name(net, ifname); |
124 | if (bond_dev) { | 126 | if (bond_dev) { |
125 | pr_info(DRV_NAME ": %s is being deleted...\n", | 127 | pr_info("%s is being deleted...\n", ifname); |
126 | ifname); | ||
127 | unregister_netdevice(bond_dev); | 128 | unregister_netdevice(bond_dev); |
128 | } else { | 129 | } else { |
129 | pr_err(DRV_NAME ": unable to delete non-existent %s\n", | 130 | pr_err("unable to delete non-existent %s\n", ifname); |
130 | ifname); | ||
131 | res = -ENODEV; | 131 | res = -ENODEV; |
132 | } | 132 | } |
133 | rtnl_unlock(); | 133 | rtnl_unlock(); |
@@ -140,8 +140,7 @@ static ssize_t bonding_store_bonds(struct class *cls, | |||
140 | return res; | 140 | return res; |
141 | 141 | ||
142 | err_no_cmd: | 142 | err_no_cmd: |
143 | pr_err(DRV_NAME ": no command found in bonding_masters." | 143 | pr_err("no command found in bonding_masters. Use +ifname or -ifname.\n"); |
144 | " Use +ifname or -ifname.\n"); | ||
145 | return -EPERM; | 144 | return -EPERM; |
146 | } | 145 | } |
147 | 146 | ||
@@ -225,8 +224,8 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
225 | 224 | ||
226 | /* Quick sanity check -- is the bond interface up? */ | 225 | /* Quick sanity check -- is the bond interface up? */ |
227 | if (!(bond->dev->flags & IFF_UP)) { | 226 | if (!(bond->dev->flags & IFF_UP)) { |
228 | pr_warning(DRV_NAME ": %s: doing slave updates when " | 227 | pr_warning("%s: doing slave updates when interface is down.\n", |
229 | "interface is down.\n", bond->dev->name); | 228 | bond->dev->name); |
230 | } | 229 | } |
231 | 230 | ||
232 | /* Note: We can't hold bond->lock here, as bond_create grabs it. */ | 231 | /* Note: We can't hold bond->lock here, as bond_create grabs it. */ |
@@ -247,17 +246,14 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
247 | 246 | ||
248 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); | 247 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); |
249 | if (!dev) { | 248 | if (!dev) { |
250 | pr_info(DRV_NAME | 249 | pr_info("%s: Interface %s does not exist!\n", |
251 | ": %s: Interface %s does not exist!\n", | 250 | bond->dev->name, ifname); |
252 | bond->dev->name, ifname); | ||
253 | ret = -ENODEV; | 251 | ret = -ENODEV; |
254 | goto out; | 252 | goto out; |
255 | } | 253 | } |
256 | 254 | ||
257 | if (dev->flags & IFF_UP) { | 255 | if (dev->flags & IFF_UP) { |
258 | pr_err(DRV_NAME | 256 | pr_err("%s: Error: Unable to enslave %s because it is already up.\n", |
259 | ": %s: Error: Unable to enslave %s " | ||
260 | "because it is already up.\n", | ||
261 | bond->dev->name, dev->name); | 257 | bond->dev->name, dev->name); |
262 | ret = -EPERM; | 258 | ret = -EPERM; |
263 | goto out; | 259 | goto out; |
@@ -266,8 +262,7 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
266 | read_lock(&bond->lock); | 262 | read_lock(&bond->lock); |
267 | bond_for_each_slave(bond, slave, i) | 263 | bond_for_each_slave(bond, slave, i) |
268 | if (slave->dev == dev) { | 264 | if (slave->dev == dev) { |
269 | pr_err(DRV_NAME | 265 | pr_err("%s: Interface %s is already enslaved!\n", |
270 | ": %s: Interface %s is already enslaved!\n", | ||
271 | bond->dev->name, ifname); | 266 | bond->dev->name, ifname); |
272 | ret = -EPERM; | 267 | ret = -EPERM; |
273 | read_unlock(&bond->lock); | 268 | read_unlock(&bond->lock); |
@@ -275,8 +270,7 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
275 | } | 270 | } |
276 | read_unlock(&bond->lock); | 271 | read_unlock(&bond->lock); |
277 | 272 | ||
278 | pr_info(DRV_NAME ": %s: Adding slave %s.\n", | 273 | pr_info("%s: Adding slave %s.\n", bond->dev->name, ifname); |
279 | bond->dev->name, ifname); | ||
280 | 274 | ||
281 | /* If this is the first slave, then we need to set | 275 | /* If this is the first slave, then we need to set |
282 | the master's hardware address to be the same as the | 276 | the master's hardware address to be the same as the |
@@ -313,7 +307,7 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
313 | break; | 307 | break; |
314 | } | 308 | } |
315 | if (dev) { | 309 | if (dev) { |
316 | pr_info(DRV_NAME ": %s: Removing slave %s\n", | 310 | pr_info("%s: Removing slave %s\n", |
317 | bond->dev->name, dev->name); | 311 | bond->dev->name, dev->name); |
318 | res = bond_release(bond->dev, dev); | 312 | res = bond_release(bond->dev, dev); |
319 | if (res) { | 313 | if (res) { |
@@ -323,16 +317,16 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
323 | /* set the slave MTU to the default */ | 317 | /* set the slave MTU to the default */ |
324 | dev_set_mtu(dev, original_mtu); | 318 | dev_set_mtu(dev, original_mtu); |
325 | } else { | 319 | } else { |
326 | pr_err(DRV_NAME ": unable to remove non-existent" | 320 | pr_err("unable to remove non-existent slave %s for bond %s.\n", |
327 | " slave %s for bond %s.\n", | 321 | ifname, bond->dev->name); |
328 | ifname, bond->dev->name); | ||
329 | ret = -ENODEV; | 322 | ret = -ENODEV; |
330 | } | 323 | } |
331 | goto out; | 324 | goto out; |
332 | } | 325 | } |
333 | 326 | ||
334 | err_no_cmd: | 327 | err_no_cmd: |
335 | pr_err(DRV_NAME ": no command found in slaves file for bond %s. Use +ifname or -ifname.\n", bond->dev->name); | 328 | pr_err("no command found in slaves file for bond %s. Use +ifname or -ifname.\n", |
329 | bond->dev->name); | ||
336 | ret = -EPERM; | 330 | ret = -EPERM; |
337 | 331 | ||
338 | out: | 332 | out: |
@@ -365,18 +359,16 @@ static ssize_t bonding_store_mode(struct device *d, | |||
365 | struct bonding *bond = to_bond(d); | 359 | struct bonding *bond = to_bond(d); |
366 | 360 | ||
367 | if (bond->dev->flags & IFF_UP) { | 361 | if (bond->dev->flags & IFF_UP) { |
368 | pr_err(DRV_NAME ": unable to update mode of %s" | 362 | pr_err("unable to update mode of %s because interface is up.\n", |
369 | " because interface is up.\n", bond->dev->name); | 363 | bond->dev->name); |
370 | ret = -EPERM; | 364 | ret = -EPERM; |
371 | goto out; | 365 | goto out; |
372 | } | 366 | } |
373 | 367 | ||
374 | new_value = bond_parse_parm(buf, bond_mode_tbl); | 368 | new_value = bond_parse_parm(buf, bond_mode_tbl); |
375 | if (new_value < 0) { | 369 | if (new_value < 0) { |
376 | pr_err(DRV_NAME | 370 | pr_err("%s: Ignoring invalid mode value %.*s.\n", |
377 | ": %s: Ignoring invalid mode value %.*s.\n", | 371 | bond->dev->name, (int)strlen(buf) - 1, buf); |
378 | bond->dev->name, | ||
379 | (int)strlen(buf) - 1, buf); | ||
380 | ret = -EINVAL; | 372 | ret = -EINVAL; |
381 | goto out; | 373 | goto out; |
382 | } else { | 374 | } else { |
@@ -388,8 +380,8 @@ static ssize_t bonding_store_mode(struct device *d, | |||
388 | 380 | ||
389 | bond->params.mode = new_value; | 381 | bond->params.mode = new_value; |
390 | bond_set_mode_ops(bond, bond->params.mode); | 382 | bond_set_mode_ops(bond, bond->params.mode); |
391 | pr_info(DRV_NAME ": %s: setting mode to %s (%d).\n", | 383 | pr_info("%s: setting mode to %s (%d).\n", |
392 | bond->dev->name, bond_mode_tbl[new_value].modename, | 384 | bond->dev->name, bond_mode_tbl[new_value].modename, |
393 | new_value); | 385 | new_value); |
394 | } | 386 | } |
395 | out: | 387 | out: |
@@ -421,8 +413,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, | |||
421 | struct bonding *bond = to_bond(d); | 413 | struct bonding *bond = to_bond(d); |
422 | 414 | ||
423 | if (bond->dev->flags & IFF_UP) { | 415 | if (bond->dev->flags & IFF_UP) { |
424 | pr_err(DRV_NAME | 416 | pr_err("%s: Interface is up. Unable to update xmit policy.\n", |
425 | "%s: Interface is up. Unable to update xmit policy.\n", | ||
426 | bond->dev->name); | 417 | bond->dev->name); |
427 | ret = -EPERM; | 418 | ret = -EPERM; |
428 | goto out; | 419 | goto out; |
@@ -430,8 +421,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, | |||
430 | 421 | ||
431 | new_value = bond_parse_parm(buf, xmit_hashtype_tbl); | 422 | new_value = bond_parse_parm(buf, xmit_hashtype_tbl); |
432 | if (new_value < 0) { | 423 | if (new_value < 0) { |
433 | pr_err(DRV_NAME | 424 | pr_err("%s: Ignoring invalid xmit hash policy value %.*s.\n", |
434 | ": %s: Ignoring invalid xmit hash policy value %.*s.\n", | ||
435 | bond->dev->name, | 425 | bond->dev->name, |
436 | (int)strlen(buf) - 1, buf); | 426 | (int)strlen(buf) - 1, buf); |
437 | ret = -EINVAL; | 427 | ret = -EINVAL; |
@@ -439,7 +429,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, | |||
439 | } else { | 429 | } else { |
440 | bond->params.xmit_policy = new_value; | 430 | bond->params.xmit_policy = new_value; |
441 | bond_set_mode_ops(bond, bond->params.mode); | 431 | bond_set_mode_ops(bond, bond->params.mode); |
442 | pr_info(DRV_NAME ": %s: setting xmit hash policy to %s (%d).\n", | 432 | pr_info("%s: setting xmit hash policy to %s (%d).\n", |
443 | bond->dev->name, | 433 | bond->dev->name, |
444 | xmit_hashtype_tbl[new_value].modename, new_value); | 434 | xmit_hashtype_tbl[new_value].modename, new_value); |
445 | } | 435 | } |
@@ -472,20 +462,18 @@ static ssize_t bonding_store_arp_validate(struct device *d, | |||
472 | 462 | ||
473 | new_value = bond_parse_parm(buf, arp_validate_tbl); | 463 | new_value = bond_parse_parm(buf, arp_validate_tbl); |
474 | if (new_value < 0) { | 464 | if (new_value < 0) { |
475 | pr_err(DRV_NAME | 465 | pr_err("%s: Ignoring invalid arp_validate value %s\n", |
476 | ": %s: Ignoring invalid arp_validate value %s\n", | ||
477 | bond->dev->name, buf); | 466 | bond->dev->name, buf); |
478 | return -EINVAL; | 467 | return -EINVAL; |
479 | } | 468 | } |
480 | if (new_value && (bond->params.mode != BOND_MODE_ACTIVEBACKUP)) { | 469 | if (new_value && (bond->params.mode != BOND_MODE_ACTIVEBACKUP)) { |
481 | pr_err(DRV_NAME | 470 | pr_err("%s: arp_validate only supported in active-backup mode.\n", |
482 | ": %s: arp_validate only supported in active-backup mode.\n", | ||
483 | bond->dev->name); | 471 | bond->dev->name); |
484 | return -EINVAL; | 472 | return -EINVAL; |
485 | } | 473 | } |
486 | pr_info(DRV_NAME ": %s: setting arp_validate to %s (%d).\n", | 474 | pr_info("%s: setting arp_validate to %s (%d).\n", |
487 | bond->dev->name, arp_validate_tbl[new_value].modename, | 475 | bond->dev->name, arp_validate_tbl[new_value].modename, |
488 | new_value); | 476 | new_value); |
489 | 477 | ||
490 | if (!bond->params.arp_validate && new_value) | 478 | if (!bond->params.arp_validate && new_value) |
491 | bond_register_arp(bond); | 479 | bond_register_arp(bond); |
@@ -523,24 +511,22 @@ static ssize_t bonding_store_fail_over_mac(struct device *d, | |||
523 | struct bonding *bond = to_bond(d); | 511 | struct bonding *bond = to_bond(d); |
524 | 512 | ||
525 | if (bond->slave_cnt != 0) { | 513 | if (bond->slave_cnt != 0) { |
526 | pr_err(DRV_NAME | 514 | pr_err("%s: Can't alter fail_over_mac with slaves in bond.\n", |
527 | ": %s: Can't alter fail_over_mac with slaves in bond.\n", | ||
528 | bond->dev->name); | 515 | bond->dev->name); |
529 | return -EPERM; | 516 | return -EPERM; |
530 | } | 517 | } |
531 | 518 | ||
532 | new_value = bond_parse_parm(buf, fail_over_mac_tbl); | 519 | new_value = bond_parse_parm(buf, fail_over_mac_tbl); |
533 | if (new_value < 0) { | 520 | if (new_value < 0) { |
534 | pr_err(DRV_NAME | 521 | pr_err("%s: Ignoring invalid fail_over_mac value %s.\n", |
535 | ": %s: Ignoring invalid fail_over_mac value %s.\n", | ||
536 | bond->dev->name, buf); | 522 | bond->dev->name, buf); |
537 | return -EINVAL; | 523 | return -EINVAL; |
538 | } | 524 | } |
539 | 525 | ||
540 | bond->params.fail_over_mac = new_value; | 526 | bond->params.fail_over_mac = new_value; |
541 | pr_info(DRV_NAME ": %s: Setting fail_over_mac to %s (%d).\n", | 527 | pr_info("%s: Setting fail_over_mac to %s (%d).\n", |
542 | bond->dev->name, fail_over_mac_tbl[new_value].modename, | 528 | bond->dev->name, fail_over_mac_tbl[new_value].modename, |
543 | new_value); | 529 | new_value); |
544 | 530 | ||
545 | return count; | 531 | return count; |
546 | } | 532 | } |
@@ -571,31 +557,26 @@ static ssize_t bonding_store_arp_interval(struct device *d, | |||
571 | struct bonding *bond = to_bond(d); | 557 | struct bonding *bond = to_bond(d); |
572 | 558 | ||
573 | if (sscanf(buf, "%d", &new_value) != 1) { | 559 | if (sscanf(buf, "%d", &new_value) != 1) { |
574 | pr_err(DRV_NAME | 560 | pr_err("%s: no arp_interval value specified.\n", |
575 | ": %s: no arp_interval value specified.\n", | ||
576 | bond->dev->name); | 561 | bond->dev->name); |
577 | ret = -EINVAL; | 562 | ret = -EINVAL; |
578 | goto out; | 563 | goto out; |
579 | } | 564 | } |
580 | if (new_value < 0) { | 565 | if (new_value < 0) { |
581 | pr_err(DRV_NAME | 566 | pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n", |
582 | ": %s: Invalid arp_interval value %d not in range 1-%d; rejected.\n", | ||
583 | bond->dev->name, new_value, INT_MAX); | 567 | bond->dev->name, new_value, INT_MAX); |
584 | ret = -EINVAL; | 568 | ret = -EINVAL; |
585 | goto out; | 569 | goto out; |
586 | } | 570 | } |
587 | 571 | ||
588 | pr_info(DRV_NAME | 572 | pr_info("%s: Setting ARP monitoring interval to %d.\n", |
589 | ": %s: Setting ARP monitoring interval to %d.\n", | 573 | bond->dev->name, new_value); |
590 | bond->dev->name, new_value); | ||
591 | bond->params.arp_interval = new_value; | 574 | bond->params.arp_interval = new_value; |
592 | if (bond->params.arp_interval) | 575 | if (bond->params.arp_interval) |
593 | bond->dev->priv_flags |= IFF_MASTER_ARPMON; | 576 | bond->dev->priv_flags |= IFF_MASTER_ARPMON; |
594 | if (bond->params.miimon) { | 577 | if (bond->params.miimon) { |
595 | pr_info(DRV_NAME | 578 | pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n", |
596 | ": %s: ARP monitoring cannot be used with MII monitoring. " | 579 | bond->dev->name, bond->dev->name); |
597 | "%s Disabling MII monitoring.\n", | ||
598 | bond->dev->name, bond->dev->name); | ||
599 | bond->params.miimon = 0; | 580 | bond->params.miimon = 0; |
600 | if (delayed_work_pending(&bond->mii_work)) { | 581 | if (delayed_work_pending(&bond->mii_work)) { |
601 | cancel_delayed_work(&bond->mii_work); | 582 | cancel_delayed_work(&bond->mii_work); |
@@ -603,10 +584,8 @@ static ssize_t bonding_store_arp_interval(struct device *d, | |||
603 | } | 584 | } |
604 | } | 585 | } |
605 | if (!bond->params.arp_targets[0]) { | 586 | if (!bond->params.arp_targets[0]) { |
606 | pr_info(DRV_NAME | 587 | pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n", |
607 | ": %s: ARP monitoring has been set up, " | 588 | bond->dev->name); |
608 | "but no ARP targets have been specified.\n", | ||
609 | bond->dev->name); | ||
610 | } | 589 | } |
611 | if (bond->dev->flags & IFF_UP) { | 590 | if (bond->dev->flags & IFF_UP) { |
612 | /* If the interface is up, we may need to fire off | 591 | /* If the interface is up, we may need to fire off |
@@ -666,8 +645,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
666 | /* look for adds */ | 645 | /* look for adds */ |
667 | if (buf[0] == '+') { | 646 | if (buf[0] == '+') { |
668 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { | 647 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { |
669 | pr_err(DRV_NAME | 648 | pr_err("%s: invalid ARP target %pI4 specified for addition\n", |
670 | ": %s: invalid ARP target %pI4 specified for addition\n", | ||
671 | bond->dev->name, &newtarget); | 649 | bond->dev->name, &newtarget); |
672 | ret = -EINVAL; | 650 | ret = -EINVAL; |
673 | goto out; | 651 | goto out; |
@@ -675,23 +653,20 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
675 | /* look for an empty slot to put the target in, and check for dupes */ | 653 | /* look for an empty slot to put the target in, and check for dupes */ |
676 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { | 654 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
677 | if (targets[i] == newtarget) { /* duplicate */ | 655 | if (targets[i] == newtarget) { /* duplicate */ |
678 | pr_err(DRV_NAME | 656 | pr_err("%s: ARP target %pI4 is already present\n", |
679 | ": %s: ARP target %pI4 is already present\n", | ||
680 | bond->dev->name, &newtarget); | 657 | bond->dev->name, &newtarget); |
681 | ret = -EINVAL; | 658 | ret = -EINVAL; |
682 | goto out; | 659 | goto out; |
683 | } | 660 | } |
684 | if (targets[i] == 0) { | 661 | if (targets[i] == 0) { |
685 | pr_info(DRV_NAME | 662 | pr_info("%s: adding ARP target %pI4.\n", |
686 | ": %s: adding ARP target %pI4.\n", | 663 | bond->dev->name, &newtarget); |
687 | bond->dev->name, &newtarget); | ||
688 | done = 1; | 664 | done = 1; |
689 | targets[i] = newtarget; | 665 | targets[i] = newtarget; |
690 | } | 666 | } |
691 | } | 667 | } |
692 | if (!done) { | 668 | if (!done) { |
693 | pr_err(DRV_NAME | 669 | pr_err("%s: ARP target table is full!\n", |
694 | ": %s: ARP target table is full!\n", | ||
695 | bond->dev->name); | 670 | bond->dev->name); |
696 | ret = -EINVAL; | 671 | ret = -EINVAL; |
697 | goto out; | 672 | goto out; |
@@ -699,8 +674,7 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
699 | 674 | ||
700 | } else if (buf[0] == '-') { | 675 | } else if (buf[0] == '-') { |
701 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { | 676 | if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { |
702 | pr_err(DRV_NAME | 677 | pr_err("%s: invalid ARP target %pI4 specified for removal\n", |
703 | ": %s: invalid ARP target %pI4 specified for removal\n", | ||
704 | bond->dev->name, &newtarget); | 678 | bond->dev->name, &newtarget); |
705 | ret = -EINVAL; | 679 | ret = -EINVAL; |
706 | goto out; | 680 | goto out; |
@@ -709,9 +683,8 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
709 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { | 683 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
710 | if (targets[i] == newtarget) { | 684 | if (targets[i] == newtarget) { |
711 | int j; | 685 | int j; |
712 | pr_info(DRV_NAME | 686 | pr_info("%s: removing ARP target %pI4.\n", |
713 | ": %s: removing ARP target %pI4.\n", | 687 | bond->dev->name, &newtarget); |
714 | bond->dev->name, &newtarget); | ||
715 | for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++) | 688 | for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++) |
716 | targets[j] = targets[j+1]; | 689 | targets[j] = targets[j+1]; |
717 | 690 | ||
@@ -720,16 +693,14 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
720 | } | 693 | } |
721 | } | 694 | } |
722 | if (!done) { | 695 | if (!done) { |
723 | pr_info(DRV_NAME | 696 | pr_info("%s: unable to remove nonexistent ARP target %pI4.\n", |
724 | ": %s: unable to remove nonexistent ARP target %pI4.\n", | 697 | bond->dev->name, &newtarget); |
725 | bond->dev->name, &newtarget); | ||
726 | ret = -EINVAL; | 698 | ret = -EINVAL; |
727 | goto out; | 699 | goto out; |
728 | } | 700 | } |
729 | } else { | 701 | } else { |
730 | pr_err(DRV_NAME ": no command found in arp_ip_targets file" | 702 | pr_err("no command found in arp_ip_targets file for bond %s. Use +<addr> or -<addr>.\n", |
731 | " for bond %s. Use +<addr> or -<addr>.\n", | 703 | bond->dev->name); |
732 | bond->dev->name); | ||
733 | ret = -EPERM; | 704 | ret = -EPERM; |
734 | goto out; | 705 | goto out; |
735 | } | 706 | } |
@@ -761,41 +732,34 @@ static ssize_t bonding_store_downdelay(struct device *d, | |||
761 | struct bonding *bond = to_bond(d); | 732 | struct bonding *bond = to_bond(d); |
762 | 733 | ||
763 | if (!(bond->params.miimon)) { | 734 | if (!(bond->params.miimon)) { |
764 | pr_err(DRV_NAME | 735 | pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", |
765 | ": %s: Unable to set down delay as MII monitoring is disabled\n", | ||
766 | bond->dev->name); | 736 | bond->dev->name); |
767 | ret = -EPERM; | 737 | ret = -EPERM; |
768 | goto out; | 738 | goto out; |
769 | } | 739 | } |
770 | 740 | ||
771 | if (sscanf(buf, "%d", &new_value) != 1) { | 741 | if (sscanf(buf, "%d", &new_value) != 1) { |
772 | pr_err(DRV_NAME | 742 | pr_err("%s: no down delay value specified.\n", bond->dev->name); |
773 | ": %s: no down delay value specified.\n", | ||
774 | bond->dev->name); | ||
775 | ret = -EINVAL; | 743 | ret = -EINVAL; |
776 | goto out; | 744 | goto out; |
777 | } | 745 | } |
778 | if (new_value < 0) { | 746 | if (new_value < 0) { |
779 | pr_err(DRV_NAME | 747 | pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n", |
780 | ": %s: Invalid down delay value %d not in range %d-%d; rejected.\n", | ||
781 | bond->dev->name, new_value, 1, INT_MAX); | 748 | bond->dev->name, new_value, 1, INT_MAX); |
782 | ret = -EINVAL; | 749 | ret = -EINVAL; |
783 | goto out; | 750 | goto out; |
784 | } else { | 751 | } else { |
785 | if ((new_value % bond->params.miimon) != 0) { | 752 | if ((new_value % bond->params.miimon) != 0) { |
786 | pr_warning(DRV_NAME | 753 | pr_warning("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", |
787 | ": %s: Warning: down delay (%d) is not a " | ||
788 | "multiple of miimon (%d), delay rounded " | ||
789 | "to %d ms\n", | ||
790 | bond->dev->name, new_value, | 754 | bond->dev->name, new_value, |
791 | bond->params.miimon, | 755 | bond->params.miimon, |
792 | (new_value / bond->params.miimon) * | 756 | (new_value / bond->params.miimon) * |
793 | bond->params.miimon); | 757 | bond->params.miimon); |
794 | } | 758 | } |
795 | bond->params.downdelay = new_value / bond->params.miimon; | 759 | bond->params.downdelay = new_value / bond->params.miimon; |
796 | pr_info(DRV_NAME ": %s: Setting down delay to %d.\n", | 760 | pr_info("%s: Setting down delay to %d.\n", |
797 | bond->dev->name, | 761 | bond->dev->name, |
798 | bond->params.downdelay * bond->params.miimon); | 762 | bond->params.downdelay * bond->params.miimon); |
799 | 763 | ||
800 | } | 764 | } |
801 | 765 | ||
@@ -823,41 +787,35 @@ static ssize_t bonding_store_updelay(struct device *d, | |||
823 | struct bonding *bond = to_bond(d); | 787 | struct bonding *bond = to_bond(d); |
824 | 788 | ||
825 | if (!(bond->params.miimon)) { | 789 | if (!(bond->params.miimon)) { |
826 | pr_err(DRV_NAME | 790 | pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", |
827 | ": %s: Unable to set up delay as MII monitoring is disabled\n", | ||
828 | bond->dev->name); | 791 | bond->dev->name); |
829 | ret = -EPERM; | 792 | ret = -EPERM; |
830 | goto out; | 793 | goto out; |
831 | } | 794 | } |
832 | 795 | ||
833 | if (sscanf(buf, "%d", &new_value) != 1) { | 796 | if (sscanf(buf, "%d", &new_value) != 1) { |
834 | pr_err(DRV_NAME | 797 | pr_err("%s: no up delay value specified.\n", |
835 | ": %s: no up delay value specified.\n", | ||
836 | bond->dev->name); | 798 | bond->dev->name); |
837 | ret = -EINVAL; | 799 | ret = -EINVAL; |
838 | goto out; | 800 | goto out; |
839 | } | 801 | } |
840 | if (new_value < 0) { | 802 | if (new_value < 0) { |
841 | pr_err(DRV_NAME | 803 | pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n", |
842 | ": %s: Invalid down delay value %d not in range %d-%d; rejected.\n", | ||
843 | bond->dev->name, new_value, 1, INT_MAX); | 804 | bond->dev->name, new_value, 1, INT_MAX); |
844 | ret = -EINVAL; | 805 | ret = -EINVAL; |
845 | goto out; | 806 | goto out; |
846 | } else { | 807 | } else { |
847 | if ((new_value % bond->params.miimon) != 0) { | 808 | if ((new_value % bond->params.miimon) != 0) { |
848 | pr_warning(DRV_NAME | 809 | pr_warning("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", |
849 | ": %s: Warning: up delay (%d) is not a " | ||
850 | "multiple of miimon (%d), updelay rounded " | ||
851 | "to %d ms\n", | ||
852 | bond->dev->name, new_value, | 810 | bond->dev->name, new_value, |
853 | bond->params.miimon, | 811 | bond->params.miimon, |
854 | (new_value / bond->params.miimon) * | 812 | (new_value / bond->params.miimon) * |
855 | bond->params.miimon); | 813 | bond->params.miimon); |
856 | } | 814 | } |
857 | bond->params.updelay = new_value / bond->params.miimon; | 815 | bond->params.updelay = new_value / bond->params.miimon; |
858 | pr_info(DRV_NAME ": %s: Setting up delay to %d.\n", | 816 | pr_info("%s: Setting up delay to %d.\n", |
859 | bond->dev->name, bond->params.updelay * bond->params.miimon); | 817 | bond->dev->name, |
860 | 818 | bond->params.updelay * bond->params.miimon); | |
861 | } | 819 | } |
862 | 820 | ||
863 | out: | 821 | out: |
@@ -889,16 +847,14 @@ static ssize_t bonding_store_lacp(struct device *d, | |||
889 | struct bonding *bond = to_bond(d); | 847 | struct bonding *bond = to_bond(d); |
890 | 848 | ||
891 | if (bond->dev->flags & IFF_UP) { | 849 | if (bond->dev->flags & IFF_UP) { |
892 | pr_err(DRV_NAME | 850 | pr_err("%s: Unable to update LACP rate because interface is up.\n", |
893 | ": %s: Unable to update LACP rate because interface is up.\n", | ||
894 | bond->dev->name); | 851 | bond->dev->name); |
895 | ret = -EPERM; | 852 | ret = -EPERM; |
896 | goto out; | 853 | goto out; |
897 | } | 854 | } |
898 | 855 | ||
899 | if (bond->params.mode != BOND_MODE_8023AD) { | 856 | if (bond->params.mode != BOND_MODE_8023AD) { |
900 | pr_err(DRV_NAME | 857 | pr_err("%s: Unable to update LACP rate because bond is not in 802.3ad mode.\n", |
901 | ": %s: Unable to update LACP rate because bond is not in 802.3ad mode.\n", | ||
902 | bond->dev->name); | 858 | bond->dev->name); |
903 | ret = -EPERM; | 859 | ret = -EPERM; |
904 | goto out; | 860 | goto out; |
@@ -908,12 +864,11 @@ static ssize_t bonding_store_lacp(struct device *d, | |||
908 | 864 | ||
909 | if ((new_value == 1) || (new_value == 0)) { | 865 | if ((new_value == 1) || (new_value == 0)) { |
910 | bond->params.lacp_fast = new_value; | 866 | bond->params.lacp_fast = new_value; |
911 | pr_info(DRV_NAME ": %s: Setting LACP rate to %s (%d).\n", | 867 | pr_info("%s: Setting LACP rate to %s (%d).\n", |
912 | bond->dev->name, bond_lacp_tbl[new_value].modename, | 868 | bond->dev->name, bond_lacp_tbl[new_value].modename, |
913 | new_value); | 869 | new_value); |
914 | } else { | 870 | } else { |
915 | pr_err(DRV_NAME | 871 | pr_err("%s: Ignoring invalid LACP rate value %.*s.\n", |
916 | ": %s: Ignoring invalid LACP rate value %.*s.\n", | ||
917 | bond->dev->name, (int)strlen(buf) - 1, buf); | 872 | bond->dev->name, (int)strlen(buf) - 1, buf); |
918 | ret = -EINVAL; | 873 | ret = -EINVAL; |
919 | } | 874 | } |
@@ -943,9 +898,8 @@ static ssize_t bonding_store_ad_select(struct device *d, | |||
943 | struct bonding *bond = to_bond(d); | 898 | struct bonding *bond = to_bond(d); |
944 | 899 | ||
945 | if (bond->dev->flags & IFF_UP) { | 900 | if (bond->dev->flags & IFF_UP) { |
946 | pr_err(DRV_NAME | 901 | pr_err("%s: Unable to update ad_select because interface is up.\n", |
947 | ": %s: Unable to update ad_select because interface " | 902 | bond->dev->name); |
948 | "is up.\n", bond->dev->name); | ||
949 | ret = -EPERM; | 903 | ret = -EPERM; |
950 | goto out; | 904 | goto out; |
951 | } | 905 | } |
@@ -954,13 +908,11 @@ static ssize_t bonding_store_ad_select(struct device *d, | |||
954 | 908 | ||
955 | if (new_value != -1) { | 909 | if (new_value != -1) { |
956 | bond->params.ad_select = new_value; | 910 | bond->params.ad_select = new_value; |
957 | pr_info(DRV_NAME | 911 | pr_info("%s: Setting ad_select to %s (%d).\n", |
958 | ": %s: Setting ad_select to %s (%d).\n", | 912 | bond->dev->name, ad_select_tbl[new_value].modename, |
959 | bond->dev->name, ad_select_tbl[new_value].modename, | 913 | new_value); |
960 | new_value); | ||
961 | } else { | 914 | } else { |
962 | pr_err(DRV_NAME | 915 | pr_err("%s: Ignoring invalid ad_select value %.*s.\n", |
963 | ": %s: Ignoring invalid ad_select value %.*s.\n", | ||
964 | bond->dev->name, (int)strlen(buf) - 1, buf); | 916 | bond->dev->name, (int)strlen(buf) - 1, buf); |
965 | ret = -EINVAL; | 917 | ret = -EINVAL; |
966 | } | 918 | } |
@@ -990,15 +942,13 @@ static ssize_t bonding_store_n_grat_arp(struct device *d, | |||
990 | struct bonding *bond = to_bond(d); | 942 | struct bonding *bond = to_bond(d); |
991 | 943 | ||
992 | if (sscanf(buf, "%d", &new_value) != 1) { | 944 | if (sscanf(buf, "%d", &new_value) != 1) { |
993 | pr_err(DRV_NAME | 945 | pr_err("%s: no num_grat_arp value specified.\n", |
994 | ": %s: no num_grat_arp value specified.\n", | ||
995 | bond->dev->name); | 946 | bond->dev->name); |
996 | ret = -EINVAL; | 947 | ret = -EINVAL; |
997 | goto out; | 948 | goto out; |
998 | } | 949 | } |
999 | if (new_value < 0 || new_value > 255) { | 950 | if (new_value < 0 || new_value > 255) { |
1000 | pr_err(DRV_NAME | 951 | pr_err("%s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n", |
1001 | ": %s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n", | ||
1002 | bond->dev->name, new_value); | 952 | bond->dev->name, new_value); |
1003 | ret = -EINVAL; | 953 | ret = -EINVAL; |
1004 | goto out; | 954 | goto out; |
@@ -1031,16 +981,14 @@ static ssize_t bonding_store_n_unsol_na(struct device *d, | |||
1031 | struct bonding *bond = to_bond(d); | 981 | struct bonding *bond = to_bond(d); |
1032 | 982 | ||
1033 | if (sscanf(buf, "%d", &new_value) != 1) { | 983 | if (sscanf(buf, "%d", &new_value) != 1) { |
1034 | pr_err(DRV_NAME | 984 | pr_err("%s: no num_unsol_na value specified.\n", |
1035 | ": %s: no num_unsol_na value specified.\n", | ||
1036 | bond->dev->name); | 985 | bond->dev->name); |
1037 | ret = -EINVAL; | 986 | ret = -EINVAL; |
1038 | goto out; | 987 | goto out; |
1039 | } | 988 | } |
1040 | 989 | ||
1041 | if (new_value < 0 || new_value > 255) { | 990 | if (new_value < 0 || new_value > 255) { |
1042 | pr_err(DRV_NAME | 991 | pr_err("%s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n", |
1043 | ": %s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n", | ||
1044 | bond->dev->name, new_value); | 992 | bond->dev->name, new_value); |
1045 | ret = -EINVAL; | 993 | ret = -EINVAL; |
1046 | goto out; | 994 | goto out; |
@@ -1075,40 +1023,31 @@ static ssize_t bonding_store_miimon(struct device *d, | |||
1075 | struct bonding *bond = to_bond(d); | 1023 | struct bonding *bond = to_bond(d); |
1076 | 1024 | ||
1077 | if (sscanf(buf, "%d", &new_value) != 1) { | 1025 | if (sscanf(buf, "%d", &new_value) != 1) { |
1078 | pr_err(DRV_NAME | 1026 | pr_err("%s: no miimon value specified.\n", |
1079 | ": %s: no miimon value specified.\n", | ||
1080 | bond->dev->name); | 1027 | bond->dev->name); |
1081 | ret = -EINVAL; | 1028 | ret = -EINVAL; |
1082 | goto out; | 1029 | goto out; |
1083 | } | 1030 | } |
1084 | if (new_value < 0) { | 1031 | if (new_value < 0) { |
1085 | pr_err(DRV_NAME | 1032 | pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n", |
1086 | ": %s: Invalid miimon value %d not in range %d-%d; rejected.\n", | ||
1087 | bond->dev->name, new_value, 1, INT_MAX); | 1033 | bond->dev->name, new_value, 1, INT_MAX); |
1088 | ret = -EINVAL; | 1034 | ret = -EINVAL; |
1089 | goto out; | 1035 | goto out; |
1090 | } else { | 1036 | } else { |
1091 | pr_info(DRV_NAME | 1037 | pr_info("%s: Setting MII monitoring interval to %d.\n", |
1092 | ": %s: Setting MII monitoring interval to %d.\n", | 1038 | bond->dev->name, new_value); |
1093 | bond->dev->name, new_value); | ||
1094 | bond->params.miimon = new_value; | 1039 | bond->params.miimon = new_value; |
1095 | if (bond->params.updelay) | 1040 | if (bond->params.updelay) |
1096 | pr_info(DRV_NAME | 1041 | pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n", |
1097 | ": %s: Note: Updating updelay (to %d) " | 1042 | bond->dev->name, |
1098 | "since it is a multiple of the miimon value.\n", | 1043 | bond->params.updelay * bond->params.miimon); |
1099 | bond->dev->name, | ||
1100 | bond->params.updelay * bond->params.miimon); | ||
1101 | if (bond->params.downdelay) | 1044 | if (bond->params.downdelay) |
1102 | pr_info(DRV_NAME | 1045 | pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n", |
1103 | ": %s: Note: Updating downdelay (to %d) " | 1046 | bond->dev->name, |
1104 | "since it is a multiple of the miimon value.\n", | 1047 | bond->params.downdelay * bond->params.miimon); |
1105 | bond->dev->name, | ||
1106 | bond->params.downdelay * bond->params.miimon); | ||
1107 | if (bond->params.arp_interval) { | 1048 | if (bond->params.arp_interval) { |
1108 | pr_info(DRV_NAME | 1049 | pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n", |
1109 | ": %s: MII monitoring cannot be used with " | 1050 | bond->dev->name); |
1110 | "ARP monitoring. Disabling ARP monitoring...\n", | ||
1111 | bond->dev->name); | ||
1112 | bond->params.arp_interval = 0; | 1051 | bond->params.arp_interval = 0; |
1113 | bond->dev->priv_flags &= ~IFF_MASTER_ARPMON; | 1052 | bond->dev->priv_flags &= ~IFF_MASTER_ARPMON; |
1114 | if (bond->params.arp_validate) { | 1053 | if (bond->params.arp_validate) { |
@@ -1176,17 +1115,15 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1176 | write_lock_bh(&bond->curr_slave_lock); | 1115 | write_lock_bh(&bond->curr_slave_lock); |
1177 | 1116 | ||
1178 | if (!USES_PRIMARY(bond->params.mode)) { | 1117 | if (!USES_PRIMARY(bond->params.mode)) { |
1179 | pr_info(DRV_NAME | 1118 | pr_info("%s: Unable to set primary slave; %s is in mode %d\n", |
1180 | ": %s: Unable to set primary slave; %s is in mode %d\n", | 1119 | bond->dev->name, bond->dev->name, bond->params.mode); |
1181 | bond->dev->name, bond->dev->name, bond->params.mode); | ||
1182 | } else { | 1120 | } else { |
1183 | bond_for_each_slave(bond, slave, i) { | 1121 | bond_for_each_slave(bond, slave, i) { |
1184 | if (strnicmp | 1122 | if (strnicmp |
1185 | (slave->dev->name, buf, | 1123 | (slave->dev->name, buf, |
1186 | strlen(slave->dev->name)) == 0) { | 1124 | strlen(slave->dev->name)) == 0) { |
1187 | pr_info(DRV_NAME | 1125 | pr_info("%s: Setting %s as primary slave.\n", |
1188 | ": %s: Setting %s as primary slave.\n", | 1126 | bond->dev->name, slave->dev->name); |
1189 | bond->dev->name, slave->dev->name); | ||
1190 | bond->primary_slave = slave; | 1127 | bond->primary_slave = slave; |
1191 | strcpy(bond->params.primary, slave->dev->name); | 1128 | strcpy(bond->params.primary, slave->dev->name); |
1192 | bond_select_active_slave(bond); | 1129 | bond_select_active_slave(bond); |
@@ -1197,15 +1134,13 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1197 | /* if we got here, then we didn't match the name of any slave */ | 1134 | /* if we got here, then we didn't match the name of any slave */ |
1198 | 1135 | ||
1199 | if (strlen(buf) == 0 || buf[0] == '\n') { | 1136 | if (strlen(buf) == 0 || buf[0] == '\n') { |
1200 | pr_info(DRV_NAME | 1137 | pr_info("%s: Setting primary slave to None.\n", |
1201 | ": %s: Setting primary slave to None.\n", | 1138 | bond->dev->name); |
1202 | bond->dev->name); | ||
1203 | bond->primary_slave = NULL; | 1139 | bond->primary_slave = NULL; |
1204 | bond_select_active_slave(bond); | 1140 | bond_select_active_slave(bond); |
1205 | } else { | 1141 | } else { |
1206 | pr_info(DRV_NAME | 1142 | pr_info("%s: Unable to set %.*s as primary slave as it is not a slave.\n", |
1207 | ": %s: Unable to set %.*s as primary slave as it is not a slave.\n", | 1143 | bond->dev->name, (int)strlen(buf) - 1, buf); |
1208 | bond->dev->name, (int)strlen(buf) - 1, buf); | ||
1209 | } | 1144 | } |
1210 | } | 1145 | } |
1211 | out: | 1146 | out: |
@@ -1244,8 +1179,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d, | |||
1244 | 1179 | ||
1245 | new_value = bond_parse_parm(buf, pri_reselect_tbl); | 1180 | new_value = bond_parse_parm(buf, pri_reselect_tbl); |
1246 | if (new_value < 0) { | 1181 | if (new_value < 0) { |
1247 | pr_err(DRV_NAME | 1182 | pr_err("%s: Ignoring invalid primary_reselect value %.*s.\n", |
1248 | ": %s: Ignoring invalid primary_reselect value %.*s.\n", | ||
1249 | bond->dev->name, | 1183 | bond->dev->name, |
1250 | (int) strlen(buf) - 1, buf); | 1184 | (int) strlen(buf) - 1, buf); |
1251 | ret = -EINVAL; | 1185 | ret = -EINVAL; |
@@ -1253,7 +1187,7 @@ static ssize_t bonding_store_primary_reselect(struct device *d, | |||
1253 | } | 1187 | } |
1254 | 1188 | ||
1255 | bond->params.primary_reselect = new_value; | 1189 | bond->params.primary_reselect = new_value; |
1256 | pr_info(DRV_NAME ": %s: setting primary_reselect to %s (%d).\n", | 1190 | pr_info("%s: setting primary_reselect to %s (%d).\n", |
1257 | bond->dev->name, pri_reselect_tbl[new_value].modename, | 1191 | bond->dev->name, pri_reselect_tbl[new_value].modename, |
1258 | new_value); | 1192 | new_value); |
1259 | 1193 | ||
@@ -1291,20 +1225,18 @@ static ssize_t bonding_store_carrier(struct device *d, | |||
1291 | 1225 | ||
1292 | 1226 | ||
1293 | if (sscanf(buf, "%d", &new_value) != 1) { | 1227 | if (sscanf(buf, "%d", &new_value) != 1) { |
1294 | pr_err(DRV_NAME | 1228 | pr_err("%s: no use_carrier value specified.\n", |
1295 | ": %s: no use_carrier value specified.\n", | ||
1296 | bond->dev->name); | 1229 | bond->dev->name); |
1297 | ret = -EINVAL; | 1230 | ret = -EINVAL; |
1298 | goto out; | 1231 | goto out; |
1299 | } | 1232 | } |
1300 | if ((new_value == 0) || (new_value == 1)) { | 1233 | if ((new_value == 0) || (new_value == 1)) { |
1301 | bond->params.use_carrier = new_value; | 1234 | bond->params.use_carrier = new_value; |
1302 | pr_info(DRV_NAME ": %s: Setting use_carrier to %d.\n", | 1235 | pr_info("%s: Setting use_carrier to %d.\n", |
1303 | bond->dev->name, new_value); | 1236 | bond->dev->name, new_value); |
1304 | } else { | 1237 | } else { |
1305 | pr_info(DRV_NAME | 1238 | pr_info("%s: Ignoring invalid use_carrier value %d.\n", |
1306 | ": %s: Ignoring invalid use_carrier value %d.\n", | 1239 | bond->dev->name, new_value); |
1307 | bond->dev->name, new_value); | ||
1308 | } | 1240 | } |
1309 | out: | 1241 | out: |
1310 | return count; | 1242 | return count; |
@@ -1349,8 +1281,7 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1349 | write_lock_bh(&bond->curr_slave_lock); | 1281 | write_lock_bh(&bond->curr_slave_lock); |
1350 | 1282 | ||
1351 | if (!USES_PRIMARY(bond->params.mode)) | 1283 | if (!USES_PRIMARY(bond->params.mode)) |
1352 | pr_info(DRV_NAME ": %s: Unable to change active slave;" | 1284 | pr_info("%s: Unable to change active slave; %s is in mode %d\n", |
1353 | " %s is in mode %d\n", | ||
1354 | bond->dev->name, bond->dev->name, bond->params.mode); | 1285 | bond->dev->name, bond->dev->name, bond->params.mode); |
1355 | else { | 1286 | else { |
1356 | bond_for_each_slave(bond, slave, i) { | 1287 | bond_for_each_slave(bond, slave, i) { |
@@ -1361,9 +1292,9 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1361 | new_active = slave; | 1292 | new_active = slave; |
1362 | if (new_active == old_active) { | 1293 | if (new_active == old_active) { |
1363 | /* do nothing */ | 1294 | /* do nothing */ |
1364 | pr_info(DRV_NAME | 1295 | pr_info("%s: %s is already the current active slave.\n", |
1365 | ": %s: %s is already the current active slave.\n", | 1296 | bond->dev->name, |
1366 | bond->dev->name, slave->dev->name); | 1297 | slave->dev->name); |
1367 | goto out; | 1298 | goto out; |
1368 | } | 1299 | } |
1369 | else { | 1300 | else { |
@@ -1371,16 +1302,15 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1371 | (old_active) && | 1302 | (old_active) && |
1372 | (new_active->link == BOND_LINK_UP) && | 1303 | (new_active->link == BOND_LINK_UP) && |
1373 | IS_UP(new_active->dev)) { | 1304 | IS_UP(new_active->dev)) { |
1374 | pr_info(DRV_NAME | 1305 | pr_info("%s: Setting %s as active slave.\n", |
1375 | ": %s: Setting %s as active slave.\n", | 1306 | bond->dev->name, |
1376 | bond->dev->name, slave->dev->name); | 1307 | slave->dev->name); |
1377 | bond_change_active_slave(bond, new_active); | 1308 | bond_change_active_slave(bond, new_active); |
1378 | } | 1309 | } |
1379 | else { | 1310 | else { |
1380 | pr_info(DRV_NAME | 1311 | pr_info("%s: Could not set %s as active slave; either %s is down or the link is down.\n", |
1381 | ": %s: Could not set %s as active slave; " | 1312 | bond->dev->name, |
1382 | "either %s is down or the link is down.\n", | 1313 | slave->dev->name, |
1383 | bond->dev->name, slave->dev->name, | ||
1384 | slave->dev->name); | 1314 | slave->dev->name); |
1385 | } | 1315 | } |
1386 | goto out; | 1316 | goto out; |
@@ -1391,14 +1321,12 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1391 | /* if we got here, then we didn't match the name of any slave */ | 1321 | /* if we got here, then we didn't match the name of any slave */ |
1392 | 1322 | ||
1393 | if (strlen(buf) == 0 || buf[0] == '\n') { | 1323 | if (strlen(buf) == 0 || buf[0] == '\n') { |
1394 | pr_info(DRV_NAME | 1324 | pr_info("%s: Setting active slave to None.\n", |
1395 | ": %s: Setting active slave to None.\n", | ||
1396 | bond->dev->name); | 1325 | bond->dev->name); |
1397 | bond->primary_slave = NULL; | 1326 | bond->primary_slave = NULL; |
1398 | bond_select_active_slave(bond); | 1327 | bond_select_active_slave(bond); |
1399 | } else { | 1328 | } else { |
1400 | pr_info(DRV_NAME ": %s: Unable to set %.*s" | 1329 | pr_info("%s: Unable to set %.*s as active slave as it is not a slave.\n", |
1401 | " as active slave as it is not a slave.\n", | ||
1402 | bond->dev->name, (int)strlen(buf) - 1, buf); | 1330 | bond->dev->name, (int)strlen(buf) - 1, buf); |
1403 | } | 1331 | } |
1404 | } | 1332 | } |
@@ -1600,8 +1528,7 @@ int bond_create_sysfs(void) | |||
1600 | /* Is someone being kinky and naming a device bonding_master? */ | 1528 | /* Is someone being kinky and naming a device bonding_master? */ |
1601 | if (__dev_get_by_name(&init_net, | 1529 | if (__dev_get_by_name(&init_net, |
1602 | class_attr_bonding_masters.attr.name)) | 1530 | class_attr_bonding_masters.attr.name)) |
1603 | pr_err("network device named %s already " | 1531 | pr_err("network device named %s already exists in sysfs", |
1604 | "exists in sysfs", | ||
1605 | class_attr_bonding_masters.attr.name); | 1532 | class_attr_bonding_masters.attr.name); |
1606 | ret = 0; | 1533 | ret = 0; |
1607 | } | 1534 | } |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 8c485aad1b94..05b751719bd5 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -50,7 +50,7 @@ config CAN_TI_HECC | |||
50 | 50 | ||
51 | config CAN_MCP251X | 51 | config CAN_MCP251X |
52 | tristate "Microchip MCP251x SPI CAN controllers" | 52 | tristate "Microchip MCP251x SPI CAN controllers" |
53 | depends on CAN_DEV && SPI | 53 | depends on CAN_DEV && SPI && HAS_DMA |
54 | ---help--- | 54 | ---help--- |
55 | Driver for the Microchip MCP251x SPI CAN controllers. | 55 | Driver for the Microchip MCP251x SPI CAN controllers. |
56 | 56 | ||
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index cbe3fce53e3b..d0ec17878ffc 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -474,7 +474,7 @@ static void at91_read_mb(struct net_device *dev, unsigned int mb, | |||
474 | reg_msr = at91_read(priv, AT91_MSR(mb)); | 474 | reg_msr = at91_read(priv, AT91_MSR(mb)); |
475 | if (reg_msr & AT91_MSR_MRTR) | 475 | if (reg_msr & AT91_MSR_MRTR) |
476 | cf->can_id |= CAN_RTR_FLAG; | 476 | cf->can_id |= CAN_RTR_FLAG; |
477 | cf->can_dlc = min_t(__u8, (reg_msr >> 16) & 0xf, 8); | 477 | cf->can_dlc = get_can_dlc((reg_msr >> 16) & 0xf); |
478 | 478 | ||
479 | *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb)); | 479 | *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb)); |
480 | *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb)); | 480 | *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb)); |
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c index c7fc1de28173..0ec1524523cc 100644 --- a/drivers/net/can/bfin_can.c +++ b/drivers/net/can/bfin_can.c | |||
@@ -392,7 +392,7 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc) | |||
392 | cf->can_id |= CAN_RTR_FLAG; | 392 | cf->can_id |= CAN_RTR_FLAG; |
393 | 393 | ||
394 | /* get data length code */ | 394 | /* get data length code */ |
395 | cf->can_dlc = bfin_read16(®->chl[obj].dlc); | 395 | cf->can_dlc = get_can_dlc(bfin_read16(®->chl[obj].dlc) & 0xF); |
396 | 396 | ||
397 | /* get payload */ | 397 | /* get payload */ |
398 | for (i = 0; i < 8; i += 2) { | 398 | for (i = 0; i < 8; i += 2) { |
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index 78b1b69b2921..9c5a1537939c 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
@@ -403,9 +403,8 @@ static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, | |||
403 | 403 | ||
404 | for (i = 1; i < RXBDAT_OFF; i++) | 404 | for (i = 1; i < RXBDAT_OFF; i++) |
405 | buf[i] = mcp251x_read_reg(spi, RXBCTRL(buf_idx) + i); | 405 | buf[i] = mcp251x_read_reg(spi, RXBCTRL(buf_idx) + i); |
406 | len = buf[RXBDLC_OFF] & RXBDLC_LEN_MASK; | 406 | |
407 | if (len > 8) | 407 | len = get_can_dlc(buf[RXBDLC_OFF] & RXBDLC_LEN_MASK); |
408 | len = 8; | ||
409 | for (; i < (RXBDAT_OFF + len); i++) | 408 | for (; i < (RXBDAT_OFF + len); i++) |
410 | buf[i] = mcp251x_read_reg(spi, RXBCTRL(buf_idx) + i); | 409 | buf[i] = mcp251x_read_reg(spi, RXBCTRL(buf_idx) + i); |
411 | } else { | 410 | } else { |
@@ -455,13 +454,7 @@ static void mcp251x_hw_rx(struct spi_device *spi, int buf_idx) | |||
455 | (buf[RXBSIDL_OFF] >> RXBSIDL_SHIFT); | 454 | (buf[RXBSIDL_OFF] >> RXBSIDL_SHIFT); |
456 | } | 455 | } |
457 | /* Data length */ | 456 | /* Data length */ |
458 | frame->can_dlc = buf[RXBDLC_OFF] & RXBDLC_LEN_MASK; | 457 | frame->can_dlc = get_can_dlc(buf[RXBDLC_OFF] & RXBDLC_LEN_MASK); |
459 | if (frame->can_dlc > 8) { | ||
460 | dev_warn(&spi->dev, "invalid frame recevied\n"); | ||
461 | priv->net->stats.rx_errors++; | ||
462 | dev_kfree_skb(skb); | ||
463 | return; | ||
464 | } | ||
465 | memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc); | 458 | memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc); |
466 | 459 | ||
467 | priv->net->stats.rx_packets++; | 460 | priv->net->stats.rx_packets++; |
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c index bb06dfb58f25..07346f880ca6 100644 --- a/drivers/net/can/mscan/mscan.c +++ b/drivers/net/can/mscan/mscan.c | |||
@@ -297,7 +297,8 @@ static void mscan_get_rx_frame(struct net_device *dev, struct can_frame *frame) | |||
297 | frame->can_id |= can_id >> 1; | 297 | frame->can_id |= can_id >> 1; |
298 | if (can_id & 1) | 298 | if (can_id & 1) |
299 | frame->can_id |= CAN_RTR_FLAG; | 299 | frame->can_id |= CAN_RTR_FLAG; |
300 | frame->can_dlc = in_8(®s->rx.dlr) & 0xf; | 300 | |
301 | frame->can_dlc = get_can_dlc(in_8(®s->rx.dlr) & 0xf); | ||
301 | 302 | ||
302 | if (!(frame->can_id & CAN_RTR_FLAG)) { | 303 | if (!(frame->can_id & CAN_RTR_FLAG)) { |
303 | void __iomem *data = ®s->rx.dsr1_0; | 304 | void __iomem *data = ®s->rx.dsr1_0; |
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index b4ba88a31075..542a4f7255b4 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c | |||
@@ -293,15 +293,14 @@ static void sja1000_rx(struct net_device *dev) | |||
293 | uint8_t fi; | 293 | uint8_t fi; |
294 | uint8_t dreg; | 294 | uint8_t dreg; |
295 | canid_t id; | 295 | canid_t id; |
296 | uint8_t dlc; | ||
297 | int i; | 296 | int i; |
298 | 297 | ||
298 | /* create zero'ed CAN frame buffer */ | ||
299 | skb = alloc_can_skb(dev, &cf); | 299 | skb = alloc_can_skb(dev, &cf); |
300 | if (skb == NULL) | 300 | if (skb == NULL) |
301 | return; | 301 | return; |
302 | 302 | ||
303 | fi = priv->read_reg(priv, REG_FI); | 303 | fi = priv->read_reg(priv, REG_FI); |
304 | dlc = fi & 0x0F; | ||
305 | 304 | ||
306 | if (fi & FI_FF) { | 305 | if (fi & FI_FF) { |
307 | /* extended frame format (EFF) */ | 306 | /* extended frame format (EFF) */ |
@@ -318,16 +317,15 @@ static void sja1000_rx(struct net_device *dev) | |||
318 | | (priv->read_reg(priv, REG_ID2) >> 5); | 317 | | (priv->read_reg(priv, REG_ID2) >> 5); |
319 | } | 318 | } |
320 | 319 | ||
321 | if (fi & FI_RTR) | 320 | if (fi & FI_RTR) { |
322 | id |= CAN_RTR_FLAG; | 321 | id |= CAN_RTR_FLAG; |
322 | } else { | ||
323 | cf->can_dlc = get_can_dlc(fi & 0x0F); | ||
324 | for (i = 0; i < cf->can_dlc; i++) | ||
325 | cf->data[i] = priv->read_reg(priv, dreg++); | ||
326 | } | ||
323 | 327 | ||
324 | cf->can_id = id; | 328 | cf->can_id = id; |
325 | cf->can_dlc = dlc; | ||
326 | for (i = 0; i < dlc; i++) | ||
327 | cf->data[i] = priv->read_reg(priv, dreg++); | ||
328 | |||
329 | while (i < 8) | ||
330 | cf->data[i++] = 0; | ||
331 | 329 | ||
332 | /* release receive buffer */ | 330 | /* release receive buffer */ |
333 | priv->write_reg(priv, REG_CMR, CMD_RRB); | 331 | priv->write_reg(priv, REG_CMR, CMD_RRB); |
@@ -335,7 +333,7 @@ static void sja1000_rx(struct net_device *dev) | |||
335 | netif_rx(skb); | 333 | netif_rx(skb); |
336 | 334 | ||
337 | stats->rx_packets++; | 335 | stats->rx_packets++; |
338 | stats->rx_bytes += dlc; | 336 | stats->rx_bytes += cf->can_dlc; |
339 | } | 337 | } |
340 | 338 | ||
341 | static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) | 339 | static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) |
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index 07e8016b17ec..5c993c2da528 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c | |||
@@ -552,7 +552,7 @@ static int ti_hecc_rx_pkt(struct ti_hecc_priv *priv, int mbxno) | |||
552 | data = hecc_read_mbx(priv, mbxno, HECC_CANMCF); | 552 | data = hecc_read_mbx(priv, mbxno, HECC_CANMCF); |
553 | if (data & HECC_CANMCF_RTR) | 553 | if (data & HECC_CANMCF_RTR) |
554 | cf->can_id |= CAN_RTR_FLAG; | 554 | cf->can_id |= CAN_RTR_FLAG; |
555 | cf->can_dlc = data & 0xF; | 555 | cf->can_dlc = get_can_dlc(data & 0xF); |
556 | data = hecc_read_mbx(priv, mbxno, HECC_CANMDL); | 556 | data = hecc_read_mbx(priv, mbxno, HECC_CANMDL); |
557 | *(u32 *)(cf->data) = cpu_to_be32(data); | 557 | *(u32 *)(cf->data) = cpu_to_be32(data); |
558 | if (cf->can_dlc > 4) { | 558 | if (cf->can_dlc > 4) { |
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 591eb0eb1c2b..efbb05c71bf4 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -316,7 +316,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) | |||
316 | return; | 316 | return; |
317 | 317 | ||
318 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); | 318 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); |
319 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); | 319 | cf->can_dlc = get_can_dlc(msg->msg.can_msg.length & 0xF); |
320 | 320 | ||
321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME || | 321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME || |
322 | msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) | 322 | msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) |
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 678222389407..8d0be26f94e3 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1163,7 +1163,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1163 | priv->dev = dev; | 1163 | priv->dev = dev; |
1164 | priv->ring_size = 64; | 1164 | priv->ring_size = 64; |
1165 | priv->msg_enable = netif_msg_init(debug_level, 0xff); | 1165 | priv->msg_enable = netif_msg_init(debug_level, 0xff); |
1166 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); | 1166 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr)); |
1167 | 1167 | ||
1168 | snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); | 1168 | snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); |
1169 | 1169 | ||
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index e2d5343f1275..204177d78cec 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -510,6 +510,40 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, | |||
510 | } | 510 | } |
511 | 511 | ||
512 | /** | 512 | /** |
513 | * ixgbe_validate_link_ready - Function looks for phy link | ||
514 | * @hw: pointer to hardware structure | ||
515 | * | ||
516 | * Function indicates success when phy link is available. If phy is not ready | ||
517 | * within 5 seconds of MAC indicating link, the function returns error. | ||
518 | **/ | ||
519 | static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) | ||
520 | { | ||
521 | u32 timeout; | ||
522 | u16 an_reg; | ||
523 | |||
524 | if (hw->device_id != IXGBE_DEV_ID_82598AT2) | ||
525 | return 0; | ||
526 | |||
527 | for (timeout = 0; | ||
528 | timeout < IXGBE_VALIDATE_LINK_READY_TIMEOUT; timeout++) { | ||
529 | hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, &an_reg); | ||
530 | |||
531 | if ((an_reg & MDIO_AN_STAT1_COMPLETE) && | ||
532 | (an_reg & MDIO_STAT1_LSTATUS)) | ||
533 | break; | ||
534 | |||
535 | msleep(100); | ||
536 | } | ||
537 | |||
538 | if (timeout == IXGBE_VALIDATE_LINK_READY_TIMEOUT) { | ||
539 | hw_dbg(hw, "Link was indicated but link is down\n"); | ||
540 | return IXGBE_ERR_LINK_SETUP; | ||
541 | } | ||
542 | |||
543 | return 0; | ||
544 | } | ||
545 | |||
546 | /** | ||
513 | * ixgbe_check_mac_link_82598 - Get link/speed status | 547 | * ixgbe_check_mac_link_82598 - Get link/speed status |
514 | * @hw: pointer to hardware structure | 548 | * @hw: pointer to hardware structure |
515 | * @speed: pointer to link speed | 549 | * @speed: pointer to link speed |
@@ -589,6 +623,10 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, | |||
589 | else | 623 | else |
590 | *speed = IXGBE_LINK_SPEED_1GB_FULL; | 624 | *speed = IXGBE_LINK_SPEED_1GB_FULL; |
591 | 625 | ||
626 | if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == true) && | ||
627 | (ixgbe_validate_link_ready(hw) != 0)) | ||
628 | *link_up = false; | ||
629 | |||
592 | /* if link is down, zero out the current_mode */ | 630 | /* if link is down, zero out the current_mode */ |
593 | if (*link_up == false) { | 631 | if (*link_up == false) { |
594 | hw->fc.current_mode = ixgbe_fc_none; | 632 | hw->fc.current_mode = ixgbe_fc_none; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 35ea8c93fd80..bd64387563f0 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -4511,6 +4511,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) | |||
4511 | struct ixgbe_hw *hw = &adapter->hw; | 4511 | struct ixgbe_hw *hw = &adapter->hw; |
4512 | u64 total_mpc = 0; | 4512 | u64 total_mpc = 0; |
4513 | u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; | 4513 | u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; |
4514 | u64 non_eop_descs = 0, restart_queue = 0; | ||
4514 | 4515 | ||
4515 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | 4516 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
4516 | u64 rsc_count = 0; | 4517 | u64 rsc_count = 0; |
@@ -4528,10 +4529,12 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) | |||
4528 | 4529 | ||
4529 | /* gather some stats to the adapter struct that are per queue */ | 4530 | /* gather some stats to the adapter struct that are per queue */ |
4530 | for (i = 0; i < adapter->num_tx_queues; i++) | 4531 | for (i = 0; i < adapter->num_tx_queues; i++) |
4531 | adapter->restart_queue += adapter->tx_ring[i].restart_queue; | 4532 | restart_queue += adapter->tx_ring[i].restart_queue; |
4533 | adapter->restart_queue = restart_queue; | ||
4532 | 4534 | ||
4533 | for (i = 0; i < adapter->num_rx_queues; i++) | 4535 | for (i = 0; i < adapter->num_rx_queues; i++) |
4534 | adapter->non_eop_descs += adapter->tx_ring[i].non_eop_descs; | 4536 | non_eop_descs += adapter->rx_ring[i].non_eop_descs; |
4537 | adapter->non_eop_descs = non_eop_descs; | ||
4535 | 4538 | ||
4536 | adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); | 4539 | adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); |
4537 | for (i = 0; i < 8; i++) { | 4540 | for (i = 0; i < 8; i++) { |
@@ -5003,7 +5006,18 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | |||
5003 | IXGBE_ADVTXD_DTYP_CTXT); | 5006 | IXGBE_ADVTXD_DTYP_CTXT); |
5004 | 5007 | ||
5005 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 5008 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
5006 | switch (skb->protocol) { | 5009 | __be16 protocol; |
5010 | |||
5011 | if (skb->protocol == cpu_to_be16(ETH_P_8021Q)) { | ||
5012 | const struct vlan_ethhdr *vhdr = | ||
5013 | (const struct vlan_ethhdr *)skb->data; | ||
5014 | |||
5015 | protocol = vhdr->h_vlan_encapsulated_proto; | ||
5016 | } else { | ||
5017 | protocol = skb->protocol; | ||
5018 | } | ||
5019 | |||
5020 | switch (protocol) { | ||
5007 | case cpu_to_be16(ETH_P_IP): | 5021 | case cpu_to_be16(ETH_P_IP): |
5008 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; | 5022 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; |
5009 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 5023 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index f3e8d52610b7..84650c6ebe03 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -841,6 +841,8 @@ | |||
841 | #define IXGBE_MPVC 0x04318 | 841 | #define IXGBE_MPVC 0x04318 |
842 | #define IXGBE_SGMIIC 0x04314 | 842 | #define IXGBE_SGMIIC 0x04314 |
843 | 843 | ||
844 | #define IXGBE_VALIDATE_LINK_READY_TIMEOUT 50 | ||
845 | |||
844 | /* Omer CORECTL */ | 846 | /* Omer CORECTL */ |
845 | #define IXGBE_CORECTL 0x014F00 | 847 | #define IXGBE_CORECTL 0x014F00 |
846 | /* BARCTRL */ | 848 | /* BARCTRL */ |
diff --git a/drivers/net/mlx4/sense.c b/drivers/net/mlx4/sense.c index f36ae691cab3..015fbe785c13 100644 --- a/drivers/net/mlx4/sense.c +++ b/drivers/net/mlx4/sense.c | |||
@@ -53,7 +53,7 @@ static int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, | |||
53 | 53 | ||
54 | if (out_param > 2) { | 54 | if (out_param > 2) { |
55 | mlx4_err(dev, "Sense returned illegal value: 0x%llx\n", out_param); | 55 | mlx4_err(dev, "Sense returned illegal value: 0x%llx\n", out_param); |
56 | return EINVAL; | 56 | return -EINVAL; |
57 | } | 57 | } |
58 | 58 | ||
59 | *type = out_param; | 59 | *type = out_param; |
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 17a27225cc98..98938ea9e0bd 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -912,7 +912,11 @@ static void media_check(unsigned long arg) | |||
912 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { | 912 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { |
913 | if (!lp->fast_poll) | 913 | if (!lp->fast_poll) |
914 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 914 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); |
915 | |||
916 | local_irq_save(flags); | ||
915 | el3_interrupt(dev->irq, dev); | 917 | el3_interrupt(dev->irq, dev); |
918 | local_irq_restore(flags); | ||
919 | |||
916 | lp->fast_poll = HZ; | 920 | lp->fast_poll = HZ; |
917 | } | 921 | } |
918 | if (lp->fast_poll) { | 922 | if (lp->fast_poll) { |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 6f8d7e2e5922..322e11df0097 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -711,7 +711,11 @@ static void media_check(unsigned long arg) | |||
711 | (inb(ioaddr + EL3_TIMER) == 0xff)) { | 711 | (inb(ioaddr + EL3_TIMER) == 0xff)) { |
712 | if (!lp->fast_poll) | 712 | if (!lp->fast_poll) |
713 | printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); | 713 | printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); |
714 | |||
715 | local_irq_save(flags); | ||
714 | el3_interrupt(dev->irq, dev); | 716 | el3_interrupt(dev->irq, dev); |
717 | local_irq_restore(flags); | ||
718 | |||
715 | lp->fast_poll = HZ; | 719 | lp->fast_poll = HZ; |
716 | } | 720 | } |
717 | if (lp->fast_poll) { | 721 | if (lp->fast_poll) { |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index 14949bb303a0..af3933579790 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -47,7 +47,7 @@ static const unsigned char payload_source[ETH_ALEN] = { | |||
47 | 0x00, 0x0f, 0x53, 0x1b, 0x1b, 0x1b, | 47 | 0x00, 0x0f, 0x53, 0x1b, 0x1b, 0x1b, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const char *payload_msg = | 50 | static const char payload_msg[] = |
51 | "Hello world! This is an Efx loopback test in progress!"; | 51 | "Hello world! This is an Efx loopback test in progress!"; |
52 | 52 | ||
53 | /** | 53 | /** |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index c88bc1013047..ca6285016dfd 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -84,6 +84,8 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
84 | .mpr = 1, | 84 | .mpr = 1, |
85 | .tpauser = 1, | 85 | .tpauser = 1, |
86 | .hw_swap = 1, | 86 | .hw_swap = 1, |
87 | .rpadir = 1, | ||
88 | .rpadir_value = 0x00020000, /* NET_IP_ALIGN assumed to be 2 */ | ||
87 | }; | 89 | }; |
88 | 90 | ||
89 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | 91 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) |
@@ -175,7 +177,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
175 | .tpauser = 1, | 177 | .tpauser = 1, |
176 | .bculr = 1, | 178 | .bculr = 1, |
177 | .hw_swap = 1, | 179 | .hw_swap = 1, |
178 | .rpadir = 1, | ||
179 | .no_trimd = 1, | 180 | .no_trimd = 1, |
180 | .no_ade = 1, | 181 | .no_ade = 1, |
181 | }; | 182 | }; |
@@ -501,6 +502,8 @@ static int sh_eth_ring_init(struct net_device *ndev) | |||
501 | */ | 502 | */ |
502 | mdp->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : | 503 | mdp->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : |
503 | (((ndev->mtu + 26 + 7) & ~7) + 2 + 16)); | 504 | (((ndev->mtu + 26 + 7) & ~7) + 2 + 16)); |
505 | if (mdp->cd->rpadir) | ||
506 | mdp->rx_buf_sz += NET_IP_ALIGN; | ||
504 | 507 | ||
505 | /* Allocate RX and TX skb rings */ | 508 | /* Allocate RX and TX skb rings */ |
506 | mdp->rx_skbuff = kmalloc(sizeof(*mdp->rx_skbuff) * RX_RING_SIZE, | 509 | mdp->rx_skbuff = kmalloc(sizeof(*mdp->rx_skbuff) * RX_RING_SIZE, |
@@ -715,6 +718,8 @@ static int sh_eth_rx(struct net_device *ndev) | |||
715 | pkt_len + 2); | 718 | pkt_len + 2); |
716 | skb = mdp->rx_skbuff[entry]; | 719 | skb = mdp->rx_skbuff[entry]; |
717 | mdp->rx_skbuff[entry] = NULL; | 720 | mdp->rx_skbuff[entry] = NULL; |
721 | if (mdp->cd->rpadir) | ||
722 | skb_reserve(skb, NET_IP_ALIGN); | ||
718 | skb_put(skb, pkt_len); | 723 | skb_put(skb, pkt_len); |
719 | skb->protocol = eth_type_trans(skb, ndev); | 724 | skb->protocol = eth_type_trans(skb, ndev); |
720 | netif_rx(skb); | 725 | netif_rx(skb); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 89a05d674ddc..1c01b96c9611 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -644,7 +644,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port) | |||
644 | { | 644 | { |
645 | u32 reg1; | 645 | u32 reg1; |
646 | 646 | ||
647 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
648 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 647 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); |
649 | reg1 &= ~phy_power[port]; | 648 | reg1 &= ~phy_power[port]; |
650 | 649 | ||
@@ -652,7 +651,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port) | |||
652 | reg1 |= coma_mode[port]; | 651 | reg1 |= coma_mode[port]; |
653 | 652 | ||
654 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 653 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); |
655 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
656 | sky2_pci_read32(hw, PCI_DEV_REG1); | 654 | sky2_pci_read32(hw, PCI_DEV_REG1); |
657 | 655 | ||
658 | if (hw->chip_id == CHIP_ID_YUKON_FE) | 656 | if (hw->chip_id == CHIP_ID_YUKON_FE) |
@@ -709,11 +707,9 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port) | |||
709 | gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN); | 707 | gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN); |
710 | } | 708 | } |
711 | 709 | ||
712 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
713 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 710 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); |
714 | reg1 |= phy_power[port]; /* set PHY to PowerDown/COMA Mode */ | 711 | reg1 |= phy_power[port]; /* set PHY to PowerDown/COMA Mode */ |
715 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 712 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); |
716 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
717 | } | 713 | } |
718 | 714 | ||
719 | /* Force a renegotiation */ | 715 | /* Force a renegotiation */ |
@@ -2152,9 +2148,7 @@ static void sky2_qlink_intr(struct sky2_hw *hw) | |||
2152 | 2148 | ||
2153 | /* reset PHY Link Detect */ | 2149 | /* reset PHY Link Detect */ |
2154 | phy = sky2_pci_read16(hw, PSM_CONFIG_REG4); | 2150 | phy = sky2_pci_read16(hw, PSM_CONFIG_REG4); |
2155 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2156 | sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1); | 2151 | sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1); |
2157 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2158 | 2152 | ||
2159 | sky2_link_up(sky2); | 2153 | sky2_link_up(sky2); |
2160 | } | 2154 | } |
@@ -2645,7 +2639,6 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2645 | if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) { | 2639 | if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) { |
2646 | u16 pci_err; | 2640 | u16 pci_err; |
2647 | 2641 | ||
2648 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2649 | pci_err = sky2_pci_read16(hw, PCI_STATUS); | 2642 | pci_err = sky2_pci_read16(hw, PCI_STATUS); |
2650 | if (net_ratelimit()) | 2643 | if (net_ratelimit()) |
2651 | dev_err(&pdev->dev, "PCI hardware error (0x%x)\n", | 2644 | dev_err(&pdev->dev, "PCI hardware error (0x%x)\n", |
@@ -2653,14 +2646,12 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2653 | 2646 | ||
2654 | sky2_pci_write16(hw, PCI_STATUS, | 2647 | sky2_pci_write16(hw, PCI_STATUS, |
2655 | pci_err | PCI_STATUS_ERROR_BITS); | 2648 | pci_err | PCI_STATUS_ERROR_BITS); |
2656 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2657 | } | 2649 | } |
2658 | 2650 | ||
2659 | if (status & Y2_IS_PCI_EXP) { | 2651 | if (status & Y2_IS_PCI_EXP) { |
2660 | /* PCI-Express uncorrectable Error occurred */ | 2652 | /* PCI-Express uncorrectable Error occurred */ |
2661 | u32 err; | 2653 | u32 err; |
2662 | 2654 | ||
2663 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2664 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | 2655 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); |
2665 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | 2656 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, |
2666 | 0xfffffffful); | 2657 | 0xfffffffful); |
@@ -2668,7 +2659,6 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2668 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); | 2659 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); |
2669 | 2660 | ||
2670 | sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | 2661 | sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); |
2671 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2672 | } | 2662 | } |
2673 | 2663 | ||
2674 | if (status & Y2_HWE_L1_MASK) | 2664 | if (status & Y2_HWE_L1_MASK) |
@@ -3047,7 +3037,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3047 | } | 3037 | } |
3048 | 3038 | ||
3049 | sky2_power_on(hw); | 3039 | sky2_power_on(hw); |
3050 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
3051 | 3040 | ||
3052 | for (i = 0; i < hw->ports; i++) { | 3041 | for (i = 0; i < hw->ports; i++) { |
3053 | sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); | 3042 | sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); |
@@ -3084,7 +3073,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3084 | reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE; | 3073 | reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE; |
3085 | 3074 | ||
3086 | /* reset PHY Link Detect */ | 3075 | /* reset PHY Link Detect */ |
3087 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
3088 | sky2_pci_write16(hw, PSM_CONFIG_REG4, | 3076 | sky2_pci_write16(hw, PSM_CONFIG_REG4, |
3089 | reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT); | 3077 | reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT); |
3090 | sky2_pci_write16(hw, PSM_CONFIG_REG4, reg); | 3078 | sky2_pci_write16(hw, PSM_CONFIG_REG4, reg); |
@@ -3102,7 +3090,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3102 | /* restore the PCIe Link Control register */ | 3090 | /* restore the PCIe Link Control register */ |
3103 | sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg); | 3091 | sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg); |
3104 | } | 3092 | } |
3105 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
3106 | 3093 | ||
3107 | /* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */ | 3094 | /* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */ |
3108 | sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16)); | 3095 | sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16)); |
@@ -4530,7 +4517,7 @@ static const char *sky2_name(u8 chipid, char *buf, int sz) | |||
4530 | "Optima", /* 0xbc */ | 4517 | "Optima", /* 0xbc */ |
4531 | }; | 4518 | }; |
4532 | 4519 | ||
4533 | if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_OPT) | 4520 | if (chipid >= CHIP_ID_YUKON_XL && chipid <= CHIP_ID_YUKON_OPT) |
4534 | strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz); | 4521 | strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz); |
4535 | else | 4522 | else |
4536 | snprintf(buf, sz, "(chip %#x)", chipid); | 4523 | snprintf(buf, sz, "(chip %#x)", chipid); |
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index b091e20ca167..f14d225404da 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -324,7 +324,7 @@ static int rtl8150_set_mac_address(struct net_device *netdev, void *p) | |||
324 | dbg("%02X:", netdev->dev_addr[i]); | 324 | dbg("%02X:", netdev->dev_addr[i]); |
325 | dbg("%02X\n", netdev->dev_addr[i]); | 325 | dbg("%02X\n", netdev->dev_addr[i]); |
326 | /* Set the IDR registers. */ | 326 | /* Set the IDR registers. */ |
327 | set_registers(dev, IDR, sizeof(netdev->dev_addr), netdev->dev_addr); | 327 | set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr); |
328 | #ifdef EEPROM_WRITE | 328 | #ifdef EEPROM_WRITE |
329 | { | 329 | { |
330 | u8 cr; | 330 | u8 cr; |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 1ed2a5cc03f5..3db7767d2a17 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -51,6 +51,15 @@ struct can_priv { | |||
51 | struct sk_buff **echo_skb; | 51 | struct sk_buff **echo_skb; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* | ||
55 | * get_can_dlc(value) - helper macro to cast a given data length code (dlc) | ||
56 | * to __u8 and ensure the dlc value to be max. 8 bytes. | ||
57 | * | ||
58 | * To be used in the CAN netdriver receive path to ensure conformance with | ||
59 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | ||
60 | */ | ||
61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | ||
62 | |||
54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
55 | void free_candev(struct net_device *dev); | 64 | void free_candev(struct net_device *dev); |
56 | 65 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 14fc906ed602..05330fc5b436 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -368,11 +368,9 @@ enum { | |||
368 | #define RTAX_MAX (__RTAX_MAX - 1) | 368 | #define RTAX_MAX (__RTAX_MAX - 1) |
369 | 369 | ||
370 | #define RTAX_FEATURE_ECN 0x00000001 | 370 | #define RTAX_FEATURE_ECN 0x00000001 |
371 | #define RTAX_FEATURE_NO_SACK 0x00000002 | 371 | #define RTAX_FEATURE_SACK 0x00000002 |
372 | #define RTAX_FEATURE_NO_TSTAMP 0x00000004 | 372 | #define RTAX_FEATURE_TIMESTAMP 0x00000004 |
373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 | 373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 |
374 | #define RTAX_FEATURE_NO_WSCALE 0x00000010 | ||
375 | #define RTAX_FEATURE_NO_DSACK 0x00000020 | ||
376 | 374 | ||
377 | struct rta_session { | 375 | struct rta_session { |
378 | __u8 proto; | 376 | __u8 proto; |
diff --git a/include/net/dst.h b/include/net/dst.h index 387cb3cfde7e..39c4a5963e12 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric) | |||
113 | static inline u32 | 113 | static inline u32 |
114 | dst_feature(const struct dst_entry *dst, u32 feature) | 114 | dst_feature(const struct dst_entry *dst, u32 feature) |
115 | { | 115 | { |
116 | return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); | 116 | return dst_metric(dst, RTAX_FEATURES) & feature; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline u32 dst_mtu(const struct dst_entry *dst) | 119 | static inline u32 dst_mtu(const struct dst_entry *dst) |
diff --git a/include/net/ip.h b/include/net/ip.h index e6b9d12d5f62..85108cfbb1ae 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -337,6 +337,7 @@ enum ip_defrag_users { | |||
337 | IP_DEFRAG_CALL_RA_CHAIN, | 337 | IP_DEFRAG_CALL_RA_CHAIN, |
338 | IP_DEFRAG_CONNTRACK_IN, | 338 | IP_DEFRAG_CONNTRACK_IN, |
339 | IP_DEFRAG_CONNTRACK_OUT, | 339 | IP_DEFRAG_CONNTRACK_OUT, |
340 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
340 | IP_DEFRAG_VS_IN, | 341 | IP_DEFRAG_VS_IN, |
341 | IP_DEFRAG_VS_OUT, | 342 | IP_DEFRAG_VS_OUT, |
342 | IP_DEFRAG_VS_FWD | 343 | IP_DEFRAG_VS_FWD |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 92db8617d188..ccab5946c830 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -350,8 +350,16 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1, | |||
350 | 350 | ||
351 | struct inet_frag_queue; | 351 | struct inet_frag_queue; |
352 | 352 | ||
353 | enum ip6_defrag_users { | ||
354 | IP6_DEFRAG_LOCAL_DELIVER, | ||
355 | IP6_DEFRAG_CONNTRACK_IN, | ||
356 | IP6_DEFRAG_CONNTRACK_OUT, | ||
357 | IP6_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
358 | }; | ||
359 | |||
353 | struct ip6_create_arg { | 360 | struct ip6_create_arg { |
354 | __be32 id; | 361 | __be32 id; |
362 | u32 user; | ||
355 | struct in6_addr *src; | 363 | struct in6_addr *src; |
356 | struct in6_addr *dst; | 364 | struct in6_addr *dst; |
357 | }; | 365 | }; |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index abc55ad75c2b..1ee717eb5b09 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -9,7 +9,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | |||
9 | 9 | ||
10 | extern int nf_ct_frag6_init(void); | 10 | extern int nf_ct_frag6_init(void); |
11 | extern void nf_ct_frag6_cleanup(void); | 11 | extern void nf_ct_frag6_cleanup(void); |
12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); | 12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); |
13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | 13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, |
14 | struct net_device *in, | 14 | struct net_device *in, |
15 | struct net_device *out, | 15 | struct net_device *out, |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1b6f7d348cee..34f5cc24d903 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -408,8 +408,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
408 | extern void tcp_parse_options(struct sk_buff *skb, | 408 | extern void tcp_parse_options(struct sk_buff *skb, |
409 | struct tcp_options_received *opt_rx, | 409 | struct tcp_options_received *opt_rx, |
410 | u8 **hvpp, | 410 | u8 **hvpp, |
411 | int estab, | 411 | int estab); |
412 | struct dst_entry *dst); | ||
413 | 412 | ||
414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 413 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
415 | 414 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 6fe7d739e59b..be9924f60ec3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5035,6 +5035,11 @@ int register_netdevice(struct net_device *dev) | |||
5035 | rollback_registered(dev); | 5035 | rollback_registered(dev); |
5036 | dev->reg_state = NETREG_UNREGISTERED; | 5036 | dev->reg_state = NETREG_UNREGISTERED; |
5037 | } | 5037 | } |
5038 | /* | ||
5039 | * Prevent userspace races by waiting until the network | ||
5040 | * device is fully setup before sending notifications. | ||
5041 | */ | ||
5042 | rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U); | ||
5038 | 5043 | ||
5039 | out: | 5044 | out: |
5040 | return ret; | 5045 | return ret; |
@@ -5597,6 +5602,12 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char | |||
5597 | /* Notify protocols, that a new device appeared. */ | 5602 | /* Notify protocols, that a new device appeared. */ |
5598 | call_netdevice_notifiers(NETDEV_REGISTER, dev); | 5603 | call_netdevice_notifiers(NETDEV_REGISTER, dev); |
5599 | 5604 | ||
5605 | /* | ||
5606 | * Prevent userspace races by waiting until the network | ||
5607 | * device is fully setup before sending notifications. | ||
5608 | */ | ||
5609 | rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U); | ||
5610 | |||
5600 | synchronize_net(); | 5611 | synchronize_net(); |
5601 | err = 0; | 5612 | err = 0; |
5602 | out: | 5613 | out: |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 33148a568199..794bcb897ff0 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1364,15 +1364,15 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi | |||
1364 | case NETDEV_UNREGISTER: | 1364 | case NETDEV_UNREGISTER: |
1365 | rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); | 1365 | rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); |
1366 | break; | 1366 | break; |
1367 | case NETDEV_REGISTER: | ||
1368 | rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U); | ||
1369 | break; | ||
1370 | case NETDEV_UP: | 1367 | case NETDEV_UP: |
1371 | case NETDEV_DOWN: | 1368 | case NETDEV_DOWN: |
1372 | rtmsg_ifinfo(RTM_NEWLINK, dev, IFF_UP|IFF_RUNNING); | 1369 | rtmsg_ifinfo(RTM_NEWLINK, dev, IFF_UP|IFF_RUNNING); |
1373 | break; | 1370 | break; |
1371 | case NETDEV_POST_INIT: | ||
1372 | case NETDEV_REGISTER: | ||
1374 | case NETDEV_CHANGE: | 1373 | case NETDEV_CHANGE: |
1375 | case NETDEV_GOING_DOWN: | 1374 | case NETDEV_GOING_DOWN: |
1375 | case NETDEV_UNREGISTER_BATCH: | ||
1376 | break; | 1376 | break; |
1377 | default: | 1377 | default: |
1378 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0); | 1378 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0); |
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index fa2d6b6fc3e5..331ead3ebd1b 100644 --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <net/route.h> | 14 | #include <net/route.h> |
15 | #include <net/ip.h> | 15 | #include <net/ip.h> |
16 | 16 | ||
17 | #include <linux/netfilter_bridge.h> | ||
17 | #include <linux/netfilter_ipv4.h> | 18 | #include <linux/netfilter_ipv4.h> |
18 | #include <net/netfilter/ipv4/nf_defrag_ipv4.h> | 19 | #include <net/netfilter/ipv4/nf_defrag_ipv4.h> |
19 | 20 | ||
@@ -34,6 +35,20 @@ static int nf_ct_ipv4_gather_frags(struct sk_buff *skb, u_int32_t user) | |||
34 | return err; | 35 | return err; |
35 | } | 36 | } |
36 | 37 | ||
38 | static enum ip_defrag_users nf_ct_defrag_user(unsigned int hooknum, | ||
39 | struct sk_buff *skb) | ||
40 | { | ||
41 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
42 | if (skb->nf_bridge && | ||
43 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) | ||
44 | return IP_DEFRAG_CONNTRACK_BRIDGE_IN; | ||
45 | #endif | ||
46 | if (hooknum == NF_INET_PRE_ROUTING) | ||
47 | return IP_DEFRAG_CONNTRACK_IN; | ||
48 | else | ||
49 | return IP_DEFRAG_CONNTRACK_OUT; | ||
50 | } | ||
51 | |||
37 | static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, | 52 | static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, |
38 | struct sk_buff *skb, | 53 | struct sk_buff *skb, |
39 | const struct net_device *in, | 54 | const struct net_device *in, |
@@ -50,10 +65,8 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, | |||
50 | #endif | 65 | #endif |
51 | /* Gather fragments. */ | 66 | /* Gather fragments. */ |
52 | if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { | 67 | if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { |
53 | if (nf_ct_ipv4_gather_frags(skb, | 68 | enum ip_defrag_users user = nf_ct_defrag_user(hooknum, skb); |
54 | hooknum == NF_INET_PRE_ROUTING ? | 69 | if (nf_ct_ipv4_gather_frags(skb, user)) |
55 | IP_DEFRAG_CONNTRACK_IN : | ||
56 | IP_DEFRAG_CONNTRACK_OUT)) | ||
57 | return NF_STOLEN; | 70 | return NF_STOLEN; |
58 | } | 71 | } |
59 | return NF_ACCEPT; | 72 | return NF_ACCEPT; |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 26399ad2a289..66fd80ef2473 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -277,6 +277,13 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
277 | 277 | ||
278 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); | 278 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); |
279 | 279 | ||
280 | /* check for timestamp cookie support */ | ||
281 | memset(&tcp_opt, 0, sizeof(tcp_opt)); | ||
282 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0); | ||
283 | |||
284 | if (tcp_opt.saw_tstamp) | ||
285 | cookie_check_timestamp(&tcp_opt); | ||
286 | |||
280 | ret = NULL; | 287 | ret = NULL; |
281 | req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */ | 288 | req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */ |
282 | if (!req) | 289 | if (!req) |
@@ -292,6 +299,12 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
292 | ireq->loc_addr = ip_hdr(skb)->daddr; | 299 | ireq->loc_addr = ip_hdr(skb)->daddr; |
293 | ireq->rmt_addr = ip_hdr(skb)->saddr; | 300 | ireq->rmt_addr = ip_hdr(skb)->saddr; |
294 | ireq->ecn_ok = 0; | 301 | ireq->ecn_ok = 0; |
302 | ireq->snd_wscale = tcp_opt.snd_wscale; | ||
303 | ireq->rcv_wscale = tcp_opt.rcv_wscale; | ||
304 | ireq->sack_ok = tcp_opt.sack_ok; | ||
305 | ireq->wscale_ok = tcp_opt.wscale_ok; | ||
306 | ireq->tstamp_ok = tcp_opt.saw_tstamp; | ||
307 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; | ||
295 | 308 | ||
296 | /* We throwed the options of the initial SYN away, so we hope | 309 | /* We throwed the options of the initial SYN away, so we hope |
297 | * the ACK carries the same options again (see RFC1122 4.2.3.8) | 310 | * the ACK carries the same options again (see RFC1122 4.2.3.8) |
@@ -340,20 +353,6 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
340 | } | 353 | } |
341 | } | 354 | } |
342 | 355 | ||
343 | /* check for timestamp cookie support */ | ||
344 | memset(&tcp_opt, 0, sizeof(tcp_opt)); | ||
345 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0, &rt->u.dst); | ||
346 | |||
347 | if (tcp_opt.saw_tstamp) | ||
348 | cookie_check_timestamp(&tcp_opt); | ||
349 | |||
350 | ireq->snd_wscale = tcp_opt.snd_wscale; | ||
351 | ireq->rcv_wscale = tcp_opt.rcv_wscale; | ||
352 | ireq->sack_ok = tcp_opt.sack_ok; | ||
353 | ireq->wscale_ok = tcp_opt.wscale_ok; | ||
354 | ireq->tstamp_ok = tcp_opt.saw_tstamp; | ||
355 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; | ||
356 | |||
357 | /* Try to redo what tcp_v4_send_synack did. */ | 356 | /* Try to redo what tcp_v4_send_synack did. */ |
358 | req->window_clamp = tp->window_clamp ? :dst_metric(&rt->u.dst, RTAX_WINDOW); | 357 | req->window_clamp = tp->window_clamp ? :dst_metric(&rt->u.dst, RTAX_WINDOW); |
359 | 358 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 12cab7d74dba..28e029632493 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3727,7 +3727,7 @@ old_ack: | |||
3727 | * the fast version below fails. | 3727 | * the fast version below fails. |
3728 | */ | 3728 | */ |
3729 | void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | 3729 | void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, |
3730 | u8 **hvpp, int estab, struct dst_entry *dst) | 3730 | u8 **hvpp, int estab) |
3731 | { | 3731 | { |
3732 | unsigned char *ptr; | 3732 | unsigned char *ptr; |
3733 | struct tcphdr *th = tcp_hdr(skb); | 3733 | struct tcphdr *th = tcp_hdr(skb); |
@@ -3766,8 +3766,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3766 | break; | 3766 | break; |
3767 | case TCPOPT_WINDOW: | 3767 | case TCPOPT_WINDOW: |
3768 | if (opsize == TCPOLEN_WINDOW && th->syn && | 3768 | if (opsize == TCPOLEN_WINDOW && th->syn && |
3769 | !estab && sysctl_tcp_window_scaling && | 3769 | !estab && sysctl_tcp_window_scaling) { |
3770 | !dst_feature(dst, RTAX_FEATURE_NO_WSCALE)) { | ||
3771 | __u8 snd_wscale = *(__u8 *)ptr; | 3770 | __u8 snd_wscale = *(__u8 *)ptr; |
3772 | opt_rx->wscale_ok = 1; | 3771 | opt_rx->wscale_ok = 1; |
3773 | if (snd_wscale > 14) { | 3772 | if (snd_wscale > 14) { |
@@ -3783,8 +3782,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3783 | case TCPOPT_TIMESTAMP: | 3782 | case TCPOPT_TIMESTAMP: |
3784 | if ((opsize == TCPOLEN_TIMESTAMP) && | 3783 | if ((opsize == TCPOLEN_TIMESTAMP) && |
3785 | ((estab && opt_rx->tstamp_ok) || | 3784 | ((estab && opt_rx->tstamp_ok) || |
3786 | (!estab && sysctl_tcp_timestamps && | 3785 | (!estab && sysctl_tcp_timestamps))) { |
3787 | !dst_feature(dst, RTAX_FEATURE_NO_TSTAMP)))) { | ||
3788 | opt_rx->saw_tstamp = 1; | 3786 | opt_rx->saw_tstamp = 1; |
3789 | opt_rx->rcv_tsval = get_unaligned_be32(ptr); | 3787 | opt_rx->rcv_tsval = get_unaligned_be32(ptr); |
3790 | opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4); | 3788 | opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4); |
@@ -3792,8 +3790,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3792 | break; | 3790 | break; |
3793 | case TCPOPT_SACK_PERM: | 3791 | case TCPOPT_SACK_PERM: |
3794 | if (opsize == TCPOLEN_SACK_PERM && th->syn && | 3792 | if (opsize == TCPOLEN_SACK_PERM && th->syn && |
3795 | !estab && sysctl_tcp_sack && | 3793 | !estab && sysctl_tcp_sack) { |
3796 | !dst_feature(dst, RTAX_FEATURE_NO_SACK)) { | ||
3797 | opt_rx->sack_ok = 1; | 3794 | opt_rx->sack_ok = 1; |
3798 | tcp_sack_reset(opt_rx); | 3795 | tcp_sack_reset(opt_rx); |
3799 | } | 3796 | } |
@@ -3878,7 +3875,7 @@ static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, | |||
3878 | if (tcp_parse_aligned_timestamp(tp, th)) | 3875 | if (tcp_parse_aligned_timestamp(tp, th)) |
3879 | return 1; | 3876 | return 1; |
3880 | } | 3877 | } |
3881 | tcp_parse_options(skb, &tp->rx_opt, hvpp, 1, NULL); | 3878 | tcp_parse_options(skb, &tp->rx_opt, hvpp, 1); |
3882 | return 1; | 3879 | return 1; |
3883 | } | 3880 | } |
3884 | 3881 | ||
@@ -4133,10 +4130,8 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, | |||
4133 | static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq) | 4130 | static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq) |
4134 | { | 4131 | { |
4135 | struct tcp_sock *tp = tcp_sk(sk); | 4132 | struct tcp_sock *tp = tcp_sk(sk); |
4136 | struct dst_entry *dst = __sk_dst_get(sk); | ||
4137 | 4133 | ||
4138 | if (tcp_is_sack(tp) && sysctl_tcp_dsack && | 4134 | if (tcp_is_sack(tp) && sysctl_tcp_dsack) { |
4139 | !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) { | ||
4140 | int mib_idx; | 4135 | int mib_idx; |
4141 | 4136 | ||
4142 | if (before(seq, tp->rcv_nxt)) | 4137 | if (before(seq, tp->rcv_nxt)) |
@@ -4165,15 +4160,13 @@ static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq) | |||
4165 | static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) | 4160 | static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) |
4166 | { | 4161 | { |
4167 | struct tcp_sock *tp = tcp_sk(sk); | 4162 | struct tcp_sock *tp = tcp_sk(sk); |
4168 | struct dst_entry *dst = __sk_dst_get(sk); | ||
4169 | 4163 | ||
4170 | if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && | 4164 | if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && |
4171 | before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { | 4165 | before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { |
4172 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); | 4166 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); |
4173 | tcp_enter_quickack_mode(sk); | 4167 | tcp_enter_quickack_mode(sk); |
4174 | 4168 | ||
4175 | if (tcp_is_sack(tp) && sysctl_tcp_dsack && | 4169 | if (tcp_is_sack(tp) && sysctl_tcp_dsack) { |
4176 | !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) { | ||
4177 | u32 end_seq = TCP_SKB_CB(skb)->end_seq; | 4170 | u32 end_seq = TCP_SKB_CB(skb)->end_seq; |
4178 | 4171 | ||
4179 | if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) | 4172 | if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) |
@@ -5428,11 +5421,10 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | |||
5428 | u8 *hash_location; | 5421 | u8 *hash_location; |
5429 | struct inet_connection_sock *icsk = inet_csk(sk); | 5422 | struct inet_connection_sock *icsk = inet_csk(sk); |
5430 | struct tcp_sock *tp = tcp_sk(sk); | 5423 | struct tcp_sock *tp = tcp_sk(sk); |
5431 | struct dst_entry *dst = __sk_dst_get(sk); | ||
5432 | struct tcp_cookie_values *cvp = tp->cookie_values; | 5424 | struct tcp_cookie_values *cvp = tp->cookie_values; |
5433 | int saved_clamp = tp->rx_opt.mss_clamp; | 5425 | int saved_clamp = tp->rx_opt.mss_clamp; |
5434 | 5426 | ||
5435 | tcp_parse_options(skb, &tp->rx_opt, &hash_location, 0, dst); | 5427 | tcp_parse_options(skb, &tp->rx_opt, &hash_location, 0); |
5436 | 5428 | ||
5437 | if (th->ack) { | 5429 | if (th->ack) { |
5438 | /* rfc793: | 5430 | /* rfc793: |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 15e96030ce47..65b8ebfd078a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1262,20 +1262,10 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1262 | tcp_rsk(req)->af_specific = &tcp_request_sock_ipv4_ops; | 1262 | tcp_rsk(req)->af_specific = &tcp_request_sock_ipv4_ops; |
1263 | #endif | 1263 | #endif |
1264 | 1264 | ||
1265 | ireq = inet_rsk(req); | ||
1266 | ireq->loc_addr = daddr; | ||
1267 | ireq->rmt_addr = saddr; | ||
1268 | ireq->no_srccheck = inet_sk(sk)->transparent; | ||
1269 | ireq->opt = tcp_v4_save_options(sk, skb); | ||
1270 | |||
1271 | dst = inet_csk_route_req(sk, req); | ||
1272 | if(!dst) | ||
1273 | goto drop_and_free; | ||
1274 | |||
1275 | tcp_clear_options(&tmp_opt); | 1265 | tcp_clear_options(&tmp_opt); |
1276 | tmp_opt.mss_clamp = TCP_MSS_DEFAULT; | 1266 | tmp_opt.mss_clamp = TCP_MSS_DEFAULT; |
1277 | tmp_opt.user_mss = tp->rx_opt.user_mss; | 1267 | tmp_opt.user_mss = tp->rx_opt.user_mss; |
1278 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0, dst); | 1268 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0); |
1279 | 1269 | ||
1280 | if (tmp_opt.cookie_plus > 0 && | 1270 | if (tmp_opt.cookie_plus > 0 && |
1281 | tmp_opt.saw_tstamp && | 1271 | tmp_opt.saw_tstamp && |
@@ -1319,8 +1309,14 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1319 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; | 1309 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; |
1320 | tcp_openreq_init(req, &tmp_opt, skb); | 1310 | tcp_openreq_init(req, &tmp_opt, skb); |
1321 | 1311 | ||
1312 | ireq = inet_rsk(req); | ||
1313 | ireq->loc_addr = daddr; | ||
1314 | ireq->rmt_addr = saddr; | ||
1315 | ireq->no_srccheck = inet_sk(sk)->transparent; | ||
1316 | ireq->opt = tcp_v4_save_options(sk, skb); | ||
1317 | |||
1322 | if (security_inet_conn_request(sk, skb, req)) | 1318 | if (security_inet_conn_request(sk, skb, req)) |
1323 | goto drop_and_release; | 1319 | goto drop_and_free; |
1324 | 1320 | ||
1325 | if (!want_cookie) | 1321 | if (!want_cookie) |
1326 | TCP_ECN_create_request(req, tcp_hdr(skb)); | 1322 | TCP_ECN_create_request(req, tcp_hdr(skb)); |
@@ -1345,6 +1341,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1345 | */ | 1341 | */ |
1346 | if (tmp_opt.saw_tstamp && | 1342 | if (tmp_opt.saw_tstamp && |
1347 | tcp_death_row.sysctl_tw_recycle && | 1343 | tcp_death_row.sysctl_tw_recycle && |
1344 | (dst = inet_csk_route_req(sk, req)) != NULL && | ||
1348 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && | 1345 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && |
1349 | peer->v4daddr == saddr) { | 1346 | peer->v4daddr == saddr) { |
1350 | if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL && | 1347 | if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL && |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 87accec8d097..f206ee5dda80 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -95,9 +95,9 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, | |||
95 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); | 95 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); |
96 | int paws_reject = 0; | 96 | int paws_reject = 0; |
97 | 97 | ||
98 | tmp_opt.saw_tstamp = 0; | ||
98 | if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) { | 99 | if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) { |
99 | tmp_opt.tstamp_ok = 1; | 100 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0); |
100 | tcp_parse_options(skb, &tmp_opt, &hash_location, 1, NULL); | ||
101 | 101 | ||
102 | if (tmp_opt.saw_tstamp) { | 102 | if (tmp_opt.saw_tstamp) { |
103 | tmp_opt.ts_recent = tcptw->tw_ts_recent; | 103 | tmp_opt.ts_recent = tcptw->tw_ts_recent; |
@@ -526,9 +526,9 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | |||
526 | __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); | 526 | __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); |
527 | int paws_reject = 0; | 527 | int paws_reject = 0; |
528 | 528 | ||
529 | if ((th->doff > (sizeof(*th) >> 2)) && (req->ts_recent)) { | 529 | tmp_opt.saw_tstamp = 0; |
530 | tmp_opt.tstamp_ok = 1; | 530 | if (th->doff > (sizeof(struct tcphdr)>>2)) { |
531 | tcp_parse_options(skb, &tmp_opt, &hash_location, 1, NULL); | 531 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0); |
532 | 532 | ||
533 | if (tmp_opt.saw_tstamp) { | 533 | if (tmp_opt.saw_tstamp) { |
534 | tmp_opt.ts_recent = req->ts_recent; | 534 | tmp_opt.ts_recent = req->ts_recent; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 93316a96d820..383ce237640f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -553,7 +553,6 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb, | |||
553 | struct tcp_md5sig_key **md5) { | 553 | struct tcp_md5sig_key **md5) { |
554 | struct tcp_sock *tp = tcp_sk(sk); | 554 | struct tcp_sock *tp = tcp_sk(sk); |
555 | struct tcp_cookie_values *cvp = tp->cookie_values; | 555 | struct tcp_cookie_values *cvp = tp->cookie_values; |
556 | struct dst_entry *dst = __sk_dst_get(sk); | ||
557 | unsigned remaining = MAX_TCP_OPTION_SPACE; | 556 | unsigned remaining = MAX_TCP_OPTION_SPACE; |
558 | u8 cookie_size = (!tp->rx_opt.cookie_out_never && cvp != NULL) ? | 557 | u8 cookie_size = (!tp->rx_opt.cookie_out_never && cvp != NULL) ? |
559 | tcp_cookie_size_check(cvp->cookie_desired) : | 558 | tcp_cookie_size_check(cvp->cookie_desired) : |
@@ -581,22 +580,18 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb, | |||
581 | opts->mss = tcp_advertise_mss(sk); | 580 | opts->mss = tcp_advertise_mss(sk); |
582 | remaining -= TCPOLEN_MSS_ALIGNED; | 581 | remaining -= TCPOLEN_MSS_ALIGNED; |
583 | 582 | ||
584 | if (likely(sysctl_tcp_timestamps && | 583 | if (likely(sysctl_tcp_timestamps && *md5 == NULL)) { |
585 | !dst_feature(dst, RTAX_FEATURE_NO_TSTAMP) && | ||
586 | *md5 == NULL)) { | ||
587 | opts->options |= OPTION_TS; | 584 | opts->options |= OPTION_TS; |
588 | opts->tsval = TCP_SKB_CB(skb)->when; | 585 | opts->tsval = TCP_SKB_CB(skb)->when; |
589 | opts->tsecr = tp->rx_opt.ts_recent; | 586 | opts->tsecr = tp->rx_opt.ts_recent; |
590 | remaining -= TCPOLEN_TSTAMP_ALIGNED; | 587 | remaining -= TCPOLEN_TSTAMP_ALIGNED; |
591 | } | 588 | } |
592 | if (likely(sysctl_tcp_window_scaling && | 589 | if (likely(sysctl_tcp_window_scaling)) { |
593 | !dst_feature(dst, RTAX_FEATURE_NO_WSCALE))) { | ||
594 | opts->ws = tp->rx_opt.rcv_wscale; | 590 | opts->ws = tp->rx_opt.rcv_wscale; |
595 | opts->options |= OPTION_WSCALE; | 591 | opts->options |= OPTION_WSCALE; |
596 | remaining -= TCPOLEN_WSCALE_ALIGNED; | 592 | remaining -= TCPOLEN_WSCALE_ALIGNED; |
597 | } | 593 | } |
598 | if (likely(sysctl_tcp_sack && | 594 | if (likely(sysctl_tcp_sack)) { |
599 | !dst_feature(dst, RTAX_FEATURE_NO_SACK))) { | ||
600 | opts->options |= OPTION_SACK_ADVERTISE; | 595 | opts->options |= OPTION_SACK_ADVERTISE; |
601 | if (unlikely(!(OPTION_TS & opts->options))) | 596 | if (unlikely(!(OPTION_TS & opts->options))) |
602 | remaining -= TCPOLEN_SACKPERM_ALIGNED; | 597 | remaining -= TCPOLEN_SACKPERM_ALIGNED; |
@@ -2527,9 +2522,7 @@ static void tcp_connect_init(struct sock *sk) | |||
2527 | * See tcp_input.c:tcp_rcv_state_process case TCP_SYN_SENT. | 2522 | * See tcp_input.c:tcp_rcv_state_process case TCP_SYN_SENT. |
2528 | */ | 2523 | */ |
2529 | tp->tcp_header_len = sizeof(struct tcphdr) + | 2524 | tp->tcp_header_len = sizeof(struct tcphdr) + |
2530 | (sysctl_tcp_timestamps && | 2525 | (sysctl_tcp_timestamps ? TCPOLEN_TSTAMP_ALIGNED : 0); |
2531 | (!dst_feature(dst, RTAX_FEATURE_NO_TSTAMP) ? | ||
2532 | TCPOLEN_TSTAMP_ALIGNED : 0)); | ||
2533 | 2526 | ||
2534 | #ifdef CONFIG_TCP_MD5SIG | 2527 | #ifdef CONFIG_TCP_MD5SIG |
2535 | if (tp->af_specific->md5_lookup(sk, sk) != NULL) | 2528 | if (tp->af_specific->md5_lookup(sk, sk) != NULL) |
@@ -2555,8 +2548,7 @@ static void tcp_connect_init(struct sock *sk) | |||
2555 | tp->advmss - (tp->rx_opt.ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0), | 2548 | tp->advmss - (tp->rx_opt.ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0), |
2556 | &tp->rcv_wnd, | 2549 | &tp->rcv_wnd, |
2557 | &tp->window_clamp, | 2550 | &tp->window_clamp, |
2558 | (sysctl_tcp_window_scaling && | 2551 | sysctl_tcp_window_scaling, |
2559 | !dst_feature(dst, RTAX_FEATURE_NO_WSCALE)), | ||
2560 | &rcv_wscale); | 2552 | &rcv_wscale); |
2561 | 2553 | ||
2562 | tp->rx_opt.rcv_wscale = rcv_wscale; | 2554 | tp->rx_opt.rcv_wscale = rcv_wscale; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1f9534846ca9..f0126fdd7e04 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -216,9 +216,8 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
216 | * force rand to be an odd multiple of UDP_HTABLE_SIZE | 216 | * force rand to be an odd multiple of UDP_HTABLE_SIZE |
217 | */ | 217 | */ |
218 | rand = (rand | 1) * (udptable->mask + 1); | 218 | rand = (rand | 1) * (udptable->mask + 1); |
219 | for (last = first + udptable->mask + 1; | 219 | last = first + udptable->mask + 1; |
220 | first != last; | 220 | do { |
221 | first++) { | ||
222 | hslot = udp_hashslot(udptable, net, first); | 221 | hslot = udp_hashslot(udptable, net, first); |
223 | bitmap_zero(bitmap, PORTS_PER_CHAIN); | 222 | bitmap_zero(bitmap, PORTS_PER_CHAIN); |
224 | spin_lock_bh(&hslot->lock); | 223 | spin_lock_bh(&hslot->lock); |
@@ -238,7 +237,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
238 | snum += rand; | 237 | snum += rand; |
239 | } while (snum != first); | 238 | } while (snum != first); |
240 | spin_unlock_bh(&hslot->lock); | 239 | spin_unlock_bh(&hslot->lock); |
241 | } | 240 | } while (++first != last); |
242 | goto fail; | 241 | goto fail; |
243 | } else { | 242 | } else { |
244 | hslot = udp_hashslot(udptable, net, snum); | 243 | hslot = udp_hashslot(udptable, net, snum); |
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index 5f2ec208a8c3..0956ebabbff2 100644 --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <net/ipv6.h> | 20 | #include <net/ipv6.h> |
21 | #include <net/inet_frag.h> | 21 | #include <net/inet_frag.h> |
22 | 22 | ||
23 | #include <linux/netfilter_bridge.h> | ||
23 | #include <linux/netfilter_ipv6.h> | 24 | #include <linux/netfilter_ipv6.h> |
24 | #include <net/netfilter/nf_conntrack.h> | 25 | #include <net/netfilter/nf_conntrack.h> |
25 | #include <net/netfilter/nf_conntrack_helper.h> | 26 | #include <net/netfilter/nf_conntrack_helper.h> |
@@ -187,6 +188,21 @@ out: | |||
187 | return nf_conntrack_confirm(skb); | 188 | return nf_conntrack_confirm(skb); |
188 | } | 189 | } |
189 | 190 | ||
191 | static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum, | ||
192 | struct sk_buff *skb) | ||
193 | { | ||
194 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
195 | if (skb->nf_bridge && | ||
196 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) | ||
197 | return IP6_DEFRAG_CONNTRACK_BRIDGE_IN; | ||
198 | #endif | ||
199 | if (hooknum == NF_INET_PRE_ROUTING) | ||
200 | return IP6_DEFRAG_CONNTRACK_IN; | ||
201 | else | ||
202 | return IP6_DEFRAG_CONNTRACK_OUT; | ||
203 | |||
204 | } | ||
205 | |||
190 | static unsigned int ipv6_defrag(unsigned int hooknum, | 206 | static unsigned int ipv6_defrag(unsigned int hooknum, |
191 | struct sk_buff *skb, | 207 | struct sk_buff *skb, |
192 | const struct net_device *in, | 208 | const struct net_device *in, |
@@ -199,8 +215,7 @@ static unsigned int ipv6_defrag(unsigned int hooknum, | |||
199 | if (skb->nfct) | 215 | if (skb->nfct) |
200 | return NF_ACCEPT; | 216 | return NF_ACCEPT; |
201 | 217 | ||
202 | reasm = nf_ct_frag6_gather(skb); | 218 | reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb)); |
203 | |||
204 | /* queued */ | 219 | /* queued */ |
205 | if (reasm == NULL) | 220 | if (reasm == NULL) |
206 | return NF_STOLEN; | 221 | return NF_STOLEN; |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index e0b9424fa1b2..312c20adc83f 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -168,13 +168,14 @@ out: | |||
168 | /* Creation primitives. */ | 168 | /* Creation primitives. */ |
169 | 169 | ||
170 | static __inline__ struct nf_ct_frag6_queue * | 170 | static __inline__ struct nf_ct_frag6_queue * |
171 | fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst) | 171 | fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst) |
172 | { | 172 | { |
173 | struct inet_frag_queue *q; | 173 | struct inet_frag_queue *q; |
174 | struct ip6_create_arg arg; | 174 | struct ip6_create_arg arg; |
175 | unsigned int hash; | 175 | unsigned int hash; |
176 | 176 | ||
177 | arg.id = id; | 177 | arg.id = id; |
178 | arg.user = user; | ||
178 | arg.src = src; | 179 | arg.src = src; |
179 | arg.dst = dst; | 180 | arg.dst = dst; |
180 | 181 | ||
@@ -559,7 +560,7 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) | |||
559 | return 0; | 560 | return 0; |
560 | } | 561 | } |
561 | 562 | ||
562 | struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) | 563 | struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user) |
563 | { | 564 | { |
564 | struct sk_buff *clone; | 565 | struct sk_buff *clone; |
565 | struct net_device *dev = skb->dev; | 566 | struct net_device *dev = skb->dev; |
@@ -605,7 +606,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) | |||
605 | if (atomic_read(&nf_init_frags.mem) > nf_init_frags.high_thresh) | 606 | if (atomic_read(&nf_init_frags.mem) > nf_init_frags.high_thresh) |
606 | nf_ct_frag6_evictor(); | 607 | nf_ct_frag6_evictor(); |
607 | 608 | ||
608 | fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr); | 609 | fq = fq_find(fhdr->identification, user, &hdr->saddr, &hdr->daddr); |
609 | if (fq == NULL) { | 610 | if (fq == NULL) { |
610 | pr_debug("Can't find and can't create new queue\n"); | 611 | pr_debug("Can't find and can't create new queue\n"); |
611 | goto ret_orig; | 612 | goto ret_orig; |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 4d98549a6868..3b3a95607125 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -72,6 +72,7 @@ struct frag_queue | |||
72 | struct inet_frag_queue q; | 72 | struct inet_frag_queue q; |
73 | 73 | ||
74 | __be32 id; /* fragment id */ | 74 | __be32 id; /* fragment id */ |
75 | u32 user; | ||
75 | struct in6_addr saddr; | 76 | struct in6_addr saddr; |
76 | struct in6_addr daddr; | 77 | struct in6_addr daddr; |
77 | 78 | ||
@@ -141,7 +142,7 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a) | |||
141 | struct ip6_create_arg *arg = a; | 142 | struct ip6_create_arg *arg = a; |
142 | 143 | ||
143 | fq = container_of(q, struct frag_queue, q); | 144 | fq = container_of(q, struct frag_queue, q); |
144 | return (fq->id == arg->id && | 145 | return (fq->id == arg->id && fq->user == arg->user && |
145 | ipv6_addr_equal(&fq->saddr, arg->src) && | 146 | ipv6_addr_equal(&fq->saddr, arg->src) && |
146 | ipv6_addr_equal(&fq->daddr, arg->dst)); | 147 | ipv6_addr_equal(&fq->daddr, arg->dst)); |
147 | } | 148 | } |
@@ -163,6 +164,7 @@ void ip6_frag_init(struct inet_frag_queue *q, void *a) | |||
163 | struct ip6_create_arg *arg = a; | 164 | struct ip6_create_arg *arg = a; |
164 | 165 | ||
165 | fq->id = arg->id; | 166 | fq->id = arg->id; |
167 | fq->user = arg->user; | ||
166 | ipv6_addr_copy(&fq->saddr, arg->src); | 168 | ipv6_addr_copy(&fq->saddr, arg->src); |
167 | ipv6_addr_copy(&fq->daddr, arg->dst); | 169 | ipv6_addr_copy(&fq->daddr, arg->dst); |
168 | } | 170 | } |
@@ -243,6 +245,7 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, | |||
243 | unsigned int hash; | 245 | unsigned int hash; |
244 | 246 | ||
245 | arg.id = id; | 247 | arg.id = id; |
248 | arg.user = IP6_DEFRAG_LOCAL_DELIVER; | ||
246 | arg.src = src; | 249 | arg.src = src; |
247 | arg.dst = dst; | 250 | arg.dst = dst; |
248 | 251 | ||
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 5b9af508b8f2..7208a06576c6 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
@@ -185,6 +185,13 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
185 | 185 | ||
186 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); | 186 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); |
187 | 187 | ||
188 | /* check for timestamp cookie support */ | ||
189 | memset(&tcp_opt, 0, sizeof(tcp_opt)); | ||
190 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0); | ||
191 | |||
192 | if (tcp_opt.saw_tstamp) | ||
193 | cookie_check_timestamp(&tcp_opt); | ||
194 | |||
188 | ret = NULL; | 195 | ret = NULL; |
189 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); | 196 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); |
190 | if (!req) | 197 | if (!req) |
@@ -218,6 +225,12 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
218 | req->expires = 0UL; | 225 | req->expires = 0UL; |
219 | req->retrans = 0; | 226 | req->retrans = 0; |
220 | ireq->ecn_ok = 0; | 227 | ireq->ecn_ok = 0; |
228 | ireq->snd_wscale = tcp_opt.snd_wscale; | ||
229 | ireq->rcv_wscale = tcp_opt.rcv_wscale; | ||
230 | ireq->sack_ok = tcp_opt.sack_ok; | ||
231 | ireq->wscale_ok = tcp_opt.wscale_ok; | ||
232 | ireq->tstamp_ok = tcp_opt.saw_tstamp; | ||
233 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; | ||
221 | treq->rcv_isn = ntohl(th->seq) - 1; | 234 | treq->rcv_isn = ntohl(th->seq) - 1; |
222 | treq->snt_isn = cookie; | 235 | treq->snt_isn = cookie; |
223 | 236 | ||
@@ -253,21 +266,6 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
253 | goto out_free; | 266 | goto out_free; |
254 | } | 267 | } |
255 | 268 | ||
256 | /* check for timestamp cookie support */ | ||
257 | memset(&tcp_opt, 0, sizeof(tcp_opt)); | ||
258 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0, dst); | ||
259 | |||
260 | if (tcp_opt.saw_tstamp) | ||
261 | cookie_check_timestamp(&tcp_opt); | ||
262 | |||
263 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; | ||
264 | |||
265 | ireq->snd_wscale = tcp_opt.snd_wscale; | ||
266 | ireq->rcv_wscale = tcp_opt.rcv_wscale; | ||
267 | ireq->sack_ok = tcp_opt.sack_ok; | ||
268 | ireq->wscale_ok = tcp_opt.wscale_ok; | ||
269 | ireq->tstamp_ok = tcp_opt.saw_tstamp; | ||
270 | |||
271 | req->window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); | 269 | req->window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); |
272 | tcp_select_initial_window(tcp_full_space(sk), req->mss, | 270 | tcp_select_initial_window(tcp_full_space(sk), req->mss, |
273 | &req->rcv_wnd, &req->window_clamp, | 271 | &req->rcv_wnd, &req->window_clamp, |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index ee9cf62458d4..febfd595a40d 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1169,7 +1169,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1169 | struct inet6_request_sock *treq; | 1169 | struct inet6_request_sock *treq; |
1170 | struct ipv6_pinfo *np = inet6_sk(sk); | 1170 | struct ipv6_pinfo *np = inet6_sk(sk); |
1171 | struct tcp_sock *tp = tcp_sk(sk); | 1171 | struct tcp_sock *tp = tcp_sk(sk); |
1172 | struct dst_entry *dst = __sk_dst_get(sk); | ||
1173 | __u32 isn = TCP_SKB_CB(skb)->when; | 1172 | __u32 isn = TCP_SKB_CB(skb)->when; |
1174 | #ifdef CONFIG_SYN_COOKIES | 1173 | #ifdef CONFIG_SYN_COOKIES |
1175 | int want_cookie = 0; | 1174 | int want_cookie = 0; |
@@ -1208,7 +1207,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1208 | tcp_clear_options(&tmp_opt); | 1207 | tcp_clear_options(&tmp_opt); |
1209 | tmp_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr); | 1208 | tmp_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr); |
1210 | tmp_opt.user_mss = tp->rx_opt.user_mss; | 1209 | tmp_opt.user_mss = tp->rx_opt.user_mss; |
1211 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0, dst); | 1210 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0); |
1212 | 1211 | ||
1213 | if (tmp_opt.cookie_plus > 0 && | 1212 | if (tmp_opt.cookie_plus > 0 && |
1214 | tmp_opt.saw_tstamp && | 1213 | tmp_opt.saw_tstamp && |
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index b95699f00545..847ffca40184 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -1366,6 +1366,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, | |||
1366 | == sysctl_ip_vs_sync_threshold[0])) || | 1366 | == sysctl_ip_vs_sync_threshold[0])) || |
1367 | ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) && | 1367 | ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) && |
1368 | ((cp->state == IP_VS_TCP_S_FIN_WAIT) || | 1368 | ((cp->state == IP_VS_TCP_S_FIN_WAIT) || |
1369 | (cp->state == IP_VS_TCP_S_CLOSE) || | ||
1369 | (cp->state == IP_VS_TCP_S_CLOSE_WAIT) || | 1370 | (cp->state == IP_VS_TCP_S_CLOSE_WAIT) || |
1370 | (cp->state == IP_VS_TCP_S_TIME_WAIT))))) | 1371 | (cp->state == IP_VS_TCP_S_TIME_WAIT))))) |
1371 | ip_vs_sync_conn(cp); | 1372 | ip_vs_sync_conn(cp); |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index e55a6861d26f..6bde12da2fe0 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -2714,6 +2714,8 @@ static int ip_vs_genl_parse_service(struct ip_vs_service_user_kern *usvc, | |||
2714 | if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr)))) | 2714 | if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr)))) |
2715 | return -EINVAL; | 2715 | return -EINVAL; |
2716 | 2716 | ||
2717 | memset(usvc, 0, sizeof(*usvc)); | ||
2718 | |||
2717 | usvc->af = nla_get_u16(nla_af); | 2719 | usvc->af = nla_get_u16(nla_af); |
2718 | #ifdef CONFIG_IP_VS_IPV6 | 2720 | #ifdef CONFIG_IP_VS_IPV6 |
2719 | if (usvc->af != AF_INET && usvc->af != AF_INET6) | 2721 | if (usvc->af != AF_INET && usvc->af != AF_INET6) |
@@ -2901,6 +2903,8 @@ static int ip_vs_genl_parse_dest(struct ip_vs_dest_user_kern *udest, | |||
2901 | if (!(nla_addr && nla_port)) | 2903 | if (!(nla_addr && nla_port)) |
2902 | return -EINVAL; | 2904 | return -EINVAL; |
2903 | 2905 | ||
2906 | memset(udest, 0, sizeof(*udest)); | ||
2907 | |||
2904 | nla_memcpy(&udest->addr, nla_addr, sizeof(udest->addr)); | 2908 | nla_memcpy(&udest->addr, nla_addr, sizeof(udest->addr)); |
2905 | udest->port = nla_get_u16(nla_port); | 2909 | udest->port = nla_get_u16(nla_port); |
2906 | 2910 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 020562164b56..e0516a22be2e 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -415,7 +415,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, | |||
415 | { | 415 | { |
416 | struct sock *sk = sock->sk; | 416 | struct sock *sk = sock->sk; |
417 | struct sockaddr_pkt *saddr = (struct sockaddr_pkt *)msg->msg_name; | 417 | struct sockaddr_pkt *saddr = (struct sockaddr_pkt *)msg->msg_name; |
418 | struct sk_buff *skb; | 418 | struct sk_buff *skb = NULL; |
419 | struct net_device *dev; | 419 | struct net_device *dev; |
420 | __be16 proto = 0; | 420 | __be16 proto = 0; |
421 | int err; | 421 | int err; |
@@ -437,6 +437,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, | |||
437 | */ | 437 | */ |
438 | 438 | ||
439 | saddr->spkt_device[13] = 0; | 439 | saddr->spkt_device[13] = 0; |
440 | retry: | ||
440 | rcu_read_lock(); | 441 | rcu_read_lock(); |
441 | dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device); | 442 | dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device); |
442 | err = -ENODEV; | 443 | err = -ENODEV; |
@@ -456,58 +457,48 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, | |||
456 | if (len > dev->mtu + dev->hard_header_len) | 457 | if (len > dev->mtu + dev->hard_header_len) |
457 | goto out_unlock; | 458 | goto out_unlock; |
458 | 459 | ||
459 | err = -ENOBUFS; | 460 | if (!skb) { |
460 | skb = sock_wmalloc(sk, len + LL_RESERVED_SPACE(dev), 0, GFP_KERNEL); | 461 | size_t reserved = LL_RESERVED_SPACE(dev); |
461 | 462 | unsigned int hhlen = dev->header_ops ? dev->hard_header_len : 0; | |
462 | /* | 463 | |
463 | * If the write buffer is full, then tough. At this level the user | 464 | rcu_read_unlock(); |
464 | * gets to deal with the problem - do your own algorithmic backoffs. | 465 | skb = sock_wmalloc(sk, len + reserved, 0, GFP_KERNEL); |
465 | * That's far more flexible. | 466 | if (skb == NULL) |
466 | */ | 467 | return -ENOBUFS; |
467 | 468 | /* FIXME: Save some space for broken drivers that write a hard | |
468 | if (skb == NULL) | 469 | * header at transmission time by themselves. PPP is the notable |
469 | goto out_unlock; | 470 | * one here. This should really be fixed at the driver level. |
470 | 471 | */ | |
471 | /* | 472 | skb_reserve(skb, reserved); |
472 | * Fill it in | 473 | skb_reset_network_header(skb); |
473 | */ | 474 | |
474 | 475 | /* Try to align data part correctly */ | |
475 | /* FIXME: Save some space for broken drivers that write a | 476 | if (hhlen) { |
476 | * hard header at transmission time by themselves. PPP is the | 477 | skb->data -= hhlen; |
477 | * notable one here. This should really be fixed at the driver level. | 478 | skb->tail -= hhlen; |
478 | */ | 479 | if (len < hhlen) |
479 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 480 | skb_reset_network_header(skb); |
480 | skb_reset_network_header(skb); | 481 | } |
481 | 482 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | |
482 | /* Try to align data part correctly */ | 483 | if (err) |
483 | if (dev->header_ops) { | 484 | goto out_free; |
484 | skb->data -= dev->hard_header_len; | 485 | goto retry; |
485 | skb->tail -= dev->hard_header_len; | ||
486 | if (len < dev->hard_header_len) | ||
487 | skb_reset_network_header(skb); | ||
488 | } | 486 | } |
489 | 487 | ||
490 | /* Returns -EFAULT on error */ | 488 | |
491 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | ||
492 | skb->protocol = proto; | 489 | skb->protocol = proto; |
493 | skb->dev = dev; | 490 | skb->dev = dev; |
494 | skb->priority = sk->sk_priority; | 491 | skb->priority = sk->sk_priority; |
495 | skb->mark = sk->sk_mark; | 492 | skb->mark = sk->sk_mark; |
496 | if (err) | ||
497 | goto out_free; | ||
498 | |||
499 | /* | ||
500 | * Now send it | ||
501 | */ | ||
502 | 493 | ||
503 | dev_queue_xmit(skb); | 494 | dev_queue_xmit(skb); |
504 | rcu_read_unlock(); | 495 | rcu_read_unlock(); |
505 | return len; | 496 | return len; |
506 | 497 | ||
507 | out_free: | ||
508 | kfree_skb(skb); | ||
509 | out_unlock: | 498 | out_unlock: |
510 | rcu_read_unlock(); | 499 | rcu_read_unlock(); |
500 | out_free: | ||
501 | kfree_skb(skb); | ||
511 | return err; | 502 | return err; |
512 | } | 503 | } |
513 | 504 | ||