Browse Source

Import upstream version 10

Ed L. Cashin 18 years ago
parent
commit
c2770ba948
11 changed files with 183 additions and 34 deletions
  1. 20 6
      Makefile
  2. 32 4
      NEWS
  3. 25 4
      README
  4. 2 2
      aoe-mkdevs
  5. 6 4
      aoe-mkshelf
  6. 35 0
      aoe-revalidate.8
  7. 12 0
      aoe-revalidate.in
  8. 5 1
      aoe-stat
  9. 9 11
      aoe-stat.8
  10. 2 2
      aoeping.c
  11. 35 0
      devnodes.txt

+ 20 - 6
Makefile

@@ -19,13 +19,27 @@ DEVDIR = /dev/etherd
 SBINDIR = ${PREFIX}/usr/sbin
 SBINDIR = ${PREFIX}/usr/sbin
 MANDIR = ${PREFIX}/usr/share/man
 MANDIR = ${PREFIX}/usr/share/man
 
 
+# NPERSHELF is the number of slot addresses per shelf address.
+# This number must match the same setting in the aoe driver.
+#
+# Older aoe drivers have NPERSHELF set to 10, and newer ones 
+# use 16.
+#
+# You can see the setting in your driver like this in the driver
+# source directory.  (Change into the "linux" directory if you're
+# using the standalone driver from the Coraid.)
+#
+#   grep 'NPERSHELF.*=' drivers/block/aoe/aoe.h
+#
+NPERSHELF=16
+
 # end of user-configurable variables
 # end of user-configurable variables
 
 
 
 
 # these scripts are created from the *.in files
 # these scripts are created from the *.in files
-CONF_SCRIPTS = aoe-discover aoe-interfaces
+CONF_SCRIPTS = aoe-discover aoe-interfaces aoe-mkshelf aoe-revalidate
 PROGS = aoeping
 PROGS = aoeping
-COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-mkshelf aoe-stat ${PROGS}
+COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-stat ${PROGS}
 CFLAGS = -Wall -O -g
 CFLAGS = -Wall -O -g
 
 
 AOE_PING_OBJ = aoeping.o linux.o
 AOE_PING_OBJ = aoeping.o linux.o
@@ -35,15 +49,15 @@ all : configure ${PROGS}
 
 
 configure :
 configure :
 	@for f in ${CONF_SCRIPTS}; do \
 	@for f in ${CONF_SCRIPTS}; do \
-	  sh -xc "sed 's!@devdir@!${DEVDIR}!g' $$f.in > $$f" || break; \
+	  sh -xc "sed -e 's!@devdir@!${DEVDIR}!g' -e 's!@npershelf@!${NPERSHELF}!g' $$f.in > $$f" || break; \
 	done
 	done
 
 
-install : configure
+install : all
 	mkdir -p ${SBINDIR}
 	mkdir -p ${SBINDIR}
 	mkdir -p ${MANDIR}/man8
 	mkdir -p ${MANDIR}/man8
 	@for f in ${COMMANDS}; do \
 	@for f in ${COMMANDS}; do \
-	  sh -xc "install -m 700 $$f ${SBINDIR}/$$f" || break; \
-	  sh -xc "install -m 664 $$f.8 ${MANDIR}/man8/$$f.8" || break; \
+	  sh -xc "install -m 700 $$f ${DESTDIR}${SBINDIR}/$$f" || break; \
+	  sh -xc "install -m 664 $$f.8 ${DESTDIR}${MANDIR}/man8/$$f.8" || break; \
 	done
 	done
 
 
 clean :
 clean :

+ 32 - 4
NEWS

