* [PATCH 2.6.18-rc4] aoe [03/14]: remove unused NARGS enum
[not found] <E1GQ6uv-0001qi-00@kokone>
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [02/14]: update copyright date Ed L. Cashin
` (11 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
The NARGS enum is left over from older code versions.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
@@ -15,7 +15,6 @@ enum {
MINOR_INTERFACES,
MINOR_REVALIDATE,
MSGSZ = 2048,
- NARGS = 10,
NMSG = 100, /* message backlog to retain */
};
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [02/14]: update copyright date
[not found] <E1GQ6uv-0001qi-00@kokone>
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [03/14]: remove unused NARGS enum Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [09/14]: zero copy write 2 of 2 Ed L. Cashin
` (10 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Update the copyright year to 2006.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
#define VERSION "22"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoeblk.c
* block device routines
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoechr.c
* AoE character device driver
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoecmd.c
* Filesystem request handling methods
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoedev.c
* AoE device utility functions; maintains device list.
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoemain.c
* Module initialization routines, discover timer
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2006-08-17 16:45:33.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c 2006-09-20 14:29:35.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
/*
* aoenet.c
* Ethernet portion of AoE driver
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [09/14]: zero copy write 2 of 2
[not found] <E1GQ6uv-0001qi-00@kokone>
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [03/14]: remove unused NARGS enum Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [02/14]: update copyright date Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [08/14]: improve retransmission heuristics Ed L. Cashin
` (9 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Avoid memory copy on writes.
(This patch follows patch 4.)
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
@@ -84,6 +84,7 @@ enum {
DEVFL_PAUSE = (1<<5),
DEVFL_NEWSIZE = (1<<6), /* need to update dev size in block layer */
DEVFL_MAXBCNT = (1<<7), /* d->maxbcnt is not changeable */
+ DEVFL_KICKME = (1<<8),
BUFFL_FAIL = 1,
};
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -120,7 +120,7 @@ aoecmd_ata_rw(struct aoedev *d, struct f
h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
skb->len = sizeof *h + sizeof *ah;
- memset(h, 0, skb->len);
+ memset(h, 0, ETH_ZLEN);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->buf = buf;
@@ -143,8 +143,9 @@ aoecmd_ata_rw(struct aoedev *d, struct f
skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), bcnt);
ah->aflags |= AOEAFL_WRITE;
+ skb->len += bcnt;
+ skb->data_len = bcnt;
} else {
- skb_shinfo(skb)->nr_frags = 0;
skb->len = ETH_ZLEN;
writebit = 0;
}
@@ -167,8 +168,9 @@ aoecmd_ata_rw(struct aoedev *d, struct f
}
skb->dev = d->ifp;
- skb_get(skb);
- skb->next = NULL;
+ skb = skb_clone(skb, GFP_ATOMIC);
+ if (skb == NULL)
+ return;
if (d->sendq_hd)
d->sendq_tl->next = skb;
else
@@ -224,6 +226,29 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne
return sl;
}
+static struct frame *
+freeframe(struct aoedev *d)
+{
+ struct frame *f, *e;
+ int n = 0;
+
+ f = d->frames;
+ e = f + d->nframes;
+ for (; f<e; f++) {
+ if (f->tag != FREETAG)
+ continue;
+ if (atomic_read(&skb_shinfo(f->skb)->dataref) == 1) {
+ skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
+ return f;
+ }
+ n++;
+ }
+ if (n == d->nframes) /* wait for network layer */
+ d->flags |= DEVFL_KICKME;
+
+ return NULL;
+}
+
/* enters with d->lock held */
void
aoecmd_work(struct aoedev *d)
@@ -239,7 +264,7 @@ aoecmd_work(struct aoedev *d)
}
loop:
- f = getframe(d, FREETAG);
+ f = freeframe(d);
if (f == NULL)
return;
if (d->inprocess == NULL) {
@@ -282,20 +307,25 @@ rexmit(struct aoedev *d, struct frame *f
n = DEFAULTBCNT / 512;
if (ah->scnt > n) {
ah->scnt = n;
- if (ah->aflags & AOEAFL_WRITE)
+ if (ah->aflags & AOEAFL_WRITE) {
skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), DEFAULTBCNT);
+ skb->len = sizeof *h + sizeof *ah + DEFAULTBCNT;
+ skb->data_len = DEFAULTBCNT;
+ }
if (++d->lostjumbo > (d->nframes << 1))
if (d->maxbcnt != DEFAULTBCNT) {
- iprintk("too many lost jumbo - using 1KB frames.\n");
+ iprintk("e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
+ d->aoemajor, d->aoeminor, d->ifp->name);
d->maxbcnt = DEFAULTBCNT;
d->flags |= DEVFL_MAXBCNT;
}
}
skb->dev = d->ifp;
- skb_get(skb);
- skb->next = NULL;
+ skb = skb_clone(skb, GFP_ATOMIC);
+ if (skb == NULL)
+ return;
if (d->sendq_hd)
d->sendq_tl->next = skb;
else
@@ -350,6 +380,10 @@ rexmit_timer(ulong vp)
rexmit(d, f);
}
}
+ if (d->flags & DEVFL_KICKME) {
+ d->flags &= ~DEVFL_KICKME;
+ aoecmd_work(d);
+ }
sl = d->sendq_hd;
d->sendq_hd = d->sendq_tl = NULL;
@@ -552,23 +586,27 @@ aoecmd_ata_rsp(struct sk_buff *skb)
case WIN_WRITE:
case WIN_WRITE_EXT:
if (f->bcnt -= n) {
+ skb = f->skb;
f->bufaddr += n;
put_lba(ahout, f->lba += ahout->scnt);
n = f->bcnt;
if (n > DEFAULTBCNT)
n = DEFAULTBCNT;
ahout->scnt = n >> 9;
- if (ahout->aflags & AOEAFL_WRITE)
- skb_fill_page_desc(f->skb, 0,
+ if (ahout->aflags & AOEAFL_WRITE) {
+ skb_fill_page_desc(skb, 0,
virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), n);
+ skb->len = sizeof *hout + sizeof *ahout + n;
+ skb->data_len = n;
+ }
f->tag = newtag(d);
hout->tag = cpu_to_be32(f->tag);
skb->dev = d->ifp;
- skb_get(f->skb);
- f->skb->next = NULL;
+ skb = skb_clone(skb, GFP_ATOMIC);
spin_unlock_irqrestore(&d->lock, flags);
- aoenet_xmit(f->skb);
+ if (skb)
+ aoenet_xmit(skb);
return;
}
if (n > DEFAULTBCNT)
@@ -642,7 +680,7 @@ aoecmd_ata_id(struct aoedev *d)
struct frame *f;
struct sk_buff *skb;
- f = getframe(d, FREETAG);
+ f = freeframe(d);
if (f == NULL) {
eprintk("can't get a frame. This shouldn't happen.\n");
return NULL;
@@ -652,8 +690,8 @@ aoecmd_ata_id(struct aoedev *d)
skb = f->skb;
h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
- skb->len = sizeof *h + sizeof *ah;
- memset(h, 0, skb->len);
+ skb->len = ETH_ZLEN;
+ memset(h, 0, ETH_ZLEN);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
@@ -663,12 +701,11 @@ aoecmd_ata_id(struct aoedev *d)
ah->lba3 = 0xa0;
skb->dev = d->ifp;
- skb_get(skb);
d->rttavg = MAXTIMER;
d->timer.function = rexmit_timer;
- return skb;
+ return skb_clone(skb, GFP_ATOMIC);
}
void
@@ -724,7 +761,12 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
n /= 512;
if (n > ch->scnt)
n = ch->scnt;
- d->maxbcnt = n ? n * 512 : DEFAULTBCNT;
+ n = n ? n * 512 : DEFAULTBCNT;
+ if (n != d->maxbcnt) {
+ iprintk("e%ld.%ld: setting %d byte data frames on %s\n",
+ d->aoemajor, d->aoeminor, n, d->ifp->name);
+ d->maxbcnt = n;
+ }
}
/* don't change users' perspective */
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c 2006-09-20 14:29:36.000000000 -0400
@@ -121,6 +121,7 @@ aoedev_downdev(struct aoedev *d)
mempool_free(buf, d->bufpool);
bio_endio(bio, bio->bi_size, -EIO);
}
+ skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
}
d->inprocess = NULL;
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [08/14]: improve retransmission heuristics
[not found] <E1GQ6uv-0001qi-00@kokone>
` (2 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [09/14]: zero copy write 2 of 2 Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [07/14]: jumbo frame support 2 of 2 Ed L. Cashin
` (8 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Add a dynamic minimum timer for better retransmission behavior.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
@@ -125,8 +125,10 @@ struct aoedev {
ulong sysminor;
ulong aoemajor;
ulong aoeminor;
- ulong nopen; /* (bd_openers isn't available without sleeping) */
- ulong rttavg; /* round trip average of requests/responses */
+ u16 nopen; /* (bd_openers isn't available without sleeping) */
+ u16 lasttag; /* last tag sent */
+ u16 rttavg; /* round trip average of requests/responses */
+ u16 mintimer;
u16 fw_ver; /* version of blade's firmware */
u16 maxbcnt;
struct work_struct work;/* disk create work struct */
@@ -142,7 +144,6 @@ struct aoedev {
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 */
- ulong lasttag; /* last tag sent */
ushort lostjumbo;
ushort nframes; /* number of frames below */
struct frame *frames;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -461,8 +461,15 @@ calc_rttavg(struct aoedev *d, int rtt)
register long n;
n = rtt;
- if (n < MINTIMER)
- n = MINTIMER;
+ if (n < 0) {
+ n = -rtt;
+ if (n < MINTIMER)
+ n = MINTIMER;
+ else if (n > MAXTIMER)
+ n = MAXTIMER;
+ d->mintimer += (n - d->mintimer) >> 1;
+ } else if (n < d->mintimer)
+ n = d->mintimer;
else if (n > MAXTIMER)
n = MAXTIMER;
@@ -498,8 +505,10 @@ aoecmd_ata_rsp(struct sk_buff *skb)
spin_lock_irqsave(&d->lock, flags);
- f = getframe(d, be32_to_cpu(hin->tag));
+ n = be32_to_cpu(hin->tag);
+ f = getframe(d, n);
if (f == NULL) {
+ calc_rttavg(d, -tsince(n));
spin_unlock_irqrestore(&d->lock, flags);
snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n",
@@ -724,6 +733,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
return;
}
d->flags |= DEVFL_PAUSE; /* force pause */
+ d->mintimer = MINTIMER;
d->fw_ver = be16_to_cpu(ch->fwver);
/* check for already outstanding ataid */
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [07/14]: jumbo frame support 2 of 2
[not found] <E1GQ6uv-0001qi-00@kokone>
` (3 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [08/14]: improve retransmission heuristics Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [06/14]: clean up printks via macros Ed L. Cashin
` (7 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Add support for jumbo ethernet frames.
(This patch follows patch 5.)
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -475,7 +475,7 @@ void
aoecmd_ata_rsp(struct sk_buff *skb)
{
struct aoedev *d;
- struct aoe_hdr *hin;
+ struct aoe_hdr *hin, *hout;
struct aoe_atahdr *ahin, *ahout;
struct frame *f;
struct buf *buf;
@@ -515,7 +515,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
calc_rttavg(d, tsince(f->tag));
ahin = (struct aoe_atahdr *) (hin+1);
- ahout = (struct aoe_atahdr *) (f->skb->mac.raw + sizeof(struct aoe_hdr));
+ hout = (struct aoe_hdr *) f->skb->mac.raw;
+ ahout = (struct aoe_atahdr *) (hout+1);
buf = f->buf;
if (ahout->cmdstat == WIN_IDENTIFY)
@@ -552,6 +553,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
skb_fill_page_desc(f->skb, 0,
virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), n);
+ f->tag = newtag(d);
+ hout->tag = cpu_to_be32(f->tag);
+ skb->dev = d->ifp;
skb_get(f->skb);
f->skb->next = NULL;
spin_unlock_irqrestore(&d->lock, flags);
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [06/14]: clean up printks via macros
[not found] <E1GQ6uv-0001qi-00@kokone>
` (4 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [07/14]: jumbo frame support 2 of 2 Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [05/14]: jumbo frame support 1 of 2 Ed L. Cashin
` (6 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Use simple macros to clean up the printks.
(This patch is reverted by the 14th patch to follow.)
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
@@ -10,6 +10,11 @@
#define AOE_PARTITIONS (16)
#endif
+#define xprintk(L, fmt, arg...) printk(L "aoe: " "%s: " fmt, __func__, ## arg)
+#define iprintk(fmt, arg...) xprintk(KERN_INFO, fmt, ## arg)
+#define eprintk(fmt, arg...) xprintk(KERN_ERR, fmt, ## arg)
+#define dprintk(fmt, arg...) xprintk(KERN_DEBUG, fmt, ## arg)
+
#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF)
#define AOEMINOR(sysminor) ((sysminor) % NPERSHELF)
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:35.000000000 -0400
@@ -132,8 +132,7 @@ aoeblk_make_request(request_queue_t *q,
d = bio->bi_bdev->bd_disk->private_data;
buf = mempool_alloc(d->bufpool, GFP_NOIO);
if (buf == NULL) {
- printk(KERN_INFO "aoe: aoeblk_make_request: buf allocation "
- "failure\n");
+ iprintk("buf allocation failure\n");
bio_endio(bio, bio->bi_size, -ENOMEM);
return 0;
}
@@ -150,8 +149,7 @@ aoeblk_make_request(request_queue_t *q,
spin_lock_irqsave(&d->lock, flags);
if ((d->flags & DEVFL_UP) == 0) {
- printk(KERN_INFO "aoe: aoeblk_make_request: device %ld.%ld is not up\n",
- d->aoemajor, d->aoeminor);
+ iprintk("device %ld.%ld is not up\n", d->aoemajor, d->aoeminor);
spin_unlock_irqrestore(&d->lock, flags);
mempool_free(buf, d->bufpool);
bio_endio(bio, bio->bi_size, -ENXIO);
@@ -176,7 +174,7 @@ aoeblk_getgeo(struct block_device *bdev,
struct aoedev *d = bdev->bd_disk->private_data;
if ((d->flags & DEVFL_UP) == 0) {
- printk(KERN_ERR "aoe: aoeblk_ioctl: disk not up\n");
+ eprintk("disk not up\n");
return -ENODEV;
}
@@ -203,8 +201,8 @@ aoeblk_gdalloc(void *vp)
gd = alloc_disk(AOE_PARTITIONS);
if (gd == NULL) {
- printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate disk "
- "structure for %ld.%ld\n", d->aoemajor, d->aoeminor);
+ eprintk("cannot allocate disk structure for %ld.%ld\n",
+ d->aoemajor, d->aoeminor);
spin_lock_irqsave(&d->lock, flags);
d->flags &= ~DEVFL_GDALLOC;
spin_unlock_irqrestore(&d->lock, flags);
@@ -213,8 +211,8 @@ aoeblk_gdalloc(void *vp)
d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
if (d->bufpool == NULL) {
- printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool "
- "for %ld.%ld\n", d->aoemajor, d->aoeminor);
+ eprintk("cannot allocate bufpool for %ld.%ld\n",
+ d->aoemajor, d->aoeminor);
put_disk(gd);
spin_lock_irqsave(&d->lock, flags);
d->flags &= ~DEVFL_GDALLOC;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
@@ -55,9 +55,7 @@ static int
interfaces(const char __user *str, size_t size)
{
if (set_aoe_iflist(str, size)) {
- printk(KERN_CRIT
- "%s: could not set interface list: %s\n",
- __FUNCTION__, "too many interfaces");
+ eprintk("could not set interface list: too many interfaces\n");
return -EINVAL;
}
return 0;
@@ -80,8 +78,7 @@ revalidate(const char __user *str, size_
/* should be e%d.%d format */
n = sscanf(buf, "e%d.%d", &major, &minor);
if (n != 2) {
- printk(KERN_ERR "aoe: %s: invalid device specification\n",
- __FUNCTION__);
+ eprintk("invalid device specification\n");
return -EINVAL;
}
d = aoedev_by_aoeaddr(major, minor);
@@ -116,7 +113,7 @@ bail: spin_unlock_irqrestore(&emsgs_loc
mp = kmalloc(n, GFP_ATOMIC);
if (mp == NULL) {
- printk(KERN_CRIT "aoe: aoechr_error: allocation failure, len=%ld\n", n);
+ eprintk("allocation failure, len=%ld\n", n);
goto bail;
}
@@ -141,7 +138,7 @@ aoechr_write(struct file *filp, const ch
switch ((unsigned long) filp->private_data) {
default:
- printk(KERN_INFO "aoe: aoechr_write: can't write to that file.\n");
+ iprintk("can't write to that file.\n");
break;
case MINOR_DISCOVER:
ret = discover();
@@ -250,7 +247,7 @@ aoechr_init(void)
n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
if (n < 0) {
- printk(KERN_ERR "aoe: aoechr_init: can't register char device\n");
+ eprintk("can't register char device\n");
return n;
}
sema_init(&emsgs_sema, 0);
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
@@ -155,7 +155,7 @@ aoecmd_ata_rw(struct aoedev *d, struct f
buf->nframesout += 1;
buf->bufaddr += bcnt;
buf->bv_resid -= bcnt;
-/* printk(KERN_INFO "aoe: bv_resid=%ld\n", buf->bv_resid); */
+/* dprintk("bv_resid=%ld\n", buf->bv_resid); */
buf->resid -= bcnt;
buf->sector += bcnt >> 9;
if (buf->resid == 0) {
@@ -197,7 +197,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
- printk(KERN_INFO "aoe: aoecmd_cfg: skb alloc failure\n");
+ iprintk("skb alloc failure\n");
continue;
}
skb->dev = ifp;
@@ -247,7 +247,7 @@ loop:
return;
buf = container_of(d->bufq.next, struct buf, bufs);
list_del(d->bufq.next);
-/*printk(KERN_INFO "aoecmd_work: bi_size=%ld\n", buf->bio->bi_size); */
+/*dprintk("bi_size=%ld\n", buf->bio->bi_size); */
d->inprocess = buf;
}
aoecmd_ata_rw(d, f);
@@ -287,8 +287,7 @@ rexmit(struct aoedev *d, struct frame *f
offset_in_page(f->bufaddr), DEFAULTBCNT);
if (++d->lostjumbo > (d->nframes << 1))
if (d->maxbcnt != DEFAULTBCNT) {
- printk(KERN_INFO "aoe: rexmit: too many lost jumbo. "
- "dropping back to 1KB frames.\n");
+ iprintk("too many lost jumbo - using 1KB frames.\n");
d->maxbcnt = DEFAULTBCNT;
d->flags |= DEVFL_MAXBCNT;
}
@@ -435,8 +434,8 @@ ataid_complete(struct aoedev *d, unsigne
}
if (d->ssize != ssize)
- printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu "
- "sectors\n", (unsigned long long)mac_addr(d->addr),
+ iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n",
+ (unsigned long long)mac_addr(d->addr),
d->aoemajor, d->aoeminor,
d->fw_ver, (long long)ssize);
d->ssize = ssize;
@@ -446,11 +445,9 @@ ataid_complete(struct aoedev *d, unsigne
d->flags |= DEVFL_NEWSIZE;
} else {
if (d->flags & DEVFL_GDALLOC) {
- printk(KERN_INFO "aoe: %s: %s e%lu.%lu, %s\n",
- __FUNCTION__,
- "can't schedule work for",
+ eprintk("can't schedule work for e%lu.%lu, %s\n",
d->aoemajor, d->aoeminor,
- "it's already on! (This really shouldn't happen).\n");
+ "it's already on! This shouldn't happen.\n");
return;
}
d->flags |= DEVFL_GDALLOC;
@@ -524,8 +521,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (ahout->cmdstat == WIN_IDENTIFY)
d->flags &= ~DEVFL_PAUSE;
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
- printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh "
- "stat=%2.2Xh from e%ld.%ld\n",
+ eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
if (buf)
@@ -536,8 +532,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
case WIN_READ:
case WIN_READ_EXT:
if (skb->len - sizeof *hin - sizeof *ahin < n) {
- printk(KERN_CRIT "aoe: aoecmd_ata_rsp: runt "
- "ata data size in read. skb->len=%d\n",
+ eprintk("runt data size in read. skb->len=%d\n",
skb->len);
/* fail frame f? just returning will rexmit. */
spin_unlock_irqrestore(&d->lock, flags);
@@ -549,10 +544,13 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (f->bcnt -= n) {
f->bufaddr += n;
put_lba(ahout, f->lba += ahout->scnt);
- n = f->bcnt > DEFAULTBCNT ? DEFAULTBCNT : f->bcnt;
+ n = f->bcnt;
+ if (n > DEFAULTBCNT)
+ n = DEFAULTBCNT;
ahout->scnt = n >> 9;
if (ahout->aflags & AOEAFL_WRITE)
- skb_fill_page_desc(f->skb, 0, virt_to_page(f->bufaddr),
+ skb_fill_page_desc(f->skb, 0,
+ virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), n);
skb_get(f->skb);
f->skb->next = NULL;
@@ -565,19 +563,18 @@ aoecmd_ata_rsp(struct sk_buff *skb)
break;
case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) {
- printk(KERN_INFO "aoe: aoecmd_ata_rsp: runt data size "
- "in ataid. skb->len=%d\n", skb->len);
+ iprintk("runt data size in ataid. skb->len=%d\n",
+ skb->len);
spin_unlock_irqrestore(&d->lock, flags);
return;
}
ataid_complete(d, (char *) (ahin+1));
break;
default:
- printk(KERN_INFO "aoe: aoecmd_ata_rsp: unrecognized "
- "outbound ata command %2.2Xh for %d.%d\n",
- ahout->cmdstat,
- be16_to_cpu(hin->major),
- hin->minor);
+ iprintk("unrecognized ata command %2.2Xh for %d.%d\n",
+ ahout->cmdstat,
+ be16_to_cpu(hin->major),
+ hin->minor);
}
}
@@ -634,8 +631,7 @@ aoecmd_ata_id(struct aoedev *d)
f = getframe(d, FREETAG);
if (f == NULL) {
- printk(KERN_CRIT "aoe: aoecmd_ata_id: can't get a frame. "
- "This shouldn't happen.\n");
+ eprintk("can't get a frame. This shouldn't happen.\n");
return NULL;
}
@@ -682,15 +678,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
*/
aoemajor = be16_to_cpu(h->major);
if (aoemajor == 0xfff) {
- printk(KERN_CRIT "aoe: aoecmd_cfg_rsp: Warning: shelf "
- "address is all ones. Check shelf dip switches\n");
+ eprintk("Warning: shelf address is all ones. "
+ "Check shelf dip switches.\n");
return;
}
sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
- printk(KERN_INFO
- "aoe: e%ld.%d: minor number too large\n",
+ iprintk("e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor);
return;
}
@@ -701,7 +696,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
d = aoedev_by_sysminor_m(sysminor, n);
if (d == NULL) {
- printk(KERN_INFO "aoe: aoecmd_cfg_rsp: device sysminor_m failure\n");
+ iprintk("device sysminor_m failure\n");
return;
}
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
@@ -155,7 +155,7 @@ aoedev_by_sysminor_m(ulong sysminor, ulo
d = aoedev_newdev(bufcnt);
if (d == NULL) {
spin_unlock_irqrestore(&devlist_lock, flags);
- printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n");
+ iprintk("aoedev_newdev failure.\n");
return NULL;
}
d->sysminor = sysminor;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c 2006-09-20 14:29:35.000000000 -0400
@@ -84,13 +84,11 @@ aoe_init(void)
goto net_fail;
ret = register_blkdev(AOE_MAJOR, DEVICE_NAME);
if (ret < 0) {
- printk(KERN_ERR "aoe: aoeblk_init: can't register major\n");
+ eprintk("can't register major\n");
goto blkreg_fail;
}
- printk(KERN_INFO
- "aoe: aoe_init: AoE v%s initialised.\n",
- VERSION);
+ iprintk("AoE v%s initialised.\n", VERSION);
discover_timer(TINIT);
return 0;
@@ -103,7 +101,7 @@ aoe_init(void)
chr_fail:
aoedev_exit();
- printk(KERN_INFO "aoe: aoe_init: initialisation failure.\n");
+ iprintk("initialisation failure.\n");
return ret;
}
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c 2006-09-20 14:29:35.000000000 -0400
@@ -74,7 +74,7 @@ set_aoe_iflist(const char __user *user_s
return -EINVAL;
if (copy_from_user(aoe_iflist, user_str, size)) {
- printk(KERN_INFO "aoe: %s: copy from user failed\n", __FUNCTION__);
+ iprintk("copy from user failed\n");
return -EFAULT;
}
aoe_iflist[size] = 0x00;
@@ -132,8 +132,7 @@ aoenet_rcv(struct sk_buff *skb, struct n
if (n > NECODES)
n = 0;
if (net_ratelimit())
- printk(KERN_ERR "aoe: aoenet_rcv: error packet from %d.%d; "
- "ecode=%d '%s'\n",
+ eprintk("error packet from %d.%d; ecode=%d '%s'\n",
be16_to_cpu(h->major), h->minor,
h->err, aoe_errlist[n]);
goto exit;
@@ -147,7 +146,7 @@ aoenet_rcv(struct sk_buff *skb, struct n
aoecmd_cfg_rsp(skb);
break;
default:
- printk(KERN_INFO "aoe: aoenet_rcv: unknown cmd %d\n", h->cmd);
+ iprintk("unknown cmd %d\n", h->cmd);
}
exit:
dev_kfree_skb(skb);
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [05/14]: jumbo frame support 1 of 2
[not found] <E1GQ6uv-0001qi-00@kokone>
` (5 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [06/14]: clean up printks via macros Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [04/14]: zero copy write " Ed L. Cashin
` (5 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Add support for jumbo ethernet frames.
(This patch depends on patch 7 to follow.)
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
@@ -65,7 +65,7 @@ struct aoe_atahdr {
struct aoe_cfghdr {
__be16 bufcnt;
__be16 fwver;
- unsigned char res;
+ unsigned char scnt;
unsigned char aoeccmd;
unsigned char cslen[2];
};
@@ -78,12 +78,13 @@ enum {
DEVFL_GDALLOC = (1<<4), /* need to alloc gendisk */
DEVFL_PAUSE = (1<<5),
DEVFL_NEWSIZE = (1<<6), /* need to update dev size in block layer */
+ DEVFL_MAXBCNT = (1<<7), /* d->maxbcnt is not changeable */
BUFFL_FAIL = 1,
};
enum {
- MAXATADATA = 1024,
+ DEFAULTBCNT = 2 * 512, /* 2 sectors */
NPERSHELF = 16, /* number of slots per shelf address */
FREETAG = -1,
MIN_BUFS = 8,
@@ -107,6 +108,8 @@ struct frame {
ulong waited;
struct buf *buf;
char *bufaddr;
+ ulong bcnt;
+ sector_t lba;
struct sk_buff *skb;
};
@@ -120,6 +123,7 @@ struct aoedev {
ulong nopen; /* (bd_openers isn't available without sleeping) */
ulong rttavg; /* round trip average of requests/responses */
u16 fw_ver; /* version of blade's firmware */
+ u16 maxbcnt;
struct work_struct work;/* disk create work struct */
struct gendisk *gd;
request_queue_t blkq;
@@ -134,7 +138,8 @@ struct aoedev {
struct list_head bufq; /* queue of bios to work on */
struct buf *inprocess; /* the one we're currently working on */
ulong lasttag; /* last tag sent */
- ulong nframes; /* number of frames below */
+ ushort lostjumbo;
+ ushort nframes; /* number of frames below */
struct frame *frames;
};
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
@@ -89,6 +89,7 @@ revalidate(const char __user *str, size_
return -EINVAL;
spin_lock_irqsave(&d->lock, flags);
+ d->flags &= ~DEVFL_MAXBCNT;
d->flags |= DEVFL_PAUSE;
spin_unlock_irqrestore(&d->lock, flags);
aoecmd_cfg(major, minor);
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
@@ -83,6 +83,17 @@ aoehdr_atainit(struct aoedev *d, struct
return host_tag;
}
+static inline void
+put_lba(struct aoe_atahdr *ah, sector_t lba)
+{
+ ah->lba0 = lba;
+ ah->lba1 = lba >>= 8;
+ ah->lba2 = lba >>= 8;
+ ah->lba3 = lba >>= 8;
+ ah->lba4 = lba >>= 8;
+ ah->lba5 = lba >>= 8;
+}
+
static void
aoecmd_ata_rw(struct aoedev *d, struct frame *f)
{
@@ -101,8 +112,8 @@ aoecmd_ata_rw(struct aoedev *d, struct f
sector = buf->sector;
bcnt = buf->bv_resid;
- if (bcnt > MAXATADATA)
- bcnt = MAXATADATA;
+ if (bcnt > d->maxbcnt)
+ bcnt = d->maxbcnt;
/* initialize the headers & frame */
skb = f->skb;
@@ -114,17 +125,14 @@ aoecmd_ata_rw(struct aoedev *d, struct f
f->waited = 0;
f->buf = buf;
f->bufaddr = buf->bufaddr;
+ f->bcnt = bcnt;
+ f->lba = sector;
/* set up ata header */
ah->scnt = bcnt >> 9;
- ah->lba0 = sector;
- ah->lba1 = sector >>= 8;
- ah->lba2 = sector >>= 8;
- ah->lba3 = sector >>= 8;
+ put_lba(ah, sector);
if (d->flags & DEVFL_EXT) {
ah->aflags |= AOEAFL_EXT;
- ah->lba4 = sector >>= 8;
- ah->lba5 = sector >>= 8;
} else {
extbit = 0;
ah->lba3 &= 0x0f;
@@ -251,6 +259,7 @@ rexmit(struct aoedev *d, struct frame *f
{
struct sk_buff *skb;
struct aoe_hdr *h;
+ struct aoe_atahdr *ah;
char buf[128];
u32 n;
@@ -264,11 +273,27 @@ rexmit(struct aoedev *d, struct frame *f
skb = f->skb;
h = (struct aoe_hdr *) skb->mac.raw;
+ ah = (struct aoe_atahdr *) (h+1);
f->tag = n;
h->tag = cpu_to_be32(n);
memcpy(h->dst, d->addr, sizeof h->dst);
memcpy(h->src, d->ifp->dev_addr, sizeof h->src);
+ n = DEFAULTBCNT / 512;
+ if (ah->scnt > n) {
+ ah->scnt = n;
+ if (ah->aflags & AOEAFL_WRITE)
+ skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
+ offset_in_page(f->bufaddr), DEFAULTBCNT);
+ if (++d->lostjumbo > (d->nframes << 1))
+ if (d->maxbcnt != DEFAULTBCNT) {
+ printk(KERN_INFO "aoe: rexmit: too many lost jumbo. "
+ "dropping back to 1KB frames.\n");
+ d->maxbcnt = DEFAULTBCNT;
+ d->flags |= DEVFL_MAXBCNT;
+ }
+ }
+
skb->dev = d->ifp;
skb_get(skb);
skb->next = NULL;
@@ -506,10 +531,10 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (buf)
buf->flags |= BUFFL_FAIL;
} else {
+ n = ahout->scnt << 9;
switch (ahout->cmdstat) {
case WIN_READ:
case WIN_READ_EXT:
- n = ahout->scnt << 9;
if (skb->len - sizeof *hin - sizeof *ahin < n) {
printk(KERN_CRIT "aoe: aoecmd_ata_rsp: runt "
"ata data size in read. skb->len=%d\n",
@@ -521,6 +546,22 @@ aoecmd_ata_rsp(struct sk_buff *skb)
memcpy(f->bufaddr, ahin+1, n);
case WIN_WRITE:
case WIN_WRITE_EXT:
+ if (f->bcnt -= n) {
+ f->bufaddr += n;
+ put_lba(ahout, f->lba += ahout->scnt);
+ n = f->bcnt > DEFAULTBCNT ? DEFAULTBCNT : f->bcnt;
+ ahout->scnt = n >> 9;
+ if (ahout->aflags & AOEAFL_WRITE)
+ skb_fill_page_desc(f->skb, 0, virt_to_page(f->bufaddr),
+ offset_in_page(f->bufaddr), n);
+ skb_get(f->skb);
+ f->skb->next = NULL;
+ spin_unlock_irqrestore(&d->lock, flags);
+ aoenet_xmit(f->skb);
+ return;
+ }
+ if (n > DEFAULTBCNT)
+ d->lostjumbo = 0;
break;
case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) {
@@ -628,9 +669,9 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
struct aoe_hdr *h;
struct aoe_cfghdr *ch;
ulong flags, sysminor, aoemajor;
- u16 bufcnt;
struct sk_buff *sl;
enum { MAXFRAMES = 16 };
+ u16 n;
h = (struct aoe_hdr *) skb->mac.raw;
ch = (struct aoe_cfghdr *) (h+1);
@@ -654,11 +695,11 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
return;
}
- bufcnt = be16_to_cpu(ch->bufcnt);
- if (bufcnt > MAXFRAMES) /* keep it reasonable */
- bufcnt = MAXFRAMES;
+ n = be16_to_cpu(ch->bufcnt);
+ if (n > MAXFRAMES) /* keep it reasonable */
+ n = MAXFRAMES;
- d = aoedev_by_sysminor_m(sysminor, bufcnt);
+ d = aoedev_by_sysminor_m(sysminor, n);
if (d == NULL) {
printk(KERN_INFO "aoe: aoecmd_cfg_rsp: device sysminor_m failure\n");
return;
@@ -669,6 +710,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
/* permit device to migrate mac and network interface */
d->ifp = skb->dev;
memcpy(d->addr, h->src, sizeof d->addr);
+ if (!(d->flags & DEVFL_MAXBCNT)) {
+ n = d->ifp->mtu;
+ n -= sizeof (struct aoe_hdr) + sizeof (struct aoe_atahdr);
+ n /= 512;
+ if (n > ch->scnt)
+ n = ch->scnt;
+ d->maxbcnt = n ? n * 512 : DEFAULTBCNT;
+ }
/* don't change users' perspective */
if (d->nopen && !(d->flags & DEVFL_PAUSE)) {
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [04/14]: zero copy write 1 of 2
[not found] <E1GQ6uv-0001qi-00@kokone>
` (6 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [05/14]: jumbo frame support 1 of 2 Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [11/14]: use bio->bi_idx Ed L. Cashin
` (4 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Avoid memory copy on writes.
(This patch depends on fixes in patch 9 to follow.)
Although skb->len should not be set when working with linear skbuffs,
the skb->tail pointer maintained by skb_put/skb_trim is not relevant
to what happens when the skb_fill_page_desc function is called. This
issue was raised without comment in linux-kernel and netdev earlier
this month:
http://thread.gmane.org/gmane.linux.kernel/446474/
http://thread.gmane.org/gmane.linux.network/45444/
So until there is something analogous to skb_put that works for
zero-copy write skbuffs, we will do what the other callers of
skb_fill_page_desc are doing.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:35.000000000 -0400
@@ -107,11 +107,7 @@ struct frame {
ulong waited;
struct buf *buf;
char *bufaddr;
- int writedatalen;
- int ndata;
-
- /* largest possible */
- unsigned char data[sizeof(struct aoe_hdr) + sizeof(struct aoe_atahdr)];
+ struct sk_buff *skb;
};
struct aoedev {
@@ -157,6 +153,7 @@ void aoecmd_cfg(ushort aoemajor, unsigne
void aoecmd_ata_rsp(struct sk_buff *);
void aoecmd_cfg_rsp(struct sk_buff *);
void aoecmd_sleepwork(void *vp);
+struct sk_buff *new_skb(ulong);
int aoedev_init(void);
void aoedev_exit(void);
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:35.000000000 -0400
@@ -17,15 +17,14 @@
#define MAXTIMER (HZ << 1)
#define MAXWAIT (60 * 3) /* After MAXWAIT seconds, give up and fail dev */
-static struct sk_buff *
-new_skb(struct net_device *if_dev, ulong len)
+struct sk_buff *
+new_skb(ulong len)
{
struct sk_buff *skb;
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
skb->nh.raw = skb->mac.raw = skb->data;
- skb->dev = if_dev;
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
skb_put(skb, len);
@@ -40,29 +39,6 @@ new_skb(struct net_device *if_dev, ulong
return skb;
}
-static struct sk_buff *
-skb_prepare(struct aoedev *d, struct frame *f)
-{
- struct sk_buff *skb;
- char *p;
-
- skb = new_skb(d->ifp, f->ndata + f->writedatalen);
- if (!skb) {
- printk(KERN_INFO "aoe: skb_prepare: failure to allocate skb\n");
- return NULL;
- }
-
- p = skb->mac.raw;
- memcpy(p, f->data, f->ndata);
-
- if (f->writedatalen) {
- p += sizeof(struct aoe_hdr) + sizeof(struct aoe_atahdr);
- memcpy(p, f->bufaddr, f->writedatalen);
- }
-
- return skb;
-}
-
static struct frame *
getframe(struct aoedev *d, int tag)
{
@@ -129,10 +105,11 @@ aoecmd_ata_rw(struct aoedev *d, struct f
bcnt = MAXATADATA;
/* initialize the headers & frame */
- h = (struct aoe_hdr *) f->data;
+ skb = f->skb;
+ h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
- f->ndata = sizeof *h + sizeof *ah;
- memset(h, 0, f->ndata);
+ skb->len = sizeof *h + sizeof *ah;
+ memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->buf = buf;
@@ -155,11 +132,13 @@ aoecmd_ata_rw(struct aoedev *d, struct f
}
if (bio_data_dir(buf->bio) == WRITE) {
+ skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
+ offset_in_page(f->bufaddr), bcnt);
ah->aflags |= AOEAFL_WRITE;
- f->writedatalen = bcnt;
} else {
+ skb_shinfo(skb)->nr_frags = 0;
+ skb->len = ETH_ZLEN;
writebit = 0;
- f->writedatalen = 0;
}
ah->cmdstat = WIN_READ | writebit | extbit;
@@ -179,15 +158,14 @@ aoecmd_ata_rw(struct aoedev *d, struct f
buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
}
- skb = skb_prepare(d, f);
- if (skb) {
- skb->next = NULL;
- if (d->sendq_hd)
- d->sendq_tl->next = skb;
- else
- d->sendq_hd = skb;
- d->sendq_tl = skb;
- }
+ skb->dev = d->ifp;
+ skb_get(skb);
+ skb->next = NULL;
+ if (d->sendq_hd)
+ d->sendq_tl->next = skb;
+ else
+ d->sendq_hd = skb;
+ d->sendq_tl = skb;
}
/* some callers cannot sleep, and they can call this function,
@@ -209,11 +187,12 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne
if (!is_aoe_netif(ifp))
continue;
- skb = new_skb(ifp, sizeof *h + sizeof *ch);
+ skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
printk(KERN_INFO "aoe: aoecmd_cfg: skb alloc failure\n");
continue;
}
+ skb->dev = ifp;
if (sl_tail == NULL)
sl_tail = skb;
h = (struct aoe_hdr *) skb->mac.raw;
@@ -283,21 +262,21 @@ rexmit(struct aoedev *d, struct frame *f
d->aoemajor, d->aoeminor, f->tag, jiffies, n);
aoechr_error(buf);
- h = (struct aoe_hdr *) f->data;
+ skb = f->skb;
+ h = (struct aoe_hdr *) skb->mac.raw;
f->tag = n;
h->tag = cpu_to_be32(n);
memcpy(h->dst, d->addr, sizeof h->dst);
memcpy(h->src, d->ifp->dev_addr, sizeof h->src);
- skb = skb_prepare(d, f);
- if (skb) {
- skb->next = NULL;
- if (d->sendq_hd)
- d->sendq_tl->next = skb;
- else
- d->sendq_hd = skb;
- d->sendq_tl = skb;
- }
+ skb->dev = d->ifp;
+ skb_get(skb);
+ skb->next = NULL;
+ if (d->sendq_hd)
+ d->sendq_tl->next = skb;
+ else
+ d->sendq_hd = skb;
+ d->sendq_tl = skb;
}
static int
@@ -514,7 +493,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
calc_rttavg(d, tsince(f->tag));
ahin = (struct aoe_atahdr *) (hin+1);
- ahout = (struct aoe_atahdr *) (f->data + sizeof(struct aoe_hdr));
+ ahout = (struct aoe_atahdr *) (f->skb->mac.raw + sizeof(struct aoe_hdr));
buf = f->buf;
if (ahout->cmdstat == WIN_IDENTIFY)
@@ -620,20 +599,21 @@ aoecmd_ata_id(struct aoedev *d)
}
/* initialize the headers & frame */
- h = (struct aoe_hdr *) f->data;
+ skb = f->skb;
+ h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
- f->ndata = sizeof *h + sizeof *ah;
- memset(h, 0, f->ndata);
+ skb->len = sizeof *h + sizeof *ah;
+ memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
- f->writedatalen = 0;
/* set up ata header */
ah->scnt = 1;
ah->cmdstat = WIN_IDENTIFY;
ah->lba3 = 0xa0;
- skb = skb_prepare(d, f);
+ skb->dev = d->ifp;
+ skb_get(skb);
d->rttavg = MAXTIMER;
d->timer.function = rexmit_timer;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c 2006-09-20 14:29:35.000000000 -0400
@@ -63,22 +63,32 @@ aoedev_newdev(ulong nframes)
struct frame *f, *e;
d = kzalloc(sizeof *d, GFP_ATOMIC);
- if (d == NULL)
- return NULL;
f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
- if (f == NULL) {
- kfree(d);
+ switch (!d || !f) {
+ case 0:
+ d->nframes = nframes;
+ d->frames = f;
+ e = f + nframes;
+ for (; f<e; f++) {
+ f->tag = FREETAG;
+ f->skb = new_skb(ETH_ZLEN);
+ if (!f->skb)
+ break;
+ }
+ if (f == e)
+ break;
+ while (f > d->frames) {
+ f--;
+ dev_kfree_skb(f->skb);
+ }
+ default:
+ if (f)
+ kfree(f);
+ if (d)
+ kfree(d);
return NULL;
}
-
INIT_WORK(&d->work, aoecmd_sleepwork, d);
-
- d->nframes = nframes;
- d->frames = f;
- e = f + nframes;
- for (; f<e; f++)
- f->tag = FREETAG;
-
spin_lock_init(&d->lock);
init_timer(&d->timer);
d->timer.data = (ulong) d;
@@ -160,11 +170,19 @@ aoedev_by_sysminor_m(ulong sysminor, ulo
static void
aoedev_freedev(struct aoedev *d)
{
+ struct frame *f, *e;
+
if (d->gd) {
aoedisk_rm_sysfs(d);
del_gendisk(d->gd);
put_disk(d->gd);
}
+ f = d->frames;
+ e = f + d->nframes;
+ for (; f<e; f++) {
+ skb_shinfo(f->skb)->nr_frags = 0;
+ dev_kfree_skb(f->skb);
+ }
kfree(d->frames);
if (d->bufpool)
mempool_destroy(d->bufpool);
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [11/14]: use bio->bi_idx
[not found] <E1GQ6uv-0001qi-00@kokone>
` (7 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [04/14]: zero copy write " Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [10/14]: module parameter for device timeout Ed L. Cashin
` (3 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Instead of starting with bio->bi_io_vec, use the offset in bio->bi_idx.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:36.000000000 -0400
@@ -142,7 +142,8 @@ aoeblk_make_request(request_queue_t *q,
buf->bio = bio;
buf->resid = bio->bi_size;
buf->sector = bio->bi_sector;
- buf->bv = buf->bio->bi_io_vec;
+ buf->bv = &bio->bi_io_vec[bio->bi_idx];
+ WARN_ON(buf->bv->bv_len == 0);
buf->bv_resid = buf->bv->bv_len;
buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -166,6 +166,7 @@ aoecmd_ata_rw(struct aoedev *d, struct f
d->inprocess = NULL;
} else if (buf->bv_resid == 0) {
buf->bv++;
+ WARN_ON(buf->bv->bv_len == 0);
buf->bv_resid = buf->bv->bv_len;
buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
}
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [10/14]: module parameter for device timeout
[not found] <E1GQ6uv-0001qi-00@kokone>
` (8 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [11/14]: use bio->bi_idx Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [14/14]: revert printk macros Ed L. Cashin
` (2 subsequent siblings)
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
The aoe_deadsecs module parameter sets the number of seconds that
elapse before a nonresponsive AoE device is marked as dead.
This is runtime settable in sysfs or settable with a module load or
kernel boot parameter.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -15,7 +15,10 @@
#define TIMERTICK (HZ / 10)
#define MINTIMER (2 * TIMERTICK)
#define MAXTIMER (HZ << 1)
-#define MAXWAIT (60 * 3) /* After MAXWAIT seconds, give up and fail dev */
+
+static int aoe_deadsecs = 60 * 3;
+module_param(aoe_deadsecs, int, 0644);
+MODULE_PARM_DESC(aoe_deadsecs, "After aoe_deadsecs seconds, give up and fail dev.");
struct sk_buff *
new_skb(ulong len)
@@ -373,7 +376,7 @@ rexmit_timer(ulong vp)
if (f->tag != FREETAG && tsince(f->tag) >= timeout) {
n = f->waited += timeout;
n /= HZ;
- if (n > MAXWAIT) { /* waited too long. device failure. */
+ if (n > aoe_deadsecs) { /* waited too long for response */
aoedev_downdev(d);
break;
}
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [14/14]: revert printk macros
[not found] <E1GQ6uv-0001qi-00@kokone>
` (9 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [10/14]: module parameter for device timeout Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [12/14]: remove sysfs comment Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [13/14]: update driver version Ed L. Cashin
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
This patch addresses the concern that the aoe driver should
not introduce unecessary conventions that must be learned by
the reader. It reverts patch 6.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
@@ -10,11 +10,6 @@
#define AOE_PARTITIONS (16)
#endif
-#define xprintk(L, fmt, arg...) printk(L "aoe: " "%s: " fmt, __func__, ## arg)
-#define iprintk(fmt, arg...) xprintk(KERN_INFO, fmt, ## arg)
-#define eprintk(fmt, arg...) xprintk(KERN_ERR, fmt, ## arg)
-#define dprintk(fmt, arg...) xprintk(KERN_DEBUG, fmt, ## arg)
-
#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF)
#define AOEMINOR(sysminor) ((sysminor) % NPERSHELF)
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:36.000000000 -0400
@@ -131,7 +131,7 @@ aoeblk_make_request(request_queue_t *q,
d = bio->bi_bdev->bd_disk->private_data;
buf = mempool_alloc(d->bufpool, GFP_NOIO);
if (buf == NULL) {
- iprintk("buf allocation failure\n");
+ printk(KERN_INFO "aoe: buf allocation failure\n");
bio_endio(bio, bio->bi_size, -ENOMEM);
return 0;
}
@@ -149,7 +149,8 @@ aoeblk_make_request(request_queue_t *q,
spin_lock_irqsave(&d->lock, flags);
if ((d->flags & DEVFL_UP) == 0) {
- iprintk("device %ld.%ld is not up\n", d->aoemajor, d->aoeminor);
+ printk(KERN_INFO "aoe: device %ld.%ld is not up\n",
+ d->aoemajor, d->aoeminor);
spin_unlock_irqrestore(&d->lock, flags);
mempool_free(buf, d->bufpool);
bio_endio(bio, bio->bi_size, -ENXIO);
@@ -174,7 +175,7 @@ aoeblk_getgeo(struct block_device *bdev,
struct aoedev *d = bdev->bd_disk->private_data;
if ((d->flags & DEVFL_UP) == 0) {
- eprintk("disk not up\n");
+ printk(KERN_ERR "aoe: disk not up\n");
return -ENODEV;
}
@@ -201,7 +202,7 @@ aoeblk_gdalloc(void *vp)
gd = alloc_disk(AOE_PARTITIONS);
if (gd == NULL) {
- eprintk("cannot allocate disk structure for %ld.%ld\n",
+ printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n",
d->aoemajor, d->aoeminor);
spin_lock_irqsave(&d->lock, flags);
d->flags &= ~DEVFL_GDALLOC;
@@ -211,7 +212,7 @@ aoeblk_gdalloc(void *vp)
d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
if (d->bufpool == NULL) {
- eprintk("cannot allocate bufpool for %ld.%ld\n",
+ printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n",
d->aoemajor, d->aoeminor);
put_disk(gd);
spin_lock_irqsave(&d->lock, flags);
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoechr.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoechr.c 2006-09-20 14:29:36.000000000 -0400
@@ -55,7 +55,8 @@ static int
interfaces(const char __user *str, size_t size)
{
if (set_aoe_iflist(str, size)) {
- eprintk("could not set interface list: too many interfaces\n");
+ printk(KERN_ERR
+ "aoe: could not set interface list: too many interfaces\n");
return -EINVAL;
}
return 0;
@@ -78,7 +79,7 @@ revalidate(const char __user *str, size_
/* should be e%d.%d format */
n = sscanf(buf, "e%d.%d", &major, &minor);
if (n != 2) {
- eprintk("invalid device specification\n");
+ printk(KERN_ERR "aoe: invalid device specification\n");
return -EINVAL;
}
d = aoedev_by_aoeaddr(major, minor);
@@ -113,7 +114,7 @@ bail: spin_unlock_irqrestore(&emsgs_loc
mp = kmalloc(n, GFP_ATOMIC);
if (mp == NULL) {
- eprintk("allocation failure, len=%ld\n", n);
+ printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
goto bail;
}
@@ -138,7 +139,7 @@ aoechr_write(struct file *filp, const ch
switch ((unsigned long) filp->private_data) {
default:
- iprintk("can't write to that file.\n");
+ printk(KERN_INFO "aoe: can't write to that file.\n");
break;
case MINOR_DISCOVER:
ret = discover();
@@ -247,7 +248,7 @@ aoechr_init(void)
n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
if (n < 0) {
- eprintk("can't register char device\n");
+ printk(KERN_ERR "aoe: can't register char device\n");
return n;
}
sema_init(&emsgs_sema, 0);
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-09-20 14:29:36.000000000 -0400
@@ -159,7 +159,7 @@ aoecmd_ata_rw(struct aoedev *d, struct f
buf->nframesout += 1;
buf->bufaddr += bcnt;
buf->bv_resid -= bcnt;
-/* dprintk("bv_resid=%ld\n", buf->bv_resid); */
+/* printk(KERN_DEBUG "aoe: bv_resid=%ld\n", buf->bv_resid); */
buf->resid -= bcnt;
buf->sector += bcnt >> 9;
if (buf->resid == 0) {
@@ -203,7 +203,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
- iprintk("skb alloc failure\n");
+ printk(KERN_INFO "aoe: skb alloc failure\n");
continue;
}
skb->dev = ifp;
@@ -276,7 +276,7 @@ loop:
return;
buf = container_of(d->bufq.next, struct buf, bufs);
list_del(d->bufq.next);
-/*dprintk("bi_size=%ld\n", buf->bio->bi_size); */
+/*printk(KERN_DEBUG "aoe: bi_size=%ld\n", buf->bio->bi_size); */
d->inprocess = buf;
}
aoecmd_ata_rw(d, f);
@@ -319,7 +319,7 @@ rexmit(struct aoedev *d, struct frame *f
}
if (++d->lostjumbo > (d->nframes << 1))
if (d->maxbcnt != DEFAULTBCNT) {
- iprintk("e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
+ printk(KERN_INFO "aoe: e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
d->aoemajor, d->aoeminor, d->ifp->name);
d->maxbcnt = DEFAULTBCNT;
d->flags |= DEVFL_MAXBCNT;
@@ -472,7 +472,7 @@ ataid_complete(struct aoedev *d, unsigne
}
if (d->ssize != ssize)
- iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n",
+ printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n",
(unsigned long long)mac_addr(d->addr),
d->aoemajor, d->aoeminor,
d->fw_ver, (long long)ssize);
@@ -483,7 +483,7 @@ ataid_complete(struct aoedev *d, unsigne
d->flags |= DEVFL_NEWSIZE;
} else {
if (d->flags & DEVFL_GDALLOC) {
- eprintk("can't schedule work for e%lu.%lu, %s\n",
+ printk(KERN_ERR "aoe: can't schedule work for e%lu.%lu, %s\n",
d->aoemajor, d->aoeminor,
"it's already on! This shouldn't happen.\n");
return;
@@ -569,7 +569,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (ahout->cmdstat == WIN_IDENTIFY)
d->flags &= ~DEVFL_PAUSE;
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
- eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
+ printk(KERN_ERR
+ "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
if (buf)
@@ -580,7 +581,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
case WIN_READ:
case WIN_READ_EXT:
if (skb->len - sizeof *hin - sizeof *ahin < n) {
- eprintk("runt data size in read. skb->len=%d\n",
+ printk(KERN_ERR
+ "aoe: runt data size in read. skb->len=%d\n",
skb->len);
/* fail frame f? just returning will rexmit. */
spin_unlock_irqrestore(&d->lock, flags);
@@ -618,7 +620,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
break;
case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) {
- iprintk("runt data size in ataid. skb->len=%d\n",
+ printk(KERN_INFO
+ "aoe: runt data size in ataid. skb->len=%d\n",
skb->len);
spin_unlock_irqrestore(&d->lock, flags);
return;
@@ -626,7 +629,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
ataid_complete(d, (char *) (ahin+1));
break;
default:
- iprintk("unrecognized ata command %2.2Xh for %d.%d\n",
+ printk(KERN_INFO
+ "aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat,
be16_to_cpu(hin->major),
hin->minor);
@@ -686,7 +690,7 @@ aoecmd_ata_id(struct aoedev *d)
f = freeframe(d);
if (f == NULL) {
- eprintk("can't get a frame. This shouldn't happen.\n");
+ printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
return NULL;
}
@@ -732,14 +736,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
*/
aoemajor = be16_to_cpu(h->major);
if (aoemajor == 0xfff) {
- eprintk("Warning: shelf address is all ones. "
+ printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n");
return;
}
sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
- iprintk("e%ld.%d: minor number too large\n",
+ printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor);
return;
}
@@ -750,7 +754,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
d = aoedev_by_sysminor_m(sysminor, n);
if (d == NULL) {
- iprintk("device sysminor_m failure\n");
+ printk(KERN_INFO "aoe: device sysminor_m failure\n");
return;
}
@@ -767,7 +771,8 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
n = ch->scnt;
n = n ? n * 512 : DEFAULTBCNT;
if (n != d->maxbcnt) {
- iprintk("e%ld.%ld: setting %d byte data frames on %s\n",
+ printk(KERN_INFO
+ "aoe: e%ld.%ld: setting %d byte data frames on %s\n",
d->aoemajor, d->aoeminor, n, d->ifp->name);
d->maxbcnt = n;
}
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoedev.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoedev.c 2006-09-20 14:29:36.000000000 -0400
@@ -156,7 +156,7 @@ aoedev_by_sysminor_m(ulong sysminor, ulo
d = aoedev_newdev(bufcnt);
if (d == NULL) {
spin_unlock_irqrestore(&devlist_lock, flags);
- iprintk("aoedev_newdev failure.\n");
+ printk(KERN_INFO "aoe: aoedev_newdev failure.\n");
return NULL;
}
d->sysminor = sysminor;
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoemain.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoemain.c 2006-09-20 14:29:36.000000000 -0400
@@ -84,11 +84,11 @@ aoe_init(void)
goto net_fail;
ret = register_blkdev(AOE_MAJOR, DEVICE_NAME);
if (ret < 0) {
- eprintk("can't register major\n");
+ printk(KERN_ERR "aoe: can't register major\n");
goto blkreg_fail;
}
- iprintk("AoE v%s initialised.\n", VERSION);
+ printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
discover_timer(TINIT);
return 0;
@@ -101,7 +101,7 @@ aoe_init(void)
chr_fail:
aoedev_exit();
- iprintk("initialisation failure.\n");
+ printk(KERN_INFO "aoe: initialisation failure.\n");
return ret;
}
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoenet.c 2006-09-20 14:29:35.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoenet.c 2006-09-20 14:29:36.000000000 -0400
@@ -74,7 +74,7 @@ set_aoe_iflist(const char __user *user_s
return -EINVAL;
if (copy_from_user(aoe_iflist, user_str, size)) {
- iprintk("copy from user failed\n");
+ printk(KERN_INFO "aoe: copy from user failed\n");
return -EFAULT;
}
aoe_iflist[size] = 0x00;
@@ -132,7 +132,7 @@ aoenet_rcv(struct sk_buff *skb, struct n
if (n > NECODES)
n = 0;
if (net_ratelimit())
- eprintk("error packet from %d.%d; ecode=%d '%s'\n",
+ printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
be16_to_cpu(h->major), h->minor,
h->err, aoe_errlist[n]);
goto exit;
@@ -146,7 +146,7 @@ aoenet_rcv(struct sk_buff *skb, struct n
aoecmd_cfg_rsp(skb);
break;
default:
- iprintk("unknown cmd %d\n", h->cmd);
+ printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd);
}
exit:
dev_kfree_skb(skb);
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [12/14]: remove sysfs comment
[not found] <E1GQ6uv-0001qi-00@kokone>
` (10 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [14/14]: revert printk macros Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [13/14]: update driver version Ed L. Cashin
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Remove unecessary comment.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoeblk.c 2006-09-20 14:29:36.000000000 -0400
@@ -14,7 +14,6 @@
static kmem_cache_t *buf_pool_cache;
-/* add attributes for our block devices in sysfs */
static ssize_t aoedisk_show_state(struct gendisk * disk, char *page)
{
struct aoedev *d = disk->private_data;
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 2.6.18-rc4] aoe [13/14]: update driver version
[not found] <E1GQ6uv-0001qi-00@kokone>
` (11 preceding siblings ...)
2006-09-20 18:36 ` [PATCH 2.6.18-rc4] aoe [12/14]: remove sysfs comment Ed L. Cashin
@ 2006-09-20 18:36 ` Ed L. Cashin
12 siblings, 0 replies; 13+ messages in thread
From: Ed L. Cashin @ 2006-09-20 18:36 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Update aoe driver version number to 32.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
---
diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h
--- 2.6.18-rc4-orig/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoe.h 2006-09-20 14:29:36.000000000 -0400
@@ -1,5 +1,5 @@
/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
-#define VERSION "22"
+#define VERSION "32"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"
--
"Ed L. Cashin" <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 13+ messages in thread