diff options
author | Ed L. Cashin <ecashin@coraid.com> | 2006-09-20 14:36:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-18 15:53:50 -0400 |
commit | dced3a053dd5415a7321e1ae153c96dea644da4e (patch) | |
tree | effc221b2b7b2f2cb39996ed834c279ce409e7e7 /drivers/block | |
parent | ddec63e86752b89776547e93aa68af01f1cbb10c (diff) |
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 'drivers/block')
-rw-r--r-- | drivers/block/aoe/aoe.h | 7 | ||||
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 16 |
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index 4d79f1eaf708..7b1121748633 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -125,8 +125,10 @@ struct aoedev { | |||
125 | ulong sysminor; | 125 | ulong sysminor; |
126 | ulong aoemajor; | 126 | ulong aoemajor; |
127 | ulong aoeminor; | 127 | ulong aoeminor; |
128 | ulong nopen; /* (bd_openers isn't available without sleeping) */ | 128 | u16 nopen; /* (bd_openers isn't available without sleeping) */ |
129 | ulong rttavg; /* round trip average of requests/responses */ | 129 | u16 lasttag; /* last tag sent */ |
130 | u16 rttavg; /* round trip average of requests/responses */ | ||
131 | u16 mintimer; | ||
130 | u16 fw_ver; /* version of blade's firmware */ | 132 | u16 fw_ver; /* version of blade's firmware */ |
131 | u16 maxbcnt; | 133 | u16 maxbcnt; |
132 | struct work_struct work;/* disk create work struct */ | 134 | struct work_struct work;/* disk create work struct */ |
@@ -142,7 +144,6 @@ struct aoedev { | |||
142 | mempool_t *bufpool; /* for deadlock-free Buf allocation */ | 144 | mempool_t *bufpool; /* for deadlock-free Buf allocation */ |
143 | struct list_head bufq; /* queue of bios to work on */ | 145 | struct list_head bufq; /* queue of bios to work on */ |
144 | struct buf *inprocess; /* the one we're currently working on */ | 146 | struct buf *inprocess; /* the one we're currently working on */ |
145 | ulong lasttag; /* last tag sent */ | ||
146 | ushort lostjumbo; | 147 | ushort lostjumbo; |
147 | ushort nframes; /* number of frames below */ | 148 | ushort nframes; /* number of frames below */ |
148 | struct frame *frames; | 149 | struct frame *frames; |
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) | |||
461 | register long n; | 461 | register long n; |
462 | 462 | ||
463 | n = rtt; | 463 | n = rtt; |
464 | if (n < MINTIMER) | 464 | if (n < 0) { |
465 | n = MINTIMER; | 465 | n = -rtt; |
466 | if (n < MINTIMER) | ||
467 | n = MINTIMER; | ||
468 | else if (n > MAXTIMER) | ||
469 | n = MAXTIMER; | ||
470 | d->mintimer += (n - d->mintimer) >> 1; | ||
471 | } else if (n < d->mintimer) | ||
472 | n = d->mintimer; | ||
466 | else if (n > MAXTIMER) | 473 | else if (n > MAXTIMER) |
467 | n = MAXTIMER; | 474 | n = MAXTIMER; |
468 | 475 | ||
@@ -498,8 +505,10 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
498 | 505 | ||
499 | spin_lock_irqsave(&d->lock, flags); | 506 | spin_lock_irqsave(&d->lock, flags); |
500 | 507 | ||
501 | f = getframe(d, be32_to_cpu(hin->tag)); | 508 | n = be32_to_cpu(hin->tag); |
509 | f = getframe(d, n); | ||
502 | if (f == NULL) { | 510 | if (f == NULL) { |
511 | calc_rttavg(d, -tsince(n)); | ||
503 | spin_unlock_irqrestore(&d->lock, flags); | 512 | spin_unlock_irqrestore(&d->lock, flags); |
504 | snprintf(ebuf, sizeof ebuf, | 513 | snprintf(ebuf, sizeof ebuf, |
505 | "%15s e%d.%d tag=%08x@%08lx\n", | 514 | "%15s e%d.%d tag=%08x@%08lx\n", |
@@ -724,6 +733,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
724 | return; | 733 | return; |
725 | } | 734 | } |
726 | d->flags |= DEVFL_PAUSE; /* force pause */ | 735 | d->flags |= DEVFL_PAUSE; /* force pause */ |
736 | d->mintimer = MINTIMER; | ||
727 | d->fw_ver = be16_to_cpu(ch->fwver); | 737 | d->fw_ver = be16_to_cpu(ch->fwver); |
728 | 738 | ||
729 | /* check for already outstanding ataid */ | 739 | /* check for already outstanding ataid */ |