Skip to content

Commit 41f8910

Browse files
Jiri Pirkodavem330
authored andcommitted
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 <[email protected]> drivers/net/bonding/bond_main.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) Signed-off-by: David S. Miller <[email protected]>
1 parent 29112f4 commit 41f8910

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,9 @@ static int bond_miimon_inspect(struct bonding *bond)
22472247
{
22482248
struct slave *slave;
22492249
int i, link_state, commit = 0;
2250+
bool ignore_updelay;
2251+
2252+
ignore_updelay = !bond->curr_active_slave ? true : false;
22502253

22512254
bond_for_each_slave(bond, slave, i) {
22522255
slave->new_link = BOND_LINK_NOCHANGE;
@@ -2311,6 +2314,7 @@ static int bond_miimon_inspect(struct bonding *bond)
23112314
": %s: link status up for "
23122315
"interface %s, enabling it in %d ms.\n",
23132316
bond->dev->name, slave->dev->name,
2317+
ignore_updelay ? 0 :
23142318
bond->params.updelay *
23152319
bond->params.miimon);
23162320
}
@@ -2329,9 +2333,13 @@ static int bond_miimon_inspect(struct bonding *bond)
23292333
continue;
23302334
}
23312335

2336+
if (ignore_updelay)
2337+
slave->delay = 0;
2338+
23322339
if (slave->delay <= 0) {
23332340
slave->new_link = BOND_LINK_UP;
23342341
commit++;
2342+
ignore_updelay = false;
23352343
continue;
23362344
}
23372345

0 commit comments

Comments
 (0)