tree 474c8d5acc153eb1736c9a76be0973a32e5995f8
parent 0c6f0e7920f39b28bdbe5f134f3e592542332d87
author [EMAIL PROTECTED] <[EMAIL PROTECTED]> Tue, 19 Apr 2005 12:00:22 -0700
committer Greg KH <[EMAIL PROTECTED]> Tue, 19 Apr 2005 12:00:22 -0700
[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 <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
block/aoe/aoe.h | 3 ++-
block/aoe/aoeblk.c | 4 ++--
block/aoe/aoecmd.c | 26 +++++++++++++++++---------
3 files changed, 21 insertions(+), 12 deletions(-)
Index: drivers/block/aoe/aoe.h
===================================================================
--- 0d31149e2c52557555d35696e13d3d9baabc1eaa/drivers/block/aoe/aoe.h
(mode:100644 sha1:2e92cfb4997cdaa4ca335f43af409033c0d4e9dd)
+++ 474c8d5acc153eb1736c9a76be0973a32e5995f8/drivers/block/aoe/aoe.h
(mode:100644 sha1:aa8b547ffafa669f7cd3d547e4ac025203d799af)
@@ -131,7 +131,8 @@
struct timer_list timer;
spinlock_t lock;
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 */
struct list_head bufq; /* queue of bios to work on */
struct buf *inprocess; /* the one we're currently working on */
Index: drivers/block/aoe/aoeblk.c
===================================================================
--- 0d31149e2c52557555d35696e13d3d9baabc1eaa/drivers/block/aoe/aoeblk.c
(mode:100644 sha1:a2735d97584616972abad960697a3450e585864a)
+++ 474c8d5acc153eb1736c9a76be0973a32e5995f8/drivers/block/aoe/aoeblk.c
(mode:100644 sha1:4780f7926d4292bc8150e2712ea18d8a11204ec2)
@@ -147,8 +147,8 @@
list_add_tail(&buf->bufs, &d->bufq);
aoecmd_work(d);
- sl = d->skblist;
- d->skblist = NULL;
+ sl = d->sendq_hd;
+ d->sendq_hd = d->sendq_tl = NULL;
spin_unlock_irqrestore(&d->lock, flags);
Index: drivers/block/aoe/aoecmd.c
===================================================================
--- 0d31149e2c52557555d35696e13d3d9baabc1eaa/drivers/block/aoe/aoecmd.c
(mode:100644 sha1:60beb8db4612a452fddeaf5d876e62ce0742c1c4)
+++ 474c8d5acc153eb1736c9a76be0973a32e5995f8/drivers/block/aoe/aoecmd.c
(mode:100644 sha1:b5be4b7d7b5b3acaab207e9175de16fc0dcbc895)
@@ -178,8 +178,12 @@
skb = skb_prepare(d, f);
if (skb) {
- skb->next = d->skblist;
- d->skblist = skb;
+ skb->next = NULL;
+ if (d->sendq_hd)
+ d->sendq_tl->next = skb;
+ else
+ d->sendq_hd = skb;
+ d->sendq_tl = skb;
}
}
@@ -227,8 +231,12 @@
skb = skb_prepare(d, f);
if (skb) {
- skb->next = d->skblist;
- d->skblist = skb;
+ skb->next = NULL;
+ if (d->sendq_hd)
+ d->sendq_tl->next = skb;
+ else
+ d->sendq_hd = skb;
+ d->sendq_tl = skb;
}
}
@@ -280,8 +288,8 @@
}
}
- sl = d->skblist;
- d->skblist = NULL;
+ sl = d->sendq_hd;
+ d->sendq_hd = d->sendq_tl = NULL;
if (sl) {
n = d->rttavg <<= 1;
if (n > MAXTIMER)
@@ -481,8 +489,8 @@
aoecmd_work(d);
- sl = d->skblist;
- d->skblist = NULL;
+ sl = d->sendq_hd;
+ d->sendq_hd = d->sendq_tl = NULL;
spin_unlock_irqrestore(&d->lock, flags);
@@ -531,7 +539,7 @@
/*
* 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 *
aoecmd_ata_id(struct aoedev *d)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html