aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c106
1 files changed, 47 insertions, 59 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d2f34d5a8083..f3f5825469d6 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -18,38 +18,6 @@
18 * The full GNU General Public License is included in this distribution in the 18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE. 19 * file called LICENSE.
20 * 20 *
21 *
22 * Changes:
23 *
24 * 2003/05/01 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
25 * Amir Noam <amir.noam at intel dot com>
26 * - Added support for lacp_rate module param.
27 *
28 * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
29 * - Based on discussion on mailing list, changed locking scheme
30 * to use lock/unlock or lock_bh/unlock_bh appropriately instead
31 * of lock_irqsave/unlock_irqrestore. The new scheme helps exposing
32 * hidden bugs and solves system hangs that occurred due to the fact
33 * that holding lock_irqsave doesn't prevent softirqs from running.
34 * This also increases total throughput since interrupts are not
35 * blocked on each transmitted packets or monitor timeout.
36 *
37 * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
38 * - Renamed bond_3ad_link_status_changed() to
39 * bond_3ad_handle_link_change() for compatibility with TLB.
40 *
41 * 2003/05/20 - Amir Noam <amir.noam at intel dot com>
42 * - Fix long fail over time when releasing last slave of an active
43 * aggregator - send LACPDU on unbind of slave to tell partner this
44 * port is no longer aggregatable.
45 *
46 * 2003/06/25 - Tsippy Mendelson <tsippy.mendelson at intel dot com>
47 * - Send LACPDU as highest priority packet to further fix the above
48 * problem on very high Tx traffic load where packets may get dropped
49 * by the slave.
50 *
51 * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
52 * - Code cleanup and style changes
53 */ 21 */
54 22
55//#define BONDING_DEBUG 1 23//#define BONDING_DEBUG 1
@@ -1198,10 +1166,10 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1198 // detect loopback situation 1166 // detect loopback situation
1199 if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { 1167 if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) {
1200 // INFO_RECEIVED_LOOPBACK_FRAMES 1168 // INFO_RECEIVED_LOOPBACK_FRAMES
1201 printk(KERN_ERR DRV_NAME ": An illegal loopback occurred on adapter (%s)\n", 1169 printk(KERN_ERR DRV_NAME ": %s: An illegal loopback occurred on "
1202 port->slave->dev->name); 1170 "adapter (%s). Check the configuration to verify that all "
1203 printk(KERN_ERR "Check the configuration to verify that all Adapters " 1171 "Adapters are connected to 802.3ad compliant switch ports\n",
1204 "are connected to 802.3ad compliant switch ports\n"); 1172 port->slave->dev->master->name, port->slave->dev->name);
1205 __release_rx_machine_lock(port); 1173 __release_rx_machine_lock(port);
1206 return; 1174 return;
1207 } 1175 }
@@ -1378,8 +1346,9 @@ static void ad_port_selection_logic(struct port *port)
1378 } 1346 }
1379 } 1347 }
1380 if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list 1348 if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list
1381 printk(KERN_WARNING DRV_NAME ": Warning: Port %d (on %s) was " 1349 printk(KERN_WARNING DRV_NAME ": %s: Warning: Port %d (on %s) was "
1382 "related to aggregator %d but was not on its port list\n", 1350 "related to aggregator %d but was not on its port list\n",
1351 port->slave->dev->master->name,
1383 port->actor_port_number, port->slave->dev->name, 1352 port->actor_port_number, port->slave->dev->name,
1384 port->aggregator->aggregator_identifier); 1353 port->aggregator->aggregator_identifier);
1385 } 1354 }
@@ -1450,7 +1419,8 @@ static void ad_port_selection_logic(struct port *port)
1450 1419
1451 dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); 1420 dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);
1452 } else { 1421 } else {
1453 printk(KERN_ERR DRV_NAME ": Port %d (on %s) did not find a suitable aggregator\n", 1422 printk(KERN_ERR DRV_NAME ": %s: Port %d (on %s) did not find a suitable aggregator\n",
1423 port->slave->dev->master->name,
1454 port->actor_port_number, port->slave->dev->name); 1424 port->actor_port_number, port->slave->dev->name);
1455 } 1425 }
1456 } 1426 }
@@ -1582,8 +1552,9 @@ static void ad_agg_selection_logic(struct aggregator *aggregator)
1582 1552
1583 // check if any partner replys 1553 // check if any partner replys
1584 if (best_aggregator->is_individual) { 1554 if (best_aggregator->is_individual) {
1585 printk(KERN_WARNING DRV_NAME ": Warning: No 802.3ad response from the link partner " 1555 printk(KERN_WARNING DRV_NAME ": %s: Warning: No 802.3ad response from "
1586 "for any adapters in the bond\n"); 1556 "the link partner for any adapters in the bond\n",
1557 best_aggregator->slave->dev->master->name);
1587 } 1558 }
1588 1559
1589 // check if there are more than one aggregator 1560 // check if there are more than one aggregator
@@ -1915,7 +1886,8 @@ int bond_3ad_bind_slave(struct slave *slave)
1915 struct aggregator *aggregator; 1886 struct aggregator *aggregator;
1916 1887
1917 if (bond == NULL) { 1888 if (bond == NULL) {
1918 printk(KERN_ERR "The slave %s is not attached to its bond\n", slave->dev->name); 1889 printk(KERN_ERR DRV_NAME ": %s: The slave %s is not attached to its bond\n",
1890 slave->dev->master->name, slave->dev->name);
1919 return -1; 1891 return -1;
1920 } 1892 }
1921 1893
@@ -1990,7 +1962,9 @@ void bond_3ad_unbind_slave(struct slave *slave)
1990 1962
1991 // if slave is null, the whole port is not initialized 1963 // if slave is null, the whole port is not initialized
1992 if (!port->slave) { 1964 if (!port->slave) {
1993 printk(KERN_WARNING DRV_NAME ": Trying to unbind an uninitialized port on %s\n", slave->dev->name); 1965 printk(KERN_WARNING DRV_NAME ": Warning: %s: Trying to "
1966 "unbind an uninitialized port on %s\n",
1967 slave->dev->master->name, slave->dev->name);
1994 return; 1968 return;
1995 } 1969 }
1996 1970
@@ -2021,7 +1995,8 @@ void bond_3ad_unbind_slave(struct slave *slave)
2021 dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); 1995 dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier);
2022 1996
2023 if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { 1997 if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {
2024 printk(KERN_INFO DRV_NAME ": Removing an active aggregator\n"); 1998 printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n",
1999 aggregator->slave->dev->master->name);
2025 // select new active aggregator 2000 // select new active aggregator
2026 select_new_active_agg = 1; 2001 select_new_active_agg = 1;
2027 } 2002 }
@@ -2051,15 +2026,17 @@ void bond_3ad_unbind_slave(struct slave *slave)
2051 ad_agg_selection_logic(__get_first_agg(port)); 2026 ad_agg_selection_logic(__get_first_agg(port));
2052 } 2027 }
2053 } else { 2028 } else {
2054 printk(KERN_WARNING DRV_NAME ": Warning: unbinding aggregator, " 2029 printk(KERN_WARNING DRV_NAME ": %s: Warning: unbinding aggregator, "
2055 "and could not find a new aggregator for its ports\n"); 2030 "and could not find a new aggregator for its ports\n",
2031 slave->dev->master->name);
2056 } 2032 }
2057 } else { // in case that the only port related to this aggregator is the one we want to remove 2033 } else { // in case that the only port related to this aggregator is the one we want to remove
2058 select_new_active_agg = aggregator->is_active; 2034 select_new_active_agg = aggregator->is_active;
2059 // clear the aggregator 2035 // clear the aggregator
2060 ad_clear_agg(aggregator); 2036 ad_clear_agg(aggregator);
2061 if (select_new_active_agg) { 2037 if (select_new_active_agg) {
2062 printk(KERN_INFO "Removing an active aggregator\n"); 2038 printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n",
2039 slave->dev->master->name);
2063 // select new active aggregator 2040 // select new active aggregator
2064 ad_agg_selection_logic(__get_first_agg(port)); 2041 ad_agg_selection_logic(__get_first_agg(port));
2065 } 2042 }
@@ -2085,7 +2062,8 @@ void bond_3ad_unbind_slave(struct slave *slave)
2085 // clear the aggregator 2062 // clear the aggregator
2086 ad_clear_agg(temp_aggregator); 2063 ad_clear_agg(temp_aggregator);
2087 if (select_new_active_agg) { 2064 if (select_new_active_agg) {
2088 printk(KERN_INFO "Removing an active aggregator\n"); 2065 printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n",
2066 slave->dev->master->name);
2089 // select new active aggregator 2067 // select new active aggregator
2090 ad_agg_selection_logic(__get_first_agg(port)); 2068 ad_agg_selection_logic(__get_first_agg(port));
2091 } 2069 }
@@ -2131,7 +2109,8 @@ void bond_3ad_state_machine_handler(struct bonding *bond)
2131 // select the active aggregator for the bond 2109 // select the active aggregator for the bond
2132 if ((port = __get_first_port(bond))) { 2110 if ((port = __get_first_port(bond))) {
2133 if (!port->slave) { 2111 if (!port->slave) {
2134 printk(KERN_WARNING DRV_NAME ": Warning: bond's first port is uninitialized\n"); 2112 printk(KERN_WARNING DRV_NAME ": %s: Warning: bond's first port is "
2113 "uninitialized\n", bond->dev->name);
2135 goto re_arm; 2114 goto re_arm;
2136 } 2115 }
2137 2116
@@ -2143,7 +2122,8 @@ void bond_3ad_state_machine_handler(struct bonding *bond)
2143 // for each port run the state machines 2122 // for each port run the state machines
2144 for (port = __get_first_port(bond); port; port = __get_next_port(port)) { 2123 for (port = __get_first_port(bond); port; port = __get_next_port(port)) {
2145 if (!port->slave) { 2124 if (!port->slave) {
2146 printk(KERN_WARNING DRV_NAME ": Warning: Found an uninitialized port\n"); 2125 printk(KERN_WARNING DRV_NAME ": %s: Warning: Found an uninitialized "
2126 "port\n", bond->dev->name);
2147 goto re_arm; 2127 goto re_arm;
2148 } 2128 }
2149 2129
@@ -2184,7 +2164,8 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2184 port = &(SLAVE_AD_INFO(slave).port); 2164 port = &(SLAVE_AD_INFO(slave).port);
2185 2165
2186 if (!port->slave) { 2166 if (!port->slave) {
2187 printk(KERN_WARNING DRV_NAME ": Warning: port of slave %s is uninitialized\n", slave->dev->name); 2167 printk(KERN_WARNING DRV_NAME ": %s: Warning: port of slave %s is "
2168 "uninitialized\n", slave->dev->name, slave->dev->master->name);
2188 return; 2169 return;
2189 } 2170 }
2190 2171
@@ -2230,8 +2211,9 @@ void bond_3ad_adapter_speed_changed(struct slave *slave)
2230 2211
2231 // if slave is null, the whole port is not initialized 2212 // if slave is null, the whole port is not initialized
2232 if (!port->slave) { 2213 if (!port->slave) {
2233 printk(KERN_WARNING DRV_NAME ": Warning: speed changed for uninitialized port on %s\n", 2214 printk(KERN_WARNING DRV_NAME ": Warning: %s: speed "
2234 slave->dev->name); 2215 "changed for uninitialized port on %s\n",
2216 slave->dev->master->name, slave->dev->name);
2235 return; 2217 return;
2236 } 2218 }
2237 2219
@@ -2257,8 +2239,9 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
2257 2239
2258 // if slave is null, the whole port is not initialized 2240 // if slave is null, the whole port is not initialized
2259 if (!port->slave) { 2241 if (!port->slave) {
2260 printk(KERN_WARNING DRV_NAME ": Warning: duplex changed for uninitialized port on %s\n", 2242 printk(KERN_WARNING DRV_NAME ": %s: Warning: duplex changed "
2261 slave->dev->name); 2243 "for uninitialized port on %s\n",
2244 slave->dev->master->name, slave->dev->name);
2262 return; 2245 return;
2263 } 2246 }
2264 2247
@@ -2285,8 +2268,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
2285 2268
2286 // if slave is null, the whole port is not initialized 2269 // if slave is null, the whole port is not initialized
2287 if (!port->slave) { 2270 if (!port->slave) {
2288 printk(KERN_WARNING DRV_NAME ": Warning: link status changed for uninitialized port on %s\n", 2271 printk(KERN_WARNING DRV_NAME ": Warning: %s: link status changed for "
2289 slave->dev->name); 2272 "uninitialized port on %s\n",
2273 slave->dev->master->name, slave->dev->name);
2290 return; 2274 return;
2291 } 2275 }
2292 2276
@@ -2363,7 +2347,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2363 } 2347 }
2364 2348
2365 if (bond_3ad_get_active_agg_info(bond, &ad_info)) { 2349 if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
2366 printk(KERN_DEBUG "ERROR: bond_3ad_get_active_agg_info failed\n"); 2350 printk(KERN_DEBUG DRV_NAME ": %s: Error: "
2351 "bond_3ad_get_active_agg_info failed\n", dev->name);
2367 goto out; 2352 goto out;
2368 } 2353 }
2369 2354
@@ -2372,7 +2357,9 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2372 2357
2373 if (slaves_in_agg == 0) { 2358 if (slaves_in_agg == 0) {
2374 /*the aggregator is empty*/ 2359 /*the aggregator is empty*/
2375 printk(KERN_DEBUG "ERROR: active aggregator is empty\n"); 2360 printk(KERN_DEBUG DRV_NAME ": %s: Error: active "
2361 "aggregator is empty\n",
2362 dev->name);
2376 goto out; 2363 goto out;
2377 } 2364 }
2378 2365
@@ -2390,7 +2377,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2390 } 2377 }
2391 2378
2392 if (slave_agg_no >= 0) { 2379 if (slave_agg_no >= 0) {
2393 printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id); 2380 printk(KERN_ERR DRV_NAME ": %s: Error: Couldn't find a slave to tx on "
2381 "for aggregator ID %d\n", dev->name, agg_id);
2394 goto out; 2382 goto out;
2395 } 2383 }
2396 2384