diff options
Diffstat (limited to 'Documentation/admin-guide')
-rw-r--r-- | Documentation/admin-guide/aoe/aoe.rst | 150 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/autoload.sh | 17 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/examples.rst | 23 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/index.rst | 17 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/status.sh | 30 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/todo.rst | 17 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/udev-install.sh | 33 | ||||
-rw-r--r-- | Documentation/admin-guide/aoe/udev.txt | 26 | ||||
-rw-r--r-- | Documentation/admin-guide/index.rst | 1 |
9 files changed, 314 insertions, 0 deletions
diff --git a/Documentation/admin-guide/aoe/aoe.rst b/Documentation/admin-guide/aoe/aoe.rst new file mode 100644 index 000000000000..a05e751363a0 --- /dev/null +++ b/Documentation/admin-guide/aoe/aoe.rst | |||
@@ -0,0 +1,150 @@ | |||
1 | Introduction | ||
2 | ============ | ||
3 | |||
4 | ATA over Ethernet is a network protocol that provides simple access to | ||
5 | block storage on the LAN. | ||
6 | |||
7 | http://support.coraid.com/documents/AoEr11.txt | ||
8 | |||
9 | The EtherDrive (R) HOWTO for 2.6 and 3.x kernels is found at ... | ||
10 | |||
11 | http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO.html | ||
12 | |||
13 | It has many tips and hints! Please see, especially, recommended | ||
14 | tunings for virtual memory: | ||
15 | |||
16 | http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO-5.html#ss5.19 | ||
17 | |||
18 | The aoetools are userland programs that are designed to work with this | ||
19 | driver. The aoetools are on sourceforge. | ||
20 | |||
21 | http://aoetools.sourceforge.net/ | ||
22 | |||
23 | The scripts in this Documentation/admin-guide/aoe directory are intended to | ||
24 | document the use of the driver and are not necessary if you install | ||
25 | the aoetools. | ||
26 | |||
27 | |||
28 | Creating Device Nodes | ||
29 | ===================== | ||
30 | |||
31 | Users of udev should find the block device nodes created | ||
32 | automatically, but to create all the necessary device nodes, use the | ||
33 | udev configuration rules provided in udev.txt (in this directory). | ||
34 | |||
35 | There is a udev-install.sh script that shows how to install these | ||
36 | rules on your system. | ||
37 | |||
38 | There is also an autoload script that shows how to edit | ||
39 | /etc/modprobe.d/aoe.conf to ensure that the aoe module is loaded when | ||
40 | necessary. Preloading the aoe module is preferable to autoloading, | ||
41 | however, because AoE discovery takes a few seconds. It can be | ||
42 | confusing when an AoE device is not present the first time the a | ||
43 | command is run but appears a second later. | ||
44 | |||
45 | Using Device Nodes | ||
46 | ================== | ||
47 | |||
48 | "cat /dev/etherd/err" blocks, waiting for error diagnostic output, | ||
49 | like any retransmitted packets. | ||
50 | |||
51 | "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to | ||
52 | limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from | ||
53 | untrusted networks should be ignored as a matter of security. See | ||
54 | also the aoe_iflist driver option described below. | ||
55 | |||
56 | "echo > /dev/etherd/discover" tells the driver to find out what AoE | ||
57 | devices are available. | ||
58 | |||
59 | In the future these character devices may disappear and be replaced | ||
60 | by sysfs counterparts. Using the commands in aoetools insulates | ||
61 | users from these implementation details. | ||
62 | |||
63 | The block devices are named like this:: | ||
64 | |||
65 | e{shelf}.{slot} | ||
66 | e{shelf}.{slot}p{part} | ||
67 | |||
68 | ... so that "e0.2" is the third blade from the left (slot 2) in the | ||
69 | first shelf (shelf address zero). That's the whole disk. The first | ||
70 | partition on that disk would be "e0.2p1". | ||
71 | |||
72 | Using sysfs | ||
73 | =========== | ||
74 | |||
75 | Each aoe block device in /sys/block has the extra attributes of | ||
76 | state, mac, and netif. The state attribute is "up" when the device | ||
77 | is ready for I/O and "down" if detected but unusable. The | ||
78 | "down,closewait" state shows that the device is still open and | ||
79 | cannot come up again until it has been closed. | ||
80 | |||
81 | The mac attribute is the ethernet address of the remote AoE device. | ||
82 | The netif attribute is the network interface on the localhost | ||
83 | through which we are communicating with the remote AoE device. | ||
84 | |||
85 | There is a script in this directory that formats this information in | ||
86 | a convenient way. Users with aoetools should use the aoe-stat | ||
87 | command:: | ||
88 | |||
89 | root@makki root# sh Documentation/admin-guide/aoe/status.sh | ||
90 | e10.0 eth3 up | ||
91 | e10.1 eth3 up | ||
92 | e10.2 eth3 up | ||
93 | e10.3 eth3 up | ||
94 | e10.4 eth3 up | ||
95 | e10.5 eth3 up | ||
96 | e10.6 eth3 up | ||
97 | e10.7 eth3 up | ||
98 | e10.8 eth3 up | ||
99 | e10.9 eth3 up | ||
100 | e4.0 eth1 up | ||
101 | e4.1 eth1 up | ||
102 | e4.2 eth1 up | ||
103 | e4.3 eth1 up | ||
104 | e4.4 eth1 up | ||
105 | e4.5 eth1 up | ||
106 | e4.6 eth1 up | ||
107 | e4.7 eth1 up | ||
108 | e4.8 eth1 up | ||
109 | e4.9 eth1 up | ||
110 | |||
111 | Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver | ||
112 | option discussed below) instead of /dev/etherd/interfaces to limit | ||
113 | AoE traffic to the network interfaces in the given | ||
114 | whitespace-separated list. Unlike the old character device, the | ||
115 | sysfs entry can be read from as well as written to. | ||
116 | |||
117 | It's helpful to trigger discovery after setting the list of allowed | ||
118 | interfaces. The aoetools package provides an aoe-discover script | ||
119 | for this purpose. You can also directly use the | ||
120 | /dev/etherd/discover special file described above. | ||
121 | |||
122 | Driver Options | ||
123 | ============== | ||
124 | |||
125 | There is a boot option for the built-in aoe driver and a | ||
126 | corresponding module parameter, aoe_iflist. Without this option, | ||
127 | all network interfaces may be used for ATA over Ethernet. Here is a | ||
128 | usage example for the module parameter:: | ||
129 | |||
130 | modprobe aoe_iflist="eth1 eth3" | ||
131 | |||
132 | The aoe_deadsecs module parameter determines the maximum number of | ||
133 | seconds that the driver will wait for an AoE device to provide a | ||
134 | response to an AoE command. After aoe_deadsecs seconds have | ||
135 | elapsed, the AoE device will be marked as "down". A value of zero | ||
136 | is supported for testing purposes and makes the aoe driver keep | ||
137 | trying AoE commands forever. | ||
138 | |||
139 | The aoe_maxout module parameter has a default of 128. This is the | ||
140 | maximum number of unresponded packets that will be sent to an AoE | ||
141 | target at one time. | ||
142 | |||
143 | The aoe_dyndevs module parameter defaults to 1, meaning that the | ||
144 | driver will assign a block device minor number to a discovered AoE | ||
145 | target based on the order of its discovery. With dynamic minor | ||
146 | device numbers in use, a greater range of AoE shelf and slot | ||
147 | addresses can be supported. Users with udev will never have to | ||
148 | think about minor numbers. Using aoe_dyndevs=0 allows device nodes | ||
149 | to be pre-created using a static minor-number scheme with the | ||
150 | aoe-mkshelf script in the aoetools. | ||
diff --git a/Documentation/admin-guide/aoe/autoload.sh b/Documentation/admin-guide/aoe/autoload.sh new file mode 100644 index 000000000000..815dff4691c9 --- /dev/null +++ b/Documentation/admin-guide/aoe/autoload.sh | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/sh | ||
2 | # set aoe to autoload by installing the | ||
3 | # aliases in /etc/modprobe.d/ | ||
4 | |||
5 | f=/etc/modprobe.d/aoe.conf | ||
6 | |||
7 | if test ! -r $f || test ! -w $f; then | ||
8 | echo "cannot configure $f for module autoloading" 1>&2 | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | grep major-152 $f >/dev/null | ||
13 | if [ $? = 1 ]; then | ||
14 | echo alias block-major-152 aoe >> $f | ||
15 | echo alias char-major-152 aoe >> $f | ||
16 | fi | ||
17 | |||
diff --git a/Documentation/admin-guide/aoe/examples.rst b/Documentation/admin-guide/aoe/examples.rst new file mode 100644 index 000000000000..91f3198e52c1 --- /dev/null +++ b/Documentation/admin-guide/aoe/examples.rst | |||
@@ -0,0 +1,23 @@ | |||
1 | Example of udev rules | ||
2 | --------------------- | ||
3 | |||
4 | .. include:: udev.txt | ||
5 | :literal: | ||
6 | |||
7 | Example of udev install rules script | ||
8 | ------------------------------------ | ||
9 | |||
10 | .. literalinclude:: udev-install.sh | ||
11 | :language: shell | ||
12 | |||
13 | Example script to get status | ||
14 | ---------------------------- | ||
15 | |||
16 | .. literalinclude:: status.sh | ||
17 | :language: shell | ||
18 | |||
19 | Example of AoE autoload script | ||
20 | ------------------------------ | ||
21 | |||
22 | .. literalinclude:: autoload.sh | ||
23 | :language: shell | ||
diff --git a/Documentation/admin-guide/aoe/index.rst b/Documentation/admin-guide/aoe/index.rst new file mode 100644 index 000000000000..d71c5df15922 --- /dev/null +++ b/Documentation/admin-guide/aoe/index.rst | |||
@@ -0,0 +1,17 @@ | |||
1 | ======================= | ||
2 | ATA over Ethernet (AoE) | ||
3 | ======================= | ||
4 | |||
5 | .. toctree:: | ||
6 | :maxdepth: 1 | ||
7 | |||
8 | aoe | ||
9 | todo | ||
10 | examples | ||
11 | |||
12 | .. only:: subproject and html | ||
13 | |||
14 | Indices | ||
15 | ======= | ||
16 | |||
17 | * :ref:`genindex` | ||
diff --git a/Documentation/admin-guide/aoe/status.sh b/Documentation/admin-guide/aoe/status.sh new file mode 100644 index 000000000000..eeec7baae57a --- /dev/null +++ b/Documentation/admin-guide/aoe/status.sh | |||
@@ -0,0 +1,30 @@ | |||
1 | #! /bin/sh | ||
2 | # collate and present sysfs information about AoE storage | ||
3 | # | ||
4 | # A more complete version of this script is aoe-stat, in the | ||
5 | # aoetools. | ||
6 | |||
7 | set -e | ||
8 | format="%8s\t%8s\t%8s\n" | ||
9 | me=`basename $0` | ||
10 | sysd=${sysfs_dir:-/sys} | ||
11 | |||
12 | # printf "$format" device mac netif state | ||
13 | |||
14 | # Suse 9.1 Pro doesn't put /sys in /etc/mtab | ||
15 | #test -z "`mount | grep sysfs`" && { | ||
16 | test ! -d "$sysd/block" && { | ||
17 | echo "$me Error: sysfs is not mounted" 1>&2 | ||
18 | exit 1 | ||
19 | } | ||
20 | |||
21 | for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do | ||
22 | # maybe ls comes up empty, so we use "end" | ||
23 | test $d = end && continue | ||
24 | |||
25 | dev=`echo "$d" | sed 's/.*!//'` | ||
26 | printf "$format" \ | ||
27 | "$dev" \ | ||
28 | "`cat \"$d/netif\"`" \ | ||
29 | "`cat \"$d/state\"`" | ||
30 | done | sort | ||
diff --git a/Documentation/admin-guide/aoe/todo.rst b/Documentation/admin-guide/aoe/todo.rst new file mode 100644 index 000000000000..dea8db5a33e1 --- /dev/null +++ b/Documentation/admin-guide/aoe/todo.rst | |||
@@ -0,0 +1,17 @@ | |||
1 | TODO | ||
2 | ==== | ||
3 | |||
4 | There is a potential for deadlock when allocating a struct sk_buff for | ||
5 | data that needs to be written out to aoe storage. If the data is | ||
6 | being written from a dirty page in order to free that page, and if | ||
7 | there are no other pages available, then deadlock may occur when a | ||
8 | free page is needed for the sk_buff allocation. This situation has | ||
9 | not been observed, but it would be nice to eliminate any potential for | ||
10 | deadlock under memory pressure. | ||
11 | |||
12 | Because ATA over Ethernet is not fragmented by the kernel's IP code, | ||
13 | the destructor member of the struct sk_buff is available to the aoe | ||
14 | driver. By using a mempool for allocating all but the first few | ||
15 | sk_buffs, and by registering a destructor, we should be able to | ||
16 | efficiently allocate sk_buffs without introducing any potential for | ||
17 | deadlock. | ||
diff --git a/Documentation/admin-guide/aoe/udev-install.sh b/Documentation/admin-guide/aoe/udev-install.sh new file mode 100644 index 000000000000..15e86f58c036 --- /dev/null +++ b/Documentation/admin-guide/aoe/udev-install.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | # install the aoe-specific udev rules from udev.txt into | ||
2 | # the system's udev configuration | ||
3 | # | ||
4 | |||
5 | me="`basename $0`" | ||
6 | |||
7 | # find udev.conf, often /etc/udev/udev.conf | ||
8 | # (or environment can specify where to find udev.conf) | ||
9 | # | ||
10 | if test -z "$conf"; then | ||
11 | if test -r /etc/udev/udev.conf; then | ||
12 | conf=/etc/udev/udev.conf | ||
13 | else | ||
14 | conf="`find /etc -type f -name udev.conf 2> /dev/null`" | ||
15 | if test -z "$conf" || test ! -r "$conf"; then | ||
16 | echo "$me Error: no udev.conf found" 1>&2 | ||
17 | exit 1 | ||
18 | fi | ||
19 | fi | ||
20 | fi | ||
21 | |||
22 | # find the directory where udev rules are stored, often | ||
23 | # /etc/udev/rules.d | ||
24 | # | ||
25 | rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`" | ||
26 | if test -z "$rules_d" ; then | ||
27 | rules_d=/etc/udev/rules.d | ||
28 | fi | ||
29 | if test ! -d "$rules_d"; then | ||
30 | echo "$me Error: cannot find udev rules directory" 1>&2 | ||
31 | exit 1 | ||
32 | fi | ||
33 | sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules" | ||
diff --git a/Documentation/admin-guide/aoe/udev.txt b/Documentation/admin-guide/aoe/udev.txt new file mode 100644 index 000000000000..5fb756466bc7 --- /dev/null +++ b/Documentation/admin-guide/aoe/udev.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | # These rules tell udev what device nodes to create for aoe support. | ||
2 | # They may be installed along the following lines. Check the section | ||
3 | # 8 udev manpage to see whether your udev supports SUBSYSTEM, and | ||
4 | # whether it uses one or two equal signs for SUBSYSTEM and KERNEL. | ||
5 | # | ||
6 | # ecashin@makki ~$ su | ||
7 | # Password: | ||
8 | # bash# find /etc -type f -name udev.conf | ||
9 | # /etc/udev/udev.conf | ||
10 | # bash# grep udev_rules= /etc/udev/udev.conf | ||
11 | # udev_rules="/etc/udev/rules.d/" | ||
12 | # bash# ls /etc/udev/rules.d/ | ||
13 | # 10-wacom.rules 50-udev.rules | ||
14 | # bash# cp /path/to/linux/Documentation/admin-guide/aoe/udev.txt \ | ||
15 | # /etc/udev/rules.d/60-aoe.rules | ||
16 | # | ||
17 | |||
18 | # aoe char devices | ||
19 | SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
20 | SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440" | ||
21 | SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
22 | SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
23 | SUBSYSTEM=="aoe", KERNEL=="flush", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
24 | |||
25 | # aoe block devices | ||
26 | KERNEL=="etherd*", GROUP="disk" | ||
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst index 9228fbf5ce4e..1f0d9b939311 100644 --- a/Documentation/admin-guide/index.rst +++ b/Documentation/admin-guide/index.rst | |||
@@ -83,6 +83,7 @@ configure specific aspects of kernel behavior to your liking. | |||
83 | namespaces/index | 83 | namespaces/index |
84 | perf-security | 84 | perf-security |
85 | acpi/index | 85 | acpi/index |
86 | aoe/index | ||
86 | device-mapper/index | 87 | device-mapper/index |
87 | laptops/index | 88 | laptops/index |
88 | 89 | ||