@@ -1,15 +1,43 @@
-2005-05-17 13:43:04 GMT Ed L. Cashin <ecashin@coraid.com>
+2006-05-25 "Ed L. Cashin" <ecashin@coraid.com>
+	release 10
+	update README: aoetools are for 2.6 systems
+
+2006-01-18 "Ed L. Cashin" <ecashin@coraid.com>
+	release 9
+	aoe-revalidate: notice error in writing to revalidate device
+
+2005-11-09 Sam Hopkins <sah@coraid.com>
+	release 8
+	add aoe-revalidate
+	document driver compatibility
+
+2005-08-18 "Ed L. Cashin" <ecashin@coraid.com>
+	release 7
+	format sub-gigabyte device sizes correctly
+
+2005-08-17 "Ed L. Cashin" <ecashin@coraid.com>
+	release 6
+	make aoe-stat show device size
+
+2005-07-13 "Ed L. Cashin" <ecashin@coraid.com>
+	release 5
+	make number of slots per shelf configurable
+	Rob Holland <tigger@gentoo.org>: install using PREFIX
+	"make install" builds aoeping
+	avoid gcc 4 warnings by specifying uchar in params
+
+2005-05-17 "Ed L. Cashin" <ecashin@coraid.com>
 	release 4
 	release 4
 	fix typo in Makefile preventing aoeping installation: s/PROG/PROGS/
 	fix typo in Makefile preventing aoeping installation: s/PROG/PROGS/
 	add TODO file
 	add TODO file
 
 
-2005-04-14 17:51:44 GMT Ed L. Cashin <ecashin@coraid.com>
+2005-04-14 "Ed L. Cashin" <ecashin@coraid.com>
 	release 3
 	release 3
 	add very basic SMART support to aoeping
 	add very basic SMART support to aoeping
 
 
-2005-04-12 20:20:14 GMT Ed L. Cashin <ecashin@coraid.com>
+2005-04-12 "Ed L. Cashin" <ecashin@coraid.com>
 	release 2
 	release 2
 	add aoeping, a userland tool for simple AoE communications
 	add aoeping, a userland tool for simple AoE communications
 
 
-2005-03-23 16:25:50 GMT	Ed L. Cashin <ecashin@coraid.com>
+2005-03-23 "Ed L. Cashin" <ecashin@coraid.com>
 	initial release of aoetools, version 1
 	initial release of aoetools, version 1

+ 25 - 4
README

@@ -1,7 +1,27 @@
-The aoetools are programs that assist in using ATA over Ethernet.  For
-now, the tools are designed to work with the "aoe" driver for Linux
-2.6 kernels.  Support for 2.4 kernels and other operating systems
-would be helpful, but we're starting with 2.6 support.
+The aoetools are programs that assist in using ATA over Ethernet on
+systems with version 2.6 Linux kernels.  
+
+Systems running 2.4 Linux kernels do not need and should not install
+the aoetools.  The aoe driver for 2.4 kernels is self sufficient.
+
+--------------------------------------------------------------------
+AOE DRIVER COMPATIBILITY
+
+  ATA over Ethernet (AoE) devices have a shelf address and a slot
+  address. The aoe driver used to support only 10 slots per shelf
+  address. The 2.6.14 kernel contains an aoe driver that supports up
+  to 16 slots per shelf address. This change means that ...
+  
+     1. It's easy to use the aoetools that come bundled with the aoe
+        driver at the Coraid website.
+  
+     2. It's easy to use aoetools-8 or later with kernels 2.6.14 or
+        later.
+  
+     3. It's easy to use other combinations as long as you read the
+        information in the devnodes.txt file here.
+--------------------------------------------------------------------
+
 
 
 If you need to configure the software, look at the variables at the
 If you need to configure the software, look at the variables at the
 top of the Makefile.  The defaults should work for most people.  When
 top of the Makefile.  The defaults should work for most people.  When
@@ -20,6 +40,7 @@ further details.
   aoe-interfaces	restrict network interfaces used for AoE
   aoe-interfaces	restrict network interfaces used for AoE
   aoe-mkdevs		create character and block device files
   aoe-mkdevs		create character and block device files
   aoe-mkshelf		create block device files for one shelf address
   aoe-mkshelf		create block device files for one shelf address
+  aoe-revalidate	ask the aoe driver to update its state for a device
   aoe-stat		print status information for AoE devices
   aoe-stat		print status information for AoE devices
   aoeping		simple userland communication with AoE devices
   aoeping		simple userland communication with AoE devices
 
 

+ 2 - 2
aoe-mkdevs

@@ -4,8 +4,8 @@ n_shelves=${n_shelves:-10}
 n_partitions=${n_partitions:-16}
 n_partitions=${n_partitions:-16}
 
 
 if test "$#" != "1"; then
 if test "$#" != "1"; then
-	echo "Usage: sh `basename $0` {dir}" 1>&2
-	echo "       n_partitions=16 sh `basename $0` {dir}" 1>&2
+	echo "Usage: `basename $0` {dir}" 1>&2
+	echo "       n_partitions=16 `basename $0` {dir}" 1>&2
 	exit 1
 	exit 1
 fi
 fi
 dir=$1
 dir=$1

+ 6 - 4
aoe-mkshelf

@@ -1,20 +1,22 @@
 #! /bin/sh
 #! /bin/sh
 
 
 if test "$#" != "2"; then
 if test "$#" != "2"; then
-	echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2
-	echo "       n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2
+	echo "Usage: `basename $0` {dir} {shelfaddress}" 1>&2
+	echo "       n_partitions=16 `basename $0` {dir} {shelfaddress}" 1>&2
 	exit 1
 	exit 1
 fi
 fi
 n_partitions=${n_partitions:-16}
 n_partitions=${n_partitions:-16}
 dir=$1
 dir=$1
 shelf=$2
 shelf=$2
+nslots=@npershelf@
+maxslot=`echo $nslots - 1 | bc`
 MAJOR=152
 MAJOR=152
 
 
 set -e
 set -e
 
 
-minor=`echo 10 \* $shelf \* $n_partitions | bc`
+minor=`echo $nslots \* $shelf \* $n_partitions | bc`
 endp=`echo $n_partitions - 1 | bc`
 endp=`echo $n_partitions - 1 | bc`
-for slot in `seq 0 9`; do
+for slot in `seq 0 $maxslot`; do
 	for part in `seq 0 $endp`; do
 	for part in `seq 0 $endp`; do
 		name=e$shelf.$slot
 		name=e$shelf.$slot
 		test "$part" != "0" && name=${name}p$part
 		test "$part" != "0" && name=${name}p$part

+ 35 - 0
aoe-revalidate.8

@@ -0,0 +1,35 @@
+.TH aoe-interfaces 8
+.SH NAME
+aoe-revalidate \- revalidate the disk size of an aoe device 
+.SH SYNOPSIS
+.nf
+.B aoe-revalidate e{major}.{minor}
+.fi
+.SH DESCRIPTION
+The
+.I aoe-revalidate
+command tells the aoe driver to revalidate the disk size of an open aoe device.
+Normally the aoe driver will only acknowledge changes in an aoe device's
+disk size when the aoe device is not open.  Aoe-revalidate will cause the
+driver to pause any I/O for the aoe device while revalidating the disk size.
+After revalidation I/O is resumed.
+.PP
+It should be noted that if an aoe device's disk size shrinks in revalidation
+any users may become hopelessly confused when their resumed I/O starts to fail.
+.PP
+.IP
+.EX
+ nai:~# 
+ nai# aoe-stat | grep e1.9
+      e1.9        82.348GB   eth0 up            
+ nai# < /dev/etherd/e1.9 sleep 600 &
+ [1] 13006
+ nai# aoe-revalidate e1.9
+ nai# aoe-stat | grep e1.9
+       e1.9       164.696GB   eth0 up            
+.EE
+.LP
+.SH "SEE ALSO"
+.IR aoe-stat (8).
+.SH AUTHOR
+Sam Hopkins (sah@coraid.com)

+ 12 - 0
aoe-revalidate.in

@@ -0,0 +1,12 @@
+#! /bin/sh
+# aoe-revalidate
+
+if test -z "$*"; then
+	echo 1>&2 Usage: $0 'e{major}.{minor}'
+	exit 1
+fi
+echo "$*" > @devdir@/revalidate || {
+	echo "`basename $0` Error: revalidate failed" 1>&2
+	exit 1
+}
+

+ 5 - 1
aoe-stat

@@ -2,7 +2,7 @@
 # collate and present sysfs information about AoE storage
 # collate and present sysfs information about AoE storage
 
 
 set -e
 set -e
-format="%8s\t%8s\t%8s\n"
+format="%10s %15s %6s %-14s\n"
 me=`basename $0`
 me=`basename $0`
 sysd=${sysfs_dir:-/sys}
 sysd=${sysfs_dir:-/sys}
 
 
@@ -20,8 +20,12 @@ for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do
 	test $d = end && continue
 	test $d = end && continue
 
 
 	dev=`echo "$d" | sed 's/.*!//'`
 	dev=`echo "$d" | sed 's/.*!//'`
+	sectors="`cat \"$d/size\"`"
+	psize=`echo "(512000 * $sectors) / (1000 * 1000 * 1000)" | bc`
+	psize=`printf "%04d\n" $psize | sed 's!\(...\)$!.\1!'`
 	printf "$format" \
 	printf "$format" \
 		"$dev" \
 		"$dev" \
+		"${psize}GB" \
 		"`cat \"$d/netif\"`" \
 		"`cat \"$d/netif\"`" \
 		"`cat \"$d/state\"`"
 		"`cat \"$d/state\"`"
 done | sort
 done | sort

+ 9 - 11
aoe-stat.8

@@ -25,8 +25,11 @@ being the AoE device shelf address, and
 .I Y 
 .I Y 
 being the AoE slot address.
 being the AoE slot address.
 .TP
 .TP
+.BI size
+The size of the AoE device is in gigabytes (billions of bytes).
+.TP
 .BI ifname
 .BI ifname
-The network interface name is printed in the second column.
+The network interface name is printed in the third column.
 .TP
 .TP
 .BI status
 .BI status
 The device status is in the last column.  Possible values
 The device status is in the last column.  Possible values
@@ -58,16 +61,11 @@ This time the list shows all the devices in shelf seven.
  nai:~# ifconfig eth3 up
  nai:~# ifconfig eth3 up
  nai:~# aoe-discover 
  nai:~# aoe-discover 
  nai:~# aoe-stat
  nai:~# aoe-stat
-     e7.0            eth3              up
-     e7.1            eth3              up
-     e7.2            eth3              up
-     e7.3            eth3              up
-     e7.4            eth3              up
-     e7.5            eth3              up
-     e7.6            eth3              up
-     e7.7            eth3              up
-     e7.8            eth3              up
-     e7.9            eth3              up
+       e0.0     10995.116GB   eth0 up            
+       e0.1     10995.116GB   eth0 up            
+       e0.2     10995.116GB   eth0 up            
+       e1.0      1152.874GB   eth0 up            
+       e7.0       370.566GB   eth0 up            
  nai:~# 
  nai:~# 
 .EE
 .EE
 .LP
 .LP

+ 2 - 2
aoeping.c

@@ -89,7 +89,7 @@ usage(void)
 }
 }
 
 
 void
 void
-hex_print(FILE *out, char *buf, int n, char *sep)
+hex_print(FILE *out, uchar *buf, int n, char *sep)
 {
 {
 	int i;
 	int i;
 	int per_line = 16;
 	int per_line = 16;
@@ -152,7 +152,7 @@ find_blade(Conf *c, int shelf, int slot)
 /* read a packet that was sent by the device that returned *c earlier
 /* read a packet that was sent by the device that returned *c earlier
  */
  */
 int
 int
-aoe_pkt_read(int fd, char *buf, size_t siz, Conf *c)
+aoe_pkt_read(int fd, uchar *buf, size_t siz, Conf *c)
 {
 {
 	Aoehdr *h;
 	Aoehdr *h;
 	int n;
 	int n;

+ 35 - 0
devnodes.txt

@@ -0,0 +1,35 @@
+			 Driver Compatibility
+
+Users of udev have device nodes like /dev/etherd/e0.0 created for them
+automatically, as needed. These are dynamic device nodes.
+
+Some systems use static device nodes, which are present in /dev
+regardless of what devices are really available to the system. The
+aoetools contain the aoe-mkdevs and aoe-mkshelf commands, which create
+static device nodes.
+
+To guard against confusion, it's important to have an aoetools
+installation that is compatible with your aoe driver. If you use an
+aoe driver from the Coraid website
+(http://www.coraid.com/support/linux/) then just use the aoetools that
+come bundled with that deiver. If you didn't get your aoe driver from
+the Coraid website, then here's what to do:
+
+    * Of course, read the README file in the aoetools sources.
+
+    * To use aoetools-8 and later with older 2.6 kernels (2.6.13 and
+      earlier), build the aoetools with an extra parameter for "make",
+      like this:
+
+        make NPERSHELF=10
+
+    * To use aoetools-5 through aoetools-7 with newer 2.6 kernels
+      (2.6.14 and later), build the aoetools with an extra parameter
+      for "make", like this:
+
+        make NPERSHELF=16
+
+    * Using aoetools-4 and earlier with newer 2.6 kernels (2.6.14 and
+      later) is not recommended.
+
+Other combinations should work with the default settings.