xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/aoe/aoe.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunIntroduction
2*4882a593Smuzhiyun============
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunATA over Ethernet is a network protocol that provides simple access to
5*4882a593Smuzhiyunblock storage on the LAN.
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun  http://support.coraid.com/documents/AoEr11.txt
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThe EtherDrive (R) HOWTO for 2.6 and 3.x kernels is found at ...
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun  http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO.html
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunIt has many tips and hints!  Please see, especially, recommended
14*4882a593Smuzhiyuntunings for virtual memory:
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun  http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO-5.html#ss5.19
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunThe aoetools are userland programs that are designed to work with this
19*4882a593Smuzhiyundriver.  The aoetools are on sourceforge.
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun  http://aoetools.sourceforge.net/
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunThe scripts in this Documentation/admin-guide/aoe directory are intended to
24*4882a593Smuzhiyundocument the use of the driver and are not necessary if you install
25*4882a593Smuzhiyunthe aoetools.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunCreating Device Nodes
29*4882a593Smuzhiyun=====================
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun  Users of udev should find the block device nodes created
32*4882a593Smuzhiyun  automatically, but to create all the necessary device nodes, use the
33*4882a593Smuzhiyun  udev configuration rules provided in udev.txt (in this directory).
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun  There is a udev-install.sh script that shows how to install these
36*4882a593Smuzhiyun  rules on your system.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun  There is also an autoload script that shows how to edit
39*4882a593Smuzhiyun  /etc/modprobe.d/aoe.conf to ensure that the aoe module is loaded when
40*4882a593Smuzhiyun  necessary.  Preloading the aoe module is preferable to autoloading,
41*4882a593Smuzhiyun  however, because AoE discovery takes a few seconds.  It can be
42*4882a593Smuzhiyun  confusing when an AoE device is not present the first time the a
43*4882a593Smuzhiyun  command is run but appears a second later.
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunUsing Device Nodes
46*4882a593Smuzhiyun==================
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun  "cat /dev/etherd/err" blocks, waiting for error diagnostic output,
49*4882a593Smuzhiyun  like any retransmitted packets.
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun  "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to
52*4882a593Smuzhiyun  limit ATA over Ethernet traffic to eth2 and eth4.  AoE traffic from
53*4882a593Smuzhiyun  untrusted networks should be ignored as a matter of security.  See
54*4882a593Smuzhiyun  also the aoe_iflist driver option described below.
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun  "echo > /dev/etherd/discover" tells the driver to find out what AoE
57*4882a593Smuzhiyun  devices are available.
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun  In the future these character devices may disappear and be replaced
60*4882a593Smuzhiyun  by sysfs counterparts.  Using the commands in aoetools insulates
61*4882a593Smuzhiyun  users from these implementation details.
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun  The block devices are named like this::
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun	e{shelf}.{slot}
66*4882a593Smuzhiyun	e{shelf}.{slot}p{part}
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun  ... so that "e0.2" is the third blade from the left (slot 2) in the
69*4882a593Smuzhiyun  first shelf (shelf address zero).  That's the whole disk.  The first
70*4882a593Smuzhiyun  partition on that disk would be "e0.2p1".
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunUsing sysfs
73*4882a593Smuzhiyun===========
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun  Each aoe block device in /sys/block has the extra attributes of
76*4882a593Smuzhiyun  state, mac, and netif.  The state attribute is "up" when the device
77*4882a593Smuzhiyun  is ready for I/O and "down" if detected but unusable.  The
78*4882a593Smuzhiyun  "down,closewait" state shows that the device is still open and
79*4882a593Smuzhiyun  cannot come up again until it has been closed.
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun  The mac attribute is the ethernet address of the remote AoE device.
82*4882a593Smuzhiyun  The netif attribute is the network interface on the localhost
83*4882a593Smuzhiyun  through which we are communicating with the remote AoE device.
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun  There is a script in this directory that formats this information in
86*4882a593Smuzhiyun  a convenient way.  Users with aoetools should use the aoe-stat
87*4882a593Smuzhiyun  command::
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun    root@makki root# sh Documentation/admin-guide/aoe/status.sh
90*4882a593Smuzhiyun       e10.0            eth3              up
91*4882a593Smuzhiyun       e10.1            eth3              up
92*4882a593Smuzhiyun       e10.2            eth3              up
93*4882a593Smuzhiyun       e10.3            eth3              up
94*4882a593Smuzhiyun       e10.4            eth3              up
95*4882a593Smuzhiyun       e10.5            eth3              up
96*4882a593Smuzhiyun       e10.6            eth3              up
97*4882a593Smuzhiyun       e10.7            eth3              up
98*4882a593Smuzhiyun       e10.8            eth3              up
99*4882a593Smuzhiyun       e10.9            eth3              up
100*4882a593Smuzhiyun        e4.0            eth1              up
101*4882a593Smuzhiyun        e4.1            eth1              up
102*4882a593Smuzhiyun        e4.2            eth1              up
103*4882a593Smuzhiyun        e4.3            eth1              up
104*4882a593Smuzhiyun        e4.4            eth1              up
105*4882a593Smuzhiyun        e4.5            eth1              up
106*4882a593Smuzhiyun        e4.6            eth1              up
107*4882a593Smuzhiyun        e4.7            eth1              up
108*4882a593Smuzhiyun        e4.8            eth1              up
109*4882a593Smuzhiyun        e4.9            eth1              up
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun  Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver
112*4882a593Smuzhiyun  option discussed below) instead of /dev/etherd/interfaces to limit
113*4882a593Smuzhiyun  AoE traffic to the network interfaces in the given
114*4882a593Smuzhiyun  whitespace-separated list.  Unlike the old character device, the
115*4882a593Smuzhiyun  sysfs entry can be read from as well as written to.
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun  It's helpful to trigger discovery after setting the list of allowed
118*4882a593Smuzhiyun  interfaces.  The aoetools package provides an aoe-discover script
119*4882a593Smuzhiyun  for this purpose.  You can also directly use the
120*4882a593Smuzhiyun  /dev/etherd/discover special file described above.
121*4882a593Smuzhiyun
122*4882a593SmuzhiyunDriver Options
123*4882a593Smuzhiyun==============
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun  There is a boot option for the built-in aoe driver and a
126*4882a593Smuzhiyun  corresponding module parameter, aoe_iflist.  Without this option,
127*4882a593Smuzhiyun  all network interfaces may be used for ATA over Ethernet.  Here is a
128*4882a593Smuzhiyun  usage example for the module parameter::
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun    modprobe aoe_iflist="eth1 eth3"
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun  The aoe_deadsecs module parameter determines the maximum number of
133*4882a593Smuzhiyun  seconds that the driver will wait for an AoE device to provide a
134*4882a593Smuzhiyun  response to an AoE command.  After aoe_deadsecs seconds have
135*4882a593Smuzhiyun  elapsed, the AoE device will be marked as "down".  A value of zero
136*4882a593Smuzhiyun  is supported for testing purposes and makes the aoe driver keep
137*4882a593Smuzhiyun  trying AoE commands forever.
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun  The aoe_maxout module parameter has a default of 128.  This is the
140*4882a593Smuzhiyun  maximum number of unresponded packets that will be sent to an AoE
141*4882a593Smuzhiyun  target at one time.
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun  The aoe_dyndevs module parameter defaults to 1, meaning that the
144*4882a593Smuzhiyun  driver will assign a block device minor number to a discovered AoE
145*4882a593Smuzhiyun  target based on the order of its discovery.  With dynamic minor
146*4882a593Smuzhiyun  device numbers in use, a greater range of AoE shelf and slot
147*4882a593Smuzhiyun  addresses can be supported.  Users with udev will never have to
148*4882a593Smuzhiyun  think about minor numbers.  Using aoe_dyndevs=0 allows device nodes
149*4882a593Smuzhiyun  to be pre-created using a static minor-number scheme with the
150*4882a593Smuzhiyun  aoe-mkshelf script in the aoetools.
151