Commit 41f89100 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

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: default avatarJiri Pirko <jpirko@redhat.com>

 drivers/net/bonding/bond_main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29112f4e
...@@ -2247,6 +2247,9 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2247,6 +2247,9 @@ static int bond_miimon_inspect(struct bonding *bond)
{ {
struct slave *slave; struct slave *slave;
int i, link_state, commit = 0; int i, link_state, commit = 0;
bool ignore_updelay;
ignore_updelay = !bond->curr_active_slave ? true : false;
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
slave->new_link = BOND_LINK_NOCHANGE; slave->new_link = BOND_LINK_NOCHANGE;
...@@ -2311,6 +2314,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2311,6 +2314,7 @@ static int bond_miimon_inspect(struct bonding *bond)
": %s: link status up for " ": %s: link status up for "
"interface %s, enabling it in %d ms.\n", "interface %s, enabling it in %d ms.\n",
bond->dev->name, slave->dev->name, bond->dev->name, slave->dev->name,
ignore_updelay ? 0 :
bond->params.updelay * bond->params.updelay *
bond->params.miimon); bond->params.miimon);
} }
...@@ -2329,9 +2333,13 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2329,9 +2333,13 @@ static int bond_miimon_inspect(struct bonding *bond)
continue; continue;
} }
if (ignore_updelay)
slave->delay = 0;
if (slave->delay <= 0) { if (slave->delay <= 0) {
slave->new_link = BOND_LINK_UP; slave->new_link = BOND_LINK_UP;
commit++; commit++;
ignore_updelay = false;
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment