From: Jiri Pirko <jpirko@redhat.com> Date: Tue, 28 Apr 2009 15:30:05 +0200 Subject: [net] bonding: ignore updelay param when no active slave Message-id: 20090428133005.GF338@psychotron.englab.brq.redhat.com O-Subject: [RHEL5.5 patch] BZ495318 net: bonding: ignore updelay param when there is no active slave Bugzilla: 495318 RH-Acked-by: David Miller <davem@redhat.com> RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: Thomas Graf <tgraf@redhat.com> BZ495318 https://bugzilla.redhat.com/show_bug.cgi?id=495318 Description: 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. Note that this patch applies after Andy's bonding driver update patch: http://post-office.corp.redhat.com/archives/rhkernel-list/2009-April/msg01231.html Upstream: http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=41f8910040639eb106b1a5b5301aab79ecde4940 Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=1778532 Test: Booted and tested on x86_64. Works as expected. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d7bb5a6..d1accec 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2287,6 +2287,9 @@ static int bond_miimon_inspect(struct bonding *bond) { struct slave *slave; int i, link_state, commit = 0; + bool ignore_updelay; + + ignore_updelay = !bond->curr_active_slave ? true : false; bond_for_each_slave(bond, slave, i) { slave->new_link = BOND_LINK_NOCHANGE; @@ -2351,6 +2354,7 @@ static int bond_miimon_inspect(struct bonding *bond) ": %s: link status up for " "interface %s, enabling it in %d ms.\n", bond->dev->name, slave->dev->name, + ignore_updelay ? 0 : bond->params.updelay * bond->params.miimon); } @@ -2369,9 +2373,13 @@ static int bond_miimon_inspect(struct bonding *bond) continue; } + if (ignore_updelay) + slave->delay = 0; + if (slave->delay <= 0) { slave->new_link = BOND_LINK_UP; commit++; + ignore_updelay = false; continue; }