You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] aoe 12/12: send outgoing packets in order
I can't use list.h, since sk_buff doesn't have a list_head but instead has two struct sk_buff pointers, and I want to avoid any extra memory allocation. send outgoing packets in order Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg KH
parent
0c6f0e7920
commit
a4b3836409
@@ -131,7 +131,8 @@ struct aoedev {
|
|||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
struct net_device *ifp; /* interface ed is attached to */
|
struct net_device *ifp; /* interface ed is attached to */
|
||||||
struct sk_buff *skblist;/* packets needing to be sent */
|
struct sk_buff *sendq_hd; /* packets needing to be sent, list head */
|
||||||
|
struct sk_buff *sendq_tl;
|
||||||
mempool_t *bufpool; /* for deadlock-free Buf allocation */
|
mempool_t *bufpool; /* for deadlock-free Buf allocation */
|
||||||
struct list_head bufq; /* queue of bios to work on */
|
struct list_head bufq; /* queue of bios to work on */
|
||||||
struct buf *inprocess; /* the one we're currently working on */
|
struct buf *inprocess; /* the one we're currently working on */
|
||||||
|
|||||||
@@ -147,8 +147,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
|
|||||||
list_add_tail(&buf->bufs, &d->bufq);
|
list_add_tail(&buf->bufs, &d->bufq);
|
||||||
aoecmd_work(d);
|
aoecmd_work(d);
|
||||||
|
|
||||||
sl = d->skblist;
|
sl = d->sendq_hd;
|
||||||
d->skblist = NULL;
|
d->sendq_hd = d->sendq_tl = NULL;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&d->lock, flags);
|
spin_unlock_irqrestore(&d->lock, flags);
|
||||||
|
|
||||||
|
|||||||
@@ -178,8 +178,12 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
|
|||||||
|
|
||||||
skb = skb_prepare(d, f);
|
skb = skb_prepare(d, f);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
skb->next = d->skblist;
|
skb->next = NULL;
|
||||||
d->skblist = skb;
|
if (d->sendq_hd)
|
||||||
|
d->sendq_tl->next = skb;
|
||||||
|
else
|
||||||
|
d->sendq_hd = skb;
|
||||||
|
d->sendq_tl = skb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,8 +231,12 @@ rexmit(struct aoedev *d, struct frame *f)
|
|||||||
|
|
||||||
skb = skb_prepare(d, f);
|
skb = skb_prepare(d, f);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
skb->next = d->skblist;
|
skb->next = NULL;
|
||||||
d->skblist = skb;
|
if (d->sendq_hd)
|
||||||
|
d->sendq_tl->next = skb;
|
||||||
|
else
|
||||||
|
d->sendq_hd = skb;
|
||||||
|
d->sendq_tl = skb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,8 +288,8 @@ tdie: spin_unlock_irqrestore(&d->lock, flags);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sl = d->skblist;
|
sl = d->sendq_hd;
|
||||||
d->skblist = NULL;
|
d->sendq_hd = d->sendq_tl = NULL;
|
||||||
if (sl) {
|
if (sl) {
|
||||||
n = d->rttavg <<= 1;
|
n = d->rttavg <<= 1;
|
||||||
if (n > MAXTIMER)
|
if (n > MAXTIMER)
|
||||||
@@ -481,8 +489,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
|
|||||||
|
|
||||||
aoecmd_work(d);
|
aoecmd_work(d);
|
||||||
|
|
||||||
sl = d->skblist;
|
sl = d->sendq_hd;
|
||||||
d->skblist = NULL;
|
d->sendq_hd = d->sendq_tl = NULL;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&d->lock, flags);
|
spin_unlock_irqrestore(&d->lock, flags);
|
||||||
|
|
||||||
@@ -531,7 +539,7 @@ aoecmd_cfg(ushort aoemajor, unsigned char aoeminor)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Since we only call this in one place (and it only prepares one frame)
|
* Since we only call this in one place (and it only prepares one frame)
|
||||||
* we just return the skb. Usually we'd chain it up to the d->skblist.
|
* we just return the skb. Usually we'd chain it up to the aoedev sendq.
|
||||||
*/
|
*/
|
||||||
static struct sk_buff *
|
static struct sk_buff *
|
||||||
aoecmd_ata_id(struct aoedev *d)
|
aoecmd_ata_id(struct aoedev *d)
|
||||||
|
|||||||
Reference in New Issue
Block a user