]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
aoe: update cap on outstanding commands based on config query response
authorEd Cashin <ecashin@coraid.com>
Fri, 9 Nov 2012 03:05:12 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Nov 2012 03:09:10 +0000 (14:09 +1100)
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 <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoe.h
drivers/block/aoe/aoecmd.c

index d2ed7f18d1acfa6303b67999b0b39a93e575f49b..52f75c097242bd9173a64bb5e03723db056ae839 100644 (file)
@@ -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;
index 3804a0af3ef192c441643eee425d06f747b86d97..2bb8c7d3d617a51c3c9ae3a38c38b51e6ada1081 100644 (file)
@@ -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;