summaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoecmd.c
diff options
context:
space:
mode:
authorEd L. Cashin <ecashin@coraid.com>2006-09-20 20:36:49 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-18 21:53:50 +0200
commitdced3a053dd5415a7321e1ae153c96dea644da4e (patch)
treeeffc221b2b7b2f2cb39996ed834c279ce409e7e7 /drivers/block/aoe/aoecmd.c
parentaoe: jumbo frame support 2 of 2 (diff)
downloadlinux-dced3a053dd5415a7321e1ae153c96dea644da4e.tar.xz
linux-dced3a053dd5415a7321e1ae153c96dea644da4e.zip
aoe: improve retransmission heuristics
Add a dynamic minimum timer for better retransmission behavior. Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to '')
-rw-r--r--drivers/block/aoe/aoecmd.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 621fdbbc4cd4..c0bdc1fe21f0 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -461,8 +461,15 @@ calc_rttavg(struct aoedev *d, int rtt)
register long n;
n = rtt;
- if (n < MINTIMER)
- n = MINTIMER;
+ if (n < 0) {
+ n = -rtt;
+ if (n < MINTIMER)
+ n = MINTIMER;
+ else if (n > MAXTIMER)
+ n = MAXTIMER;
+ d->mintimer += (n - d->mintimer) >> 1;
+ } else if (n < d->mintimer)
+ n = d->mintimer;
else if (n > MAXTIMER)
n = MAXTIMER;
@@ -498,8 +505,10 @@ aoecmd_ata_rsp(struct sk_buff *skb)
spin_lock_irqsave(&d->lock, flags);
- f = getframe(d, be32_to_cpu(hin->tag));
+ n = be32_to_cpu(hin->tag);
+ f = getframe(d, n);
if (f == NULL) {
+ calc_rttavg(d, -tsince(n));
spin_unlock_irqrestore(&d->lock, flags);
snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n",
@@ -724,6 +733,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
return;
}
d->flags |= DEVFL_PAUSE; /* force pause */
+ d->mintimer = MINTIMER;
d->fw_ver = be16_to_cpu(ch->fwver);
/* check for already outstanding ataid */