From: Ed Cashin Date: Fri, 7 Sep 2012 00:25:11 +0000 (+1000) Subject: aoe: failover remote interface based on aoe_deadsecs parameter X-Git-Tag: next-20120907~1^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=260e63269123057d398e49214b1767e29342a1f0;p=karo-tx-linux.git aoe: failover remote interface based on aoe_deadsecs parameter The aoe_deadsecs module parameter allows the user to specify a hard limit on the number of seconds an AoE command can be retransmitted before the AoE block device is considered to have failed. Using aoe_deadsecs to determine the time we try using a different remote interface helps to ensure that the hard limit is not reached before we've tried to recover by sending to a different remote port. As a data storage target, the AoE target is unambiguously identified by its {major, minor} AoE address tuple, and an AoE target can have multiple MAC addresses. However, note that "target" in the driver code and comments means a {major, minor, MAC address} tuple, as in "somewhere to send packets". Signed-off-by: Ed Cashin Signed-off-by: Andrew Morton --- diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index ffded64dcbeb..d17b72763973 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h @@ -96,7 +96,6 @@ enum { TIMERTICK = HZ / 10, MINTIMER = HZ >> 2, MAXTIMER = HZ << 1, - HELPWAIT = 20, }; struct buf { diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index cf196eddc8e2..7f9cc44c9274 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -632,11 +632,9 @@ rexmit_timer(ulong vp) list_del(pos); t = f->t; - if (n > HELPWAIT) { - /* see if another target can help */ - if (d->ntargets > 1) - d->htgt = t; - } + if (n > aoe_deadsecs/2) + d->htgt = t; /* see if another target can help */ + if (t->nout == t->maxout) { if (t->maxout > 1) t->maxout--;