From 52c7bbd0ccdb77143f781b57989f4fe700497c31 Mon Sep 17 00:00:00 2001 From: Ed Cashin Date: Thu, 25 Oct 2012 12:15:21 +1100 Subject: [PATCH] aoe: update cap on outstanding commands based on config query response The ATA over Ethernet config query response contains a "buffer count" field reflecting the AoE target's capacity to buffer incoming AoE commands. By taking the current value of this field into accound, we increase performance throughput or avoid network congestion, when the value has increased or decreased, respectively. Signed-off-by: Ed Cashin Signed-off-by: Andrew Morton --- drivers/block/aoe/aoe.h | 6 +++--- drivers/block/aoe/aoecmd.c | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index d2ed7f18d1ac..52f75c097242 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h @@ -122,14 +122,14 @@ struct aoeif { struct aoetgt { unsigned char addr[6]; - ushort nframes; + ushort nframes; /* cap on frames to use */ struct aoedev *d; /* parent device I belong to */ struct list_head ffree; /* list of free frames */ struct aoeif ifs[NAOEIFS]; struct aoeif *ifp; /* current aoeif in use */ ushort nout; - ushort maxout; - ulong falloc; + ushort maxout; /* current value for max outstanding */ + ulong falloc; /* number of allocated frames */ ulong lastwadj; /* last window adjustment */ int minbcnt; int wpkts, rpkts; diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 3804a0af3ef1..2bb8c7d3d617 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1373,7 +1373,11 @@ aoecmd_cfg_rsp(struct sk_buff *skb) spin_lock_irqsave(&d->lock, flags); t = gettgt(d, h->src); - if (!t) { + if (t) { + t->nframes = n; + if (n < t->maxout) + t->maxout = n; + } else { t = addtgt(d, h->src, n); if (!t) goto bail; -- 2.39.5