aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2009-04-23 23:57:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-27 05:57:44 -0400
commit41f8910040639eb106b1a5b5301aab79ecde4940 (patch)
treee87ed3d7c858f1ebb00cfd5c5159da31ffc0af44 /drivers
parent29112f4e248ca6941f2233f6ed96a7283a67cced (diff)
bonding: ignore updelay param when there is no active slave
Pointed out by Sean E. Millichamp. Quote from Documentation/networking/bonding.txt: "Note that when a bonding interface has no active links, the driver will immediately reuse the first link that goes up, even if the updelay parameter has been specified (the updelay is ignored in this case). If there are slave interfaces waiting for the updelay timeout to expire, the interface that first went into that state will be immediately reused. This reduces down time of the network if the value of updelay has been overestimated, and since this occurs only in cases with no connectivity, there is no additional penalty for ignoring the updelay." This patch actually changes the behaviour in this way. Signed-off-by: Jiri Pirko <jpirko@redhat.com> drivers/net/bonding/bond_main.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bond_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e4166ee9091d..fd738367d740 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2247,6 +2247,9 @@ static int bond_miimon_inspect(struct bonding *bond)
2247{ 2247{
2248 struct slave *slave; 2248 struct slave *slave;
2249 int i, link_state, commit = 0; 2249 int i, link_state, commit = 0;
2250 bool ignore_updelay;
2251
2252 ignore_updelay = !bond->curr_active_slave ? true : false;
2250 2253
2251 bond_for_each_slave(bond, slave, i) { 2254 bond_for_each_slave(bond, slave, i) {
2252 slave->new_link = BOND_LINK_NOCHANGE; 2255 slave->new_link = BOND_LINK_NOCHANGE;
@@ -2311,6 +2314,7 @@ static int bond_miimon_inspect(struct bonding *bond)
2311 ": %s: link status up for " 2314 ": %s: link status up for "
2312 "interface %s, enabling it in %d ms.\n", 2315 "interface %s, enabling it in %d ms.\n",
2313 bond->dev->name, slave->dev->name, 2316 bond->dev->name, slave->dev->name,
2317 ignore_updelay ? 0 :
2314 bond->params.updelay * 2318 bond->params.updelay *
2315 bond->params.miimon); 2319 bond->params.miimon);
2316 } 2320 }
@@ -2329,9 +2333,13 @@ static int bond_miimon_inspect(struct bonding *bond)
2329 continue; 2333 continue;
2330 } 2334 }
2331 2335
2336 if (ignore_updelay)
2337 slave->delay = 0;
2338
2332 if (slave->delay <= 0) { 2339 if (slave->delay <= 0) {
2333 slave->new_link = BOND_LINK_UP; 2340 slave->new_link = BOND_LINK_UP;
2334 commit++; 2341 commit++;
2342 ignore_updelay = false;
2335 continue; 2343 continue;
2336 } 2344 }
2337 2345