From: "Ed L. Cashin" <ecashin@coraid.com>
To: linux-kernel@vger.kernel.org
Cc: ecashin@coraid.com, Greg K-H <greg@kroah.com>
Subject: [PATCH 2.6.18-rc4] aoe [08/14]: improve retransmission heuristics
Date: Wed, 20 Sep 2006 14:36:49 -0400 [thread overview]
Message-ID: <d6ba381475dfbe91dd8bfcfb12a98413@coraid.com> (raw)
In-Reply-To: E1GQ6uv-0001qi-00@kokone
Add a dynamic minimum timer for better retransmission behavior.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
@@ -125,8 +125,10 @@ struct aoedev {
ulong sysminor;
ulong aoemajor;
ulong aoeminor;
- ulong nopen; /* (bd_openers isn't available without sleeping) */
- ulong rttavg; /* round trip average of requests/responses */
+ u16 nopen; /* (bd_openers isn't available without sleeping) */
+ u16 lasttag; /* last tag sent */
+ u16 rttavg; /* round trip average of requests/responses */
+ u16 mintimer;
u16 fw_ver; /* version of blade's firmware */
u16 maxbcnt;
struct work_struct work;/* disk create work struct */
@@ -142,7 +144,6 @@ struct aoedev {
mempool_t *bufpool; /* for deadlock-free Buf allocation */
struct list_head bufq; /* queue of bios to work on */
struct buf *inprocess; /* the one we're currently working on */
- ulong lasttag; /* last tag sent */
ushort lostjumbo;
ushort nframes; /* number of frames below */
struct frame *frames;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -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 */
--
"Ed L. Cashin" <ecashin@coraid.com>
next prev parent reply other threads:[~2006-09-20 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1GQ6uv-0001qi-00@kokone>
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [02/14]: update copyright date Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [03/14]: remove unused NARGS enum Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [05/14]: jumbo frame support 1 of 2 Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [06/14]: clean up printks via macros Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [04/14]: zero copy write 1 of 2 Ed L. Cashin
2006-09-20 18:36 ` Ed L. Cashin [this message]
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [09/14]: zero copy write 2 " Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [07/14]: jumbo frame support " Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [10/14]: module parameter for device timeout Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [11/14]: use bio->bi_idx Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [14/14]: revert printk macros Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [12/14]: remove sysfs comment Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [13/14]: update driver version Ed L. Cashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d6ba381475dfbe91dd8bfcfb12a98413@coraid.com \
--to=ecashin@coraid.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox