Skip to contentSkip to conversation

AOE patches for 2.6.16

PATCH New Greg KH 1 participant 13 messages Mar 24, 2006

Subsystems (3)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 AOE patches for 2.6.16

Here are some ATA over Ethernet patches against your current git tree. They all have been in the -mm tree for a few months.

Please pull from:

	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/
or from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/

if it isn't synced up yet.

The full patch series will sent to the linux-kernel mailing list, if anyone wants to see them.

thanks,

greg k-h

 Documentation/aoe/mkdevs.sh |    2 
 Documentation/aoe/udev.txt  |    1 
 drivers/block/aoe/aoe.h     |   14 +--
 drivers/block/aoe/aoeblk.c  |   22 ++---
 drivers/block/aoe/aoechr.c  |   37 ++++++++
 drivers/block/aoe/aoecmd.c  |  187 +++++++++++++++++++++++++++++---------------
 drivers/block/aoe/aoedev.c  |   69 +++++++++++-----
 drivers/block/aoe/aoemain.c |    4 
 drivers/block/aoe/aoenet.c  |   22 +----
 9 files changed, 238 insertions(+), 120 deletions(-)

---------------

Ed L Cashin:
aoe [1/8]: zero packet data after skb allocation
aoe [2/8]: support dynamic resizing of AoE devices
aoe [3/8]: increase allowed outstanding packets
aoe [4/8]: use less confusing driver name
aoe [5/8]: allow network interface migration on packet retransmit aoe [6/8]: update device information on last close
aoe [7/8]: update driver compatibility string
aoe [8/8]: update driver version number
aoe: do not stop retransmit timer when device goes down aoe [1/3]: support multiple AoE listeners
aoe [2/3]: don't request ATA device ID on ATA error aoe [3/3]: update version to 22

author
#11 lore raw

PATCH 11/12 aoe [2/3]: don't request ATA device ID on ATA error

In reply to Greg KH

On an ATA error response, take the device down instead of sending another ATA device identify command.

---

 drivers/block/aoe/aoecmd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

9d41965b783474dba9fcf3eb02e5eb60540e6ff6

drivers/block/aoe/aoecmd.c +2 -1
index 207aabc..39da28d 100644
@@ -517,6 +517,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 	ahout = (struct aoe_atahdr *) (f->data + sizeof(struct aoe_hdr));
 	buf = f->buf;
 
+	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", 
@@ -549,7 +551,6 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 				return;
 			}
 			ataid_complete(d, (char *) (ahin+1));
-			d->flags &= ~DEVFL_PAUSE;
 			break;
 		default:
 			printk(KERN_INFO "aoe: aoecmd_ata_rsp: unrecognized "
Signature · 1 line
1.2.4
author
#6 lore raw

PATCH 6/12 aoe [6/8]: update device information on last close

In reply to Greg KH

Instead of making the user wait or do it manually, refresh device information on its last close by issuing a config query to the device.

---

 drivers/block/aoe/aoeblk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

5f7702fd737d14de3ed06a94a1655be9d43f7e35

drivers/block/aoe/aoeblk.c +1 -1
index 039c091..32fea55 100644
@@ -109,7 +109,7 @@ aoeblk_release(struct inode *inode, stru
 
 	spin_lock_irqsave(&d->lock, flags);
 
-	if (--d->nopen == 0 && !(d->flags & DEVFL_UP)) {
+	if (--d->nopen == 0) {
 		spin_unlock_irqrestore(&d->lock, flags);
 		aoecmd_cfg(d->aoemajor, d->aoeminor);
 		return 0;
Signature · 1 line
1.2.4
author
#12 lore raw

PATCH 12/12 aoe [3/3]: update version to 22

In reply to Greg KH

Increase version number to 22.

---

 drivers/block/aoe/aoe.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

0fdf109676d1eda4ff8199a9a3ee3f11c555c1b3

drivers/block/aoe/aoe.h +1 -1
index 7ff5f94..6eebcb7 100644
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
-#define VERSION "21"
+#define VERSION "22"
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
Signature · 1 line
1.2.4
author
#8 lore raw

PATCH 8/12 aoe [8/8]: update driver version number

In reply to Greg KH

Update aoe driver version number.

---

 drivers/block/aoe/aoe.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

a712c0efbffb09f7b837577e29d0efb043fea0ea

drivers/block/aoe/aoe.h +1 -1
index bb7dd91..7ff5f94 100644
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
-#define VERSION "14"
+#define VERSION "21"
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
Signature · 1 line
1.2.4
author
#4 lore raw

PATCH 4/12 aoe [4/8]: use less confusing driver name

In reply to Greg KH

Users were confused by the driver being called "aoe-2.6-$version". This form looks less like a Linux kernel version number.

---

 drivers/block/aoe/aoemain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

c42b24cae5c9fe1ae1f9bb9dea020e1a788fab4d

drivers/block/aoe/aoemain.c +1 -1
index 387588a..f39d5ba 100644
@@ -89,7 +89,7 @@ aoe_init(void)
 	}
 
 	printk(KERN_INFO
-	       "aoe: aoe_init: AoE v2.6-%s initialised.\n",
+	       "aoe: aoe_init: AoE v%s initialised.\n",
 	       VERSION);
 	discover_timer(TINIT);
 	return 0;
Signature · 1 line
1.2.4
author
#1 lore raw

PATCH 1/12 aoe [1/8]: zero packet data after skb allocation

In reply to Greg KH

Zero the data in new socket buffers to prevent leaking information.

---

 drivers/block/aoe/aoecmd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

50bba752ca0a740a6ba9eb96d61ef7bbdfe405cf

drivers/block/aoe/aoecmd.c +1 -0
index 326ca38..4ab01ce 100644
@@ -28,6 +28,7 @@ new_skb(struct net_device *if_dev, ulong
 		skb->protocol = __constant_htons(ETH_P_AOE);
 		skb->priority = 0;
 		skb_put(skb, len);
+		memset(skb->head, 0, len);
 		skb->next = skb->prev = NULL;
 
 		/* tell the network layer not to perform IP checksums
Signature · 1 line
1.2.4
author
#2 lore raw

PATCH 2/12 aoe [2/8]: support dynamic resizing of AoE devices

Allow the driver to recognize AoE devices that have changed size. Devices not in use are updated automatically, and devices that are in use are updated at user request.

---

 Documentation/aoe/mkdevs.sh |    2 
 Documentation/aoe/udev.txt  |    1 
 drivers/block/aoe/aoe.h     |   12 ++-
 drivers/block/aoe/aoeblk.c  |   22 ++---
 drivers/block/aoe/aoechr.c  |   37 +++++++++
 drivers/block/aoe/aoecmd.c  |  177 +++++++++++++++++++++++++++++--------------
 drivers/block/aoe/aoedev.c  |   69 ++++++++++++-----
 7 files changed, 223 insertions(+), 97 deletions(-)

3ae1c24e395b2b65326439622223d88d92bfa03a

Documentation/aoe/mkdevs.sh +2 -0
index ec5a6de..97374aa 100644
@@ -27,6 +27,8 @@ rm -f $dir/discover
 mknod -m 0200 $dir/discover c $MAJOR 3
 rm -f $dir/interfaces
 mknod -m 0200 $dir/interfaces c $MAJOR 4
+rm -f $dir/revalidate
+mknod -m 0200 $dir/revalidate c $MAJOR 5
 
 export n_partitions
 mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`
Documentation/aoe/udev.txt +1 -0
index ab39d8b..a7ed1dc 100644
@@ -18,6 +18,7 @@
 SUBSYSTEM="aoe", KERNEL="discover",	NAME="etherd/%k", GROUP="disk", MODE="0220"
 SUBSYSTEM="aoe", KERNEL="err",		NAME="etherd/%k", GROUP="disk", MODE="0440"
 SUBSYSTEM="aoe", KERNEL="interfaces",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM="aoe", KERNEL="revalidate",	NAME="etherd/%k", GROUP="disk", MODE="0220"
 
 # aoe block devices     
 KERNEL="etherd*",       NAME="%k", GROUP="disk"
drivers/block/aoe/aoe.h +7 -5
index 881c48d..bb7dd91 100644
@@ -75,8 +75,9 @@ enum {
 	DEVFL_TKILL = (1<<1),	/* flag for timer to know when to kill self */
 	DEVFL_EXT = (1<<2),	/* device accepts lba48 commands */
 	DEVFL_CLOSEWAIT = (1<<3), /* device is waiting for all closes to revalidate */
-	DEVFL_WC_UPDATE = (1<<4), /* this device needs to update write cache status */
-	DEVFL_WORKON = (1<<4),
+	DEVFL_GDALLOC = (1<<4),	/* need to alloc gendisk */
+	DEVFL_PAUSE = (1<<5),
+	DEVFL_NEWSIZE = (1<<6),	/* need to update dev size in block layer */
 
 	BUFFL_FAIL = 1,
 };
@@ -152,16 +153,17 @@ void aoechr_exit(void);
 void aoechr_error(char *);
 
 void aoecmd_work(struct aoedev *d);
-void aoecmd_cfg(ushort, unsigned char);
+void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor);
 void aoecmd_ata_rsp(struct sk_buff *);
 void aoecmd_cfg_rsp(struct sk_buff *);
+void aoecmd_sleepwork(void *vp);
 
 int aoedev_init(void);
 void aoedev_exit(void);
 struct aoedev *aoedev_by_aoeaddr(int maj, int min);
+struct aoedev *aoedev_by_sysminor_m(ulong sysminor, ulong bufcnt);
 void aoedev_downdev(struct aoedev *d);
-struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong);
-int aoedev_busy(void);
+int aoedev_isbusy(struct aoedev *d);
 
 int aoenet_init(void);
 void aoenet_exit(void);
drivers/block/aoe/aoeblk.c +9 -13
index c05ee8b..039c091 100644
@@ -22,7 +22,9 @@ static ssize_t aoedisk_show_state(struct
 	return snprintf(page, PAGE_SIZE,
 			"%s%s\n",
 			(d->flags & DEVFL_UP) ? "up" : "down",
-			(d->flags & DEVFL_CLOSEWAIT) ? ",closewait" : "");
+			(d->flags & DEVFL_PAUSE) ? ",paused" :
+			(d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : "");
+	/* I'd rather see nopen exported so we can ditch closewait */
 }
 static ssize_t aoedisk_show_mac(struct gendisk * disk, char *page)
 {
@@ -107,8 +109,7 @@ aoeblk_release(struct inode *inode, stru
 
 	spin_lock_irqsave(&d->lock, flags);
 
-	if (--d->nopen == 0 && (d->flags & DEVFL_CLOSEWAIT)) {
-		d->flags &= ~DEVFL_CLOSEWAIT;
+	if (--d->nopen == 0 && !(d->flags & DEVFL_UP)) {
 		spin_unlock_irqrestore(&d->lock, flags);
 		aoecmd_cfg(d->aoemajor, d->aoeminor);
 		return 0;
@@ -158,14 +159,14 @@ aoeblk_make_request(request_queue_t *q, 
 	}
 
 	list_add_tail(&buf->bufs, &d->bufq);
-	aoecmd_work(d);
 
+	aoecmd_work(d);
 	sl = d->sendq_hd;
 	d->sendq_hd = d->sendq_tl = NULL;
 
 	spin_unlock_irqrestore(&d->lock, flags);
-
 	aoenet_xmit(sl);
+
 	return 0;
 }
 
@@ -205,7 +206,7 @@ aoeblk_gdalloc(void *vp)
 		printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate disk "
 			"structure for %ld.%ld\n", d->aoemajor, d->aoeminor);
 		spin_lock_irqsave(&d->lock, flags);
-		d->flags &= ~DEVFL_WORKON;
+		d->flags &= ~DEVFL_GDALLOC;
 		spin_unlock_irqrestore(&d->lock, flags);
 		return;
 	}
@@ -218,7 +219,7 @@ aoeblk_gdalloc(void *vp)
 			"for %ld.%ld\n", d->aoemajor, d->aoeminor);
 		put_disk(gd);
 		spin_lock_irqsave(&d->lock, flags);
-		d->flags &= ~DEVFL_WORKON;
+		d->flags &= ~DEVFL_GDALLOC;
 		spin_unlock_irqrestore(&d->lock, flags);
 		return;
 	}
@@ -235,18 +236,13 @@ aoeblk_gdalloc(void *vp)
 
 	gd->queue = &d->blkq;
 	d->gd = gd;
-	d->flags &= ~DEVFL_WORKON;
+	d->flags &= ~DEVFL_GDALLOC;
 	d->flags |= DEVFL_UP;
 
 	spin_unlock_irqrestore(&d->lock, flags);
 
 	add_disk(gd);
 	aoedisk_add_sysfs(d);
-	
-	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)d->ssize);
 }
 
 void
drivers/block/aoe/aoechr.c +37 -0
index 41ae0ed..5327f55 100644
@@ -13,6 +13,7 @@ enum {
 	MINOR_ERR = 2,
 	MINOR_DISCOVER,
 	MINOR_INTERFACES,
+	MINOR_REVALIDATE,
 	MSGSZ = 2048,
 	NARGS = 10,
 	NMSG = 100,		/* message backlog to retain */
@@ -41,6 +42,7 @@ static struct aoe_chardev chardevs[] = {
 	{ MINOR_ERR, "err" },
 	{ MINOR_DISCOVER, "discover" },
 	{ MINOR_INTERFACES, "interfaces" },
+	{ MINOR_REVALIDATE, "revalidate" },
 };
 
 static int
@@ -62,6 +64,39 @@ interfaces(const char __user *str, size_
 	return 0;
 }
 
+static int
+revalidate(const char __user *str, size_t size)
+{
+	int major, minor, n;
+	ulong flags;
+	struct aoedev *d;
+	char buf[16];
+
+	if (size >= sizeof buf)
+		return -EINVAL;
+	buf[sizeof buf - 1] = '\0';
+	if (copy_from_user(buf, str, size))
+		return -EFAULT;
+
+	/* 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__);
+		return -EINVAL;
+	}
+	d = aoedev_by_aoeaddr(major, minor);
+	if (!d)
+		return -EINVAL;
+
+	spin_lock_irqsave(&d->lock, flags);
+	d->flags |= DEVFL_PAUSE;
+	spin_unlock_irqrestore(&d->lock, flags);
+	aoecmd_cfg(major, minor);
+
+	return 0;
+}
+
 void
 aoechr_error(char *msg)
 {
@@ -114,6 +149,8 @@ aoechr_write(struct file *filp, const ch
 	case MINOR_INTERFACES:
 		ret = interfaces(buf, cnt);
 		break;
+	case MINOR_REVALIDATE:
+		ret = revalidate(buf, cnt);
 	}
 	if (ret == 0)
 		ret = cnt;
drivers/block/aoe/aoecmd.c +119 -58

266 lines not on this page · raw message

drivers/block/aoe/aoedev.c +48 -21

128 lines not on this page · raw message

Signature · 1 line
1.2.4
author
#7 lore raw

PATCH 7/12 aoe [7/8]: update driver compatibility string

In reply to Greg KH

The aoe driver is not compatible with 2.6 kernels older than 2.6.2.

---

 drivers/block/aoe/aoemain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

02edb05e6310d3acbb26ffb038f0eb819274e6d0

drivers/block/aoe/aoemain.c +1 -1
index f39d5ba..de08491 100644
@@ -11,7 +11,7 @@
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Sam Hopkins <[email protected]>");
-MODULE_DESCRIPTION("AoE block/char driver for 2.6.[0-9]+");
+MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels");
 MODULE_VERSION(VERSION);
 
 enum { TINIT, TRUN, TKILL };
Signature · 1 line
1.2.4
author
#3 lore raw

PATCH 3/12 aoe [3/8]: increase allowed outstanding packets

In reply to Greg KH

Increase the number of AoE packets per device that can be outstanding at one time, increasing performance.

---

 drivers/block/aoe/aoecmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

eaf0a3cbe5d0713eca3278b3b18f08dba4fb914b

drivers/block/aoe/aoecmd.c +1 -1
index 150eb78..34b8c8c 100644
@@ -647,7 +647,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
 	ulong flags, sysminor, aoemajor;
 	u16 bufcnt;
 	struct sk_buff *sl;
-	enum { MAXFRAMES = 8 };
+	enum { MAXFRAMES = 16 };
 
 	h = (struct aoe_hdr *) skb->mac.raw;
 	ch = (struct aoe_cfghdr *) (h+1);
Signature · 1 line
1.2.4
author
#5 lore raw

PATCH 5/12 aoe [5/8]: allow network interface migration on packet retransmit

In reply to Greg KH

Retransmit to the current network interface for an AoE device.

---

 drivers/block/aoe/aoecmd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

2dd5e42269b6f71db8ca519e401ef1e6615b3705

drivers/block/aoe/aoecmd.c +2 -0
index 34b8c8c..22bebf8 100644
@@ -286,6 +286,8 @@ rexmit(struct aoedev *d, struct frame *f
 	h = (struct aoe_hdr *) f->data;
 	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) {
Signature · 1 line
1.2.4
author
#9 lore raw

PATCH 9/12 aoe: do not stop retransmit timer when device goes down

In reply to Greg KH

This patch is a bugfix that follows and depends on the eight aoe driver patches sent January 19th.

---

 drivers/block/aoe/aoecmd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

1c6f3fcac03a16c901ee5acd58100bff963add6d

drivers/block/aoe/aoecmd.c +2 -2
index 22bebf8..207aabc 100644
@@ -331,7 +331,7 @@ rexmit_timer(ulong vp)
 	spin_lock_irqsave(&d->lock, flags);
 
 	if (d->flags & DEVFL_TKILL) {
-tdie:		spin_unlock_irqrestore(&d->lock, flags);
+		spin_unlock_irqrestore(&d->lock, flags);
 		return;
 	}
 	f = d->frames;
@@ -342,7 +342,7 @@ tdie:		spin_unlock_irqrestore(&d->lock, 
 			n /= HZ;
 			if (n > MAXWAIT) { /* waited too long.  device failure. */
 				aoedev_downdev(d);
-				goto tdie;
+				break;
 			}
 			rexmit(d, f);
 		}
Signature · 1 line
1.2.4
author
#10 lore raw

PATCH 10/12 aoe [1/3]: support multiple AoE listeners

Always clone incoming skbs, allowing other AoE listeners to exist in the kernel.

---

 drivers/block/aoe/aoenet.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

5dc401ee74c5d6a24867acd8302c55da9ae4f0ce

drivers/block/aoe/aoenet.c +5 -17
index 4be9769..fdff774 100644
@@ -92,18 +92,6 @@ mac_addr(char addr[6])
 	return __be64_to_cpu(n);
 }
 
-static struct sk_buff *
-skb_check(struct sk_buff *skb)
-{
-	if (skb_is_nonlinear(skb))
-	if ((skb = skb_share_check(skb, GFP_ATOMIC)))
-	if (skb_linearize(skb, GFP_ATOMIC) < 0) {
-		dev_kfree_skb(skb);
-		return NULL;
-	}
-	return skb;
-}
-
 void
 aoenet_xmit(struct sk_buff *sl)
 {
@@ -125,14 +113,14 @@ aoenet_rcv(struct sk_buff *skb, struct n
 	struct aoe_hdr *h;
 	u32 n;
 
-	skb = skb_check(skb);
-	if (!skb)
+	skb = skb_share_check(skb, GFP_ATOMIC);
+	if (skb == NULL)
 		return 0;
-
+	if (skb_is_nonlinear(skb))
+	if (skb_linearize(skb, GFP_ATOMIC) < 0)
+		goto exit;
 	if (!is_aoe_netif(ifp))
 		goto exit;
-
-	//skb->len += ETH_HLEN;	/* (1) */
 	skb_push(skb, ETH_HLEN);	/* (1) */
 
 	h = (struct aoe_hdr *) skb->mac.raw;
Signature · 1 line
1.2.4