diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-04 10:08:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-04 10:08:10 -0400 |
commit | a1d4ebdbb3806e9d2c37f32a043ec54f4534977c (patch) | |
tree | 44b2ce77adcb79849d8bbefbc254b03fccd6a394 | |
parent | 742b0c905d970fd60893cce14a3c68b523504bc4 (diff) | |
parent | 0e57c7166675a86293f150d5ef7779edd629fe2a (diff) |
Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/
-rw-r--r-- | Documentation/aoe/aoe.txt | 40 | ||||
-rw-r--r-- | Documentation/aoe/status.sh | 4 | ||||
-rw-r--r-- | drivers/block/aoe/aoe.h | 2 | ||||
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 13 | ||||
-rw-r--r-- | drivers/block/aoe/aoedev.c | 11 | ||||
-rw-r--r-- | drivers/block/aoe/aoenet.c | 17 |
6 files changed, 70 insertions, 17 deletions
diff --git a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt index 43e50108d0e2..3a4dbe4663c9 100644 --- a/Documentation/aoe/aoe.txt +++ b/Documentation/aoe/aoe.txt | |||
@@ -4,6 +4,16 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... | |||
4 | 4 | ||
5 | It has many tips and hints! | 5 | It has many tips and hints! |
6 | 6 | ||
7 | The aoetools are userland programs that are designed to work with this | ||
8 | driver. The aoetools are on sourceforge. | ||
9 | |||
10 | http://aoetools.sourceforge.net/ | ||
11 | |||
12 | The scripts in this Documentation/aoe directory are intended to | ||
13 | document the use of the driver and are not necessary if you install | ||
14 | the aoetools. | ||
15 | |||
16 | |||
7 | CREATING DEVICE NODES | 17 | CREATING DEVICE NODES |
8 | 18 | ||
9 | Users of udev should find the block device nodes created | 19 | Users of udev should find the block device nodes created |
@@ -35,14 +45,15 @@ USING DEVICE NODES | |||
35 | 45 | ||
36 | "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to | 46 | "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to |
37 | limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from | 47 | limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from |
38 | untrusted networks should be ignored as a matter of security. | 48 | untrusted networks should be ignored as a matter of security. See |
49 | also the aoe_iflist driver option described below. | ||
39 | 50 | ||
40 | "echo > /dev/etherd/discover" tells the driver to find out what AoE | 51 | "echo > /dev/etherd/discover" tells the driver to find out what AoE |
41 | devices are available. | 52 | devices are available. |
42 | 53 | ||
43 | These character devices may disappear and be replaced by sysfs | 54 | These character devices may disappear and be replaced by sysfs |
44 | counterparts, so distribution maintainers are encouraged to create | 55 | counterparts. Using the commands in aoetools insulates users from |
45 | scripts that use these devices. | 56 | these implementation details. |
46 | 57 | ||
47 | The block devices are named like this: | 58 | The block devices are named like this: |
48 | 59 | ||
@@ -66,7 +77,8 @@ USING SYSFS | |||
66 | through which we are communicating with the remote AoE device. | 77 | through which we are communicating with the remote AoE device. |
67 | 78 | ||
68 | There is a script in this directory that formats this information | 79 | There is a script in this directory that formats this information |
69 | in a convenient way. | 80 | in a convenient way. Users with aoetools can use the aoe-stat |
81 | command. | ||
70 | 82 | ||
71 | root@makki root# sh Documentation/aoe/status.sh | 83 | root@makki root# sh Documentation/aoe/status.sh |
72 | e10.0 eth3 up | 84 | e10.0 eth3 up |
@@ -89,3 +101,23 @@ USING SYSFS | |||
89 | e4.7 eth1 up | 101 | e4.7 eth1 up |
90 | e4.8 eth1 up | 102 | e4.8 eth1 up |
91 | e4.9 eth1 up | 103 | e4.9 eth1 up |
104 | |||
105 | Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver | ||
106 | option discussed below) instead of /dev/etherd/interfaces to limit | ||
107 | AoE traffic to the network interfaces in the given | ||
108 | whitespace-separated list. Unlike the old character device, the | ||
109 | sysfs entry can be read from as well as written to. | ||
110 | |||
111 | It's helpful to trigger discovery after setting the list of allowed | ||
112 | interfaces. The aoetools package provides an aoe-discover script | ||
113 | for this purpose. You can also directly use the | ||
114 | /dev/etherd/discover special file described above. | ||
115 | |||
116 | DRIVER OPTIONS | ||
117 | |||
118 | There is a boot option for the built-in aoe driver and a | ||
119 | corresponding module parameter, aoe_iflist. Without this option, | ||
120 | all network interfaces may be used for ATA over Ethernet. Here is a | ||
121 | usage example for the module parameter. | ||
122 | |||
123 | modprobe aoe_iflist="eth1 eth3" | ||
diff --git a/Documentation/aoe/status.sh b/Documentation/aoe/status.sh index 6628116d4a9f..751f3be514b8 100644 --- a/Documentation/aoe/status.sh +++ b/Documentation/aoe/status.sh | |||
@@ -14,10 +14,6 @@ test ! -d "$sysd/block" && { | |||
14 | echo "$me Error: sysfs is not mounted" 1>&2 | 14 | echo "$me Error: sysfs is not mounted" 1>&2 |
15 | exit 1 | 15 | exit 1 |
16 | } | 16 | } |
17 | test -z "`lsmod | grep '^aoe'`" && { | ||
18 | echo "$me Error: aoe module is not loaded" 1>&2 | ||
19 | exit 1 | ||
20 | } | ||
21 | 17 | ||
22 | for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do | 18 | for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do |
23 | # maybe ls comes up empty, so we use "end" | 19 | # maybe ls comes up empty, so we use "end" |
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index aa8b547ffafa..721ba8086043 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ | 1 | /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ |
2 | #define VERSION "6" | 2 | #define VERSION "10" |
3 | #define AOE_MAJOR 152 | 3 | #define AOE_MAJOR 152 |
4 | #define DEVICE_NAME "aoe" | 4 | #define DEVICE_NAME "aoe" |
5 | 5 | ||
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 4780f7926d42..0e97fcb9f3a1 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page) | |||
37 | 37 | ||
38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); | 38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); |
39 | } | 39 | } |
40 | /* firmware version */ | ||
41 | static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page) | ||
42 | { | ||
43 | struct aoedev *d = disk->private_data; | ||
44 | |||
45 | return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver); | ||
46 | } | ||
40 | 47 | ||
41 | static struct disk_attribute disk_attr_state = { | 48 | static struct disk_attribute disk_attr_state = { |
42 | .attr = {.name = "state", .mode = S_IRUGO }, | 49 | .attr = {.name = "state", .mode = S_IRUGO }, |
@@ -50,6 +57,10 @@ static struct disk_attribute disk_attr_netif = { | |||
50 | .attr = {.name = "netif", .mode = S_IRUGO }, | 57 | .attr = {.name = "netif", .mode = S_IRUGO }, |
51 | .show = aoedisk_show_netif | 58 | .show = aoedisk_show_netif |
52 | }; | 59 | }; |
60 | static struct disk_attribute disk_attr_fwver = { | ||
61 | .attr = {.name = "firmware-version", .mode = S_IRUGO }, | ||
62 | .show = aoedisk_show_fwver | ||
63 | }; | ||
53 | 64 | ||
54 | static void | 65 | static void |
55 | aoedisk_add_sysfs(struct aoedev *d) | 66 | aoedisk_add_sysfs(struct aoedev *d) |
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d) | |||
57 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); | 68 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); |
58 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); | 69 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); |
59 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); | 70 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); |
71 | sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr); | ||
60 | } | 72 | } |
61 | void | 73 | void |
62 | aoedisk_rm_sysfs(struct aoedev *d) | 74 | aoedisk_rm_sysfs(struct aoedev *d) |
@@ -64,6 +76,7 @@ aoedisk_rm_sysfs(struct aoedev *d) | |||
64 | sysfs_remove_link(&d->gd->kobj, "state"); | 76 | sysfs_remove_link(&d->gd->kobj, "state"); |
65 | sysfs_remove_link(&d->gd->kobj, "mac"); | 77 | sysfs_remove_link(&d->gd->kobj, "mac"); |
66 | sysfs_remove_link(&d->gd->kobj, "netif"); | 78 | sysfs_remove_link(&d->gd->kobj, "netif"); |
79 | sysfs_remove_link(&d->gd->kobj, "firmware-version"); | ||
67 | } | 80 | } |
68 | 81 | ||
69 | static int | 82 | static int |
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index ec16c64dd114..6e231c5a1199 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu | |||
109 | spin_lock_irqsave(&devlist_lock, flags); | 109 | spin_lock_irqsave(&devlist_lock, flags); |
110 | 110 | ||
111 | for (d=devlist; d; d=d->next) | 111 | for (d=devlist; d; d=d->next) |
112 | if (d->sysminor == sysminor | 112 | if (d->sysminor == sysminor) |
113 | || memcmp(d->addr, addr, sizeof d->addr) == 0) | ||
114 | break; | 113 | break; |
115 | 114 | ||
116 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { | 115 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { |
117 | spin_unlock_irqrestore(&devlist_lock, flags); | 116 | spin_unlock_irqrestore(&devlist_lock, flags); |
118 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); | 117 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); |
119 | return NULL; | 118 | return NULL; |
120 | } | 119 | } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */ |
121 | 120 | ||
122 | spin_unlock_irqrestore(&devlist_lock, flags); | 121 | spin_unlock_irqrestore(&devlist_lock, flags); |
123 | spin_lock_irqsave(&d->lock, flags); | 122 | spin_lock_irqsave(&d->lock, flags); |
124 | 123 | ||
125 | d->ifp = ifp; | 124 | d->ifp = ifp; |
126 | 125 | memcpy(d->addr, addr, sizeof d->addr); | |
127 | if (d->sysminor != sysminor | 126 | if ((d->flags & DEVFL_UP) == 0) { |
128 | || (d->flags & DEVFL_UP) == 0) { | ||
129 | aoedev_downdev(d); /* flushes outstanding frames */ | 127 | aoedev_downdev(d); /* flushes outstanding frames */ |
130 | memcpy(d->addr, addr, sizeof d->addr); | ||
131 | d->sysminor = sysminor; | 128 | d->sysminor = sysminor; |
132 | d->aoemajor = AOEMAJOR(sysminor); | 129 | d->aoemajor = AOEMAJOR(sysminor); |
133 | d->aoeminor = AOEMINOR(sysminor); | 130 | d->aoeminor = AOEMINOR(sysminor); |
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index bc92aacb6dad..9e6f51c528b0 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/hdreg.h> | 7 | #include <linux/hdreg.h> |
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
10 | #include <linux/moduleparam.h> | ||
10 | #include "aoe.h" | 11 | #include "aoe.h" |
11 | 12 | ||
12 | #define NECODES 5 | 13 | #define NECODES 5 |
@@ -26,6 +27,19 @@ enum { | |||
26 | }; | 27 | }; |
27 | 28 | ||
28 | static char aoe_iflist[IFLISTSZ]; | 29 | static char aoe_iflist[IFLISTSZ]; |
30 | module_param_string(aoe_iflist, aoe_iflist, IFLISTSZ, 0600); | ||
31 | MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"\n"); | ||
32 | |||
33 | #ifndef MODULE | ||
34 | static int __init aoe_iflist_setup(char *str) | ||
35 | { | ||
36 | strncpy(aoe_iflist, str, IFLISTSZ); | ||
37 | aoe_iflist[IFLISTSZ - 1] = '\0'; | ||
38 | return 1; | ||
39 | } | ||
40 | |||
41 | __setup("aoe_iflist=", aoe_iflist_setup); | ||
42 | #endif | ||
29 | 43 | ||
30 | int | 44 | int |
31 | is_aoe_netif(struct net_device *ifp) | 45 | is_aoe_netif(struct net_device *ifp) |
@@ -36,7 +50,8 @@ is_aoe_netif(struct net_device *ifp) | |||
36 | if (aoe_iflist[0] == '\0') | 50 | if (aoe_iflist[0] == '\0') |
37 | return 1; | 51 | return 1; |
38 | 52 | ||
39 | for (p = aoe_iflist; *p; p = q + strspn(q, WHITESPACE)) { | 53 | p = aoe_iflist + strspn(aoe_iflist, WHITESPACE); |
54 | for (; *p; p = q + strspn(q, WHITESPACE)) { | ||
40 | q = p + strcspn(p, WHITESPACE); | 55 | q = p + strcspn(p, WHITESPACE); |
41 | if (q != p) | 56 | if (q != p) |
42 | len = q - p; | 57 | len = q - p; |