* [PATCH 1/9] aoe: describe the behavior of the "err" character device
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
@ 2012-10-16 1:40 ` Ed Cashin
2012-10-16 1:42 ` [PATCH 2/9] aoe: print warning regarding a common reason for dropped transmits Ed Cashin
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:40 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoechr.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index ed57a89..2bf6273 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -39,6 +39,11 @@ struct ErrMsg {
};
static DEFINE_MUTEX(aoechr_mutex);
+
+/* A ring buffer of error messages, to be read through
+ * "/dev/etherd/err". When no messages are present,
+ * readers will block waiting for messages to appear.
+ */
static struct ErrMsg emsgs[NMSG];
static int emsgs_head_idx, emsgs_tail_idx;
static struct completion emsgs_comp;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/9] aoe: print warning regarding a common reason for dropped transmits
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
2012-10-16 1:40 ` [PATCH 1/9] aoe: describe the behavior of the "err" character device Ed Cashin
@ 2012-10-16 1:42 ` Ed Cashin
2012-10-17 22:09 ` Andrew Morton
2012-10-16 1:44 ` [PATCH 3/9] aoe: update cap on outstanding commands based on config query response Ed Cashin
` (6 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:42 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Dropped transmits are not common, but when they do occur, increasing
the transmit queue length often helps.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoenet.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 162c647..a1bb692 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -50,7 +50,11 @@ __setup("aoe_iflist=", aoe_iflist_setup);
static spinlock_t txlock;
static struct sk_buff_head skbtxq;
-/* enters with txlock held */
+/* enters with txlock held
+ *
+ * Use __must_hold(&txlock) for sparse when upcoming patch adds it to
+ * compiler.h.
+ */
static int
tx(void)
{
@@ -58,7 +62,10 @@ tx(void)
while ((skb = skb_dequeue(&skbtxq))) {
spin_unlock_irq(&txlock);
- dev_queue_xmit(skb);
+ if (dev_queue_xmit(skb) == NET_XMIT_DROP && net_ratelimit())
+ pr_warn("aoe: packet could not be sent on %s. %s\n",
+ skb->dev ? skb->dev->name : "netif",
+ "consider increasing tx_queue_len");
spin_lock_irq(&txlock);
}
return 0;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/9] aoe: update cap on outstanding commands based on config query response
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
2012-10-16 1:40 ` [PATCH 1/9] aoe: describe the behavior of the "err" character device Ed Cashin
2012-10-16 1:42 ` [PATCH 2/9] aoe: print warning regarding a common reason for dropped transmits Ed Cashin
@ 2012-10-16 1:44 ` Ed Cashin
2012-10-16 1:46 ` [PATCH 4/9] aoe: support the forgetting (flushing) of a user-specified AoE target Ed Cashin
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:44 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
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>
---
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 d2ed7f1..52f75c0 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 3804a0a..2bb8c7d 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;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/9] aoe: support the forgetting (flushing) of a user-specified AoE target
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (2 preceding siblings ...)
2012-10-16 1:44 ` [PATCH 3/9] aoe: update cap on outstanding commands based on config query response Ed Cashin
@ 2012-10-16 1:46 ` Ed Cashin
2012-10-16 1:48 ` [PATCH 5/9] aoe: support larger I/O requests via aoe_maxsectors module param Ed Cashin
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:46 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Users sometimes want to cause the aoe driver to forget a
particular previously discovered device when it is no longer
online. The aoetools provide an "aoe-flush" command that users
run to perform this administrative task. The changes below
provide the support needed in the driver.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoedev.c | 44 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 90e5b53..63b2660 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -241,6 +241,30 @@ aoedev_freedev(struct aoedev *d)
kfree(d);
}
+/* return whether the user asked for this particular
+ * device to be flushed
+ */
+static int
+user_req(char *s, size_t slen, struct aoedev *d)
+{
+ char *p;
+ size_t lim;
+
+ if (!d->gd)
+ return 0;
+ p = strrchr(d->gd->disk_name, '/');
+ if (!p)
+ p = d->gd->disk_name;
+ else
+ p += 1;
+ lim = sizeof(d->gd->disk_name);
+ lim -= p - d->gd->disk_name;
+ if (slen < lim)
+ lim = slen;
+
+ return !strncmp(s, p, lim);
+}
+
int
aoedev_flush(const char __user *str, size_t cnt)
{
@@ -249,6 +273,7 @@ aoedev_flush(const char __user *str, size_t cnt)
struct aoedev *rmd = NULL;
char buf[16];
int all = 0;
+ int specified = 0; /* flush a specific device */
if (cnt >= 3) {
if (cnt > sizeof buf)
@@ -256,26 +281,33 @@ aoedev_flush(const char __user *str, size_t cnt)
if (copy_from_user(buf, str, cnt))
return -EFAULT;
all = !strncmp(buf, "all", 3);
+ if (!all)
+ specified = 1;
}
spin_lock_irqsave(&devlist_lock, flags);
dd = &devlist;
while ((d = *dd)) {
spin_lock(&d->lock);
- if ((!all && (d->flags & DEVFL_UP))
+ if (specified) {
+ if (!user_req(buf, cnt, d))
+ goto skip;
+ } else if ((!all && (d->flags & DEVFL_UP))
|| (d->flags & (DEVFL_GDALLOC|DEVFL_NEWSIZE))
|| d->nopen
- || d->ref) {
- spin_unlock(&d->lock);
- dd = &d->next;
- continue;
- }
+ || d->ref)
+ goto skip;
+
*dd = d->next;
aoedev_downdev(d);
d->flags |= DEVFL_TKILL;
spin_unlock(&d->lock);
d->next = rmd;
rmd = d;
+ continue;
+skip:
+ spin_unlock(&d->lock);
+ dd = &d->next;
}
spin_unlock_irqrestore(&devlist_lock, flags);
while ((d = rmd)) {
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 5/9] aoe: support larger I/O requests via aoe_maxsectors module param
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (3 preceding siblings ...)
2012-10-16 1:46 ` [PATCH 4/9] aoe: support the forgetting (flushing) of a user-specified AoE target Ed Cashin
@ 2012-10-16 1:48 ` Ed Cashin
2012-10-16 1:50 ` [PATCH 6/9] aoe: "payload" sysfs file exports per-AoE-command data transfer size Ed Cashin
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:48 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
The GPFS filesystem is an example of an aoe user that requires the
aoe driver to support I/O request sizes larger than the default.
Most users will not need large I/O request sizes, because they would
need to be split up into multiple AoE commands anyway.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoeblk.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 00dfc50..d5aa3b8 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -16,11 +16,18 @@
#include <linux/netdevice.h>
#include <linux/mutex.h>
#include <linux/export.h>
+#include <linux/moduleparam.h>
#include "aoe.h"
static DEFINE_MUTEX(aoeblk_mutex);
static struct kmem_cache *buf_pool_cache;
+/* GPFS needs a larger value than the default. */
+static int aoe_maxsectors;
+module_param(aoe_maxsectors, int, 0644);
+MODULE_PARM_DESC(aoe_maxsectors,
+ "When nonzero, set the maximum number of sectors per I/O request");
+
static ssize_t aoedisk_show_state(struct device *dev,
struct device_attribute *attr, char *page)
{
@@ -248,6 +255,8 @@ aoeblk_gdalloc(void *vp)
d->blkq = gd->queue = q;
q->queuedata = d;
d->gd = gd;
+ if (aoe_maxsectors)
+ blk_queue_max_hw_sectors(q, aoe_maxsectors);
gd->major = AOE_MAJOR;
gd->first_minor = d->sysminor;
gd->fops = &aoe_bdops;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/9] aoe: "payload" sysfs file exports per-AoE-command data transfer size
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (4 preceding siblings ...)
2012-10-16 1:48 ` [PATCH 5/9] aoe: support larger I/O requests via aoe_maxsectors module param Ed Cashin
@ 2012-10-16 1:50 ` Ed Cashin
2012-10-16 1:52 ` [PATCH 7/9] aoe: cleanup: remove unused ata_scnt function Ed Cashin
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:50 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
The userland aoetools package includes an "aoe-stat" command that
can display a "payload size" column when the aoe driver exports
this information. Users can quickly see what amount of user data
is transferred inside each AoE command on the network, network
headers excluded.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoeblk.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index d5aa3b8..56736cd 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -98,6 +98,14 @@ static ssize_t aoedisk_show_fwver(struct device *dev,
return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
}
+static ssize_t aoedisk_show_payload(struct device *dev,
+ struct device_attribute *attr, char *page)
+{
+ struct gendisk *disk = dev_to_disk(dev);
+ struct aoedev *d = disk->private_data;
+
+ return snprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt);
+}
static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL);
static DEVICE_ATTR(mac, S_IRUGO, aoedisk_show_mac, NULL);
@@ -106,12 +114,14 @@ static struct device_attribute dev_attr_firmware_version = {
.attr = { .name = "firmware-version", .mode = S_IRUGO },
.show = aoedisk_show_fwver,
};
+static DEVICE_ATTR(payload, S_IRUGO, aoedisk_show_payload, NULL);
static struct attribute *aoe_attrs[] = {
&dev_attr_state.attr,
&dev_attr_mac.attr,
&dev_attr_netif.attr,
&dev_attr_firmware_version.attr,
+ &dev_attr_payload.attr,
NULL,
};
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 7/9] aoe: cleanup: remove unused ata_scnt function
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (5 preceding siblings ...)
2012-10-16 1:50 ` [PATCH 6/9] aoe: "payload" sysfs file exports per-AoE-command data transfer size Ed Cashin
@ 2012-10-16 1:52 ` Ed Cashin
2012-10-16 1:54 ` [PATCH 8/9] aoe: whitespace cleanup Ed Cashin
2012-10-16 1:56 ` [PATCH 9/9] aoe: update driver-internal version number to 60 Ed Cashin
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:52 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoecmd.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 2bb8c7d..82e16c4 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -552,16 +552,6 @@ sthtith(struct aoedev *d)
return 1;
}
-static inline unsigned char
-ata_scnt(unsigned char *packet) {
- struct aoe_hdr *h;
- struct aoe_atahdr *ah;
-
- h = (struct aoe_hdr *) packet;
- ah = (struct aoe_atahdr *) (h+1);
- return ah->scnt;
-}
-
static void
rexmit_timer(ulong vp)
{
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 8/9] aoe: whitespace cleanup
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (6 preceding siblings ...)
2012-10-16 1:52 ` [PATCH 7/9] aoe: cleanup: remove unused ata_scnt function Ed Cashin
@ 2012-10-16 1:54 ` Ed Cashin
2012-10-16 1:56 ` [PATCH 9/9] aoe: update driver-internal version number to 60 Ed Cashin
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:54 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoe.h | 2 +-
drivers/block/aoe/aoechr.c | 2 +-
drivers/block/aoe/aoecmd.c | 6 +++---
drivers/block/aoe/aoemain.c | 2 +-
drivers/block/aoe/aoenet.c | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 52f75c0..8e8da1c 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -151,7 +151,7 @@ struct aoedev {
struct work_struct work;/* disk create work struct */
struct gendisk *gd;
struct request_queue *blkq;
- struct hd_geometry geo;
+ struct hd_geometry geo;
sector_t ssize;
struct timer_list timer;
spinlock_t lock;
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 2bf6273..42e67ad 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -287,7 +287,7 @@ aoechr_init(void)
int n, i;
n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
- if (n < 0) {
+ if (n < 0) {
printk(KERN_ERR "aoe: can't register char device\n");
return n;
}
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 82e16c4..c491fba 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -978,7 +978,7 @@ ktiocomplete(struct frame *f)
pr_err("aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%d\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
-noskb: if (buf)
+noskb: if (buf)
clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
goto badrsp;
}
@@ -1191,7 +1191,7 @@ aoecmd_cfg(ushort aoemajor, unsigned char aoeminor)
aoecmd_cfg_pkts(aoemajor, aoeminor, &queue);
aoenet_xmit(&queue);
}
-
+
struct sk_buff *
aoecmd_ata_id(struct aoedev *d)
{
@@ -1230,7 +1230,7 @@ aoecmd_ata_id(struct aoedev *d)
return skb_clone(skb, GFP_ATOMIC);
}
-
+
static struct aoetgt *
addtgt(struct aoedev *d, char *addr, ulong nframes)
{
diff --git a/drivers/block/aoe/aoemain.c b/drivers/block/aoe/aoemain.c
index 04793c2..4b987c2 100644
--- a/drivers/block/aoe/aoemain.c
+++ b/drivers/block/aoe/aoemain.c
@@ -105,7 +105,7 @@ aoe_init(void)
aoechr_exit();
chr_fail:
aoedev_exit();
-
+
printk(KERN_INFO "aoe: initialisation failure.\n");
return ret;
}
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index a1bb692..461b6c4 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -126,8 +126,8 @@ aoenet_xmit(struct sk_buff_head *queue)
}
}
-/*
- * (1) len doesn't include the header by default. I want this.
+/*
+ * (1) len doesn't include the header by default. I want this.
*/
static int
aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev)
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 9/9] aoe: update driver-internal version number to 60
2012-10-16 1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
` (7 preceding siblings ...)
2012-10-16 1:54 ` [PATCH 8/9] aoe: whitespace cleanup Ed Cashin
@ 2012-10-16 1:56 ` Ed Cashin
8 siblings, 0 replies; 12+ messages in thread
From: Ed Cashin @ 2012-10-16 1:56 UTC (permalink / raw)
To: akpm; +Cc: ecashin, linux-kernel
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoe.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 8e8da1c..536942b 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2012 Coraid, Inc. See COPYING for GPL terms. */
-#define VERSION "50"
+#define VERSION "60"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread