Permalink
Browse files

vdev_id: implement slot numbering by port id

With HPE hardware and hpsa-driven SAS adapters, only a single phy is
reported, but no individual per-port phys (ie. no phy* entry below
port_dir), which breaks topology detection in the current sas_handler
code. Instead, slot information can be derived directly from the port
number. This change implements a new slot keyword "port" similar to
"id" and "lun", and assumes a default phy/port of 0 if no individual
phy entry can be found. It allows to use the "sas_direct" topology with
current HPE Dxxxx and Apollo 45xx JBODs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Daniel Kobras <d.kobras@science-computing.de>
Closes #6484
  • Loading branch information...
sckobras authored and tonyhutter committed Aug 14, 2017
1 parent aec4318 commit 426563be7002ad9bdd99d3ad21fc8698aba353d0
Showing with 8 additions and 2 deletions.
  1. +5 −1 cmd/vdev_id/vdev_id
  2. +3 −1 man/man5/vdev_id.conf.5
@@ -237,7 +237,7 @@ sas_handler() {

PHY=`ls -d $port_dir/phy* 2>/dev/null | head -1 | awk -F: '{print $NF}'`
if [ -z "$PHY" ] ; then
return
PHY=0
fi
PORT=$(( $PHY / $PHYS_PER_PORT ))

@@ -262,6 +262,10 @@ sas_handler() {
"phy")
SLOT=`cat $end_device_dir/phy_identifier 2>/dev/null`
;;
"port")
d=$(eval echo \${$i})
SLOT=`echo $d | sed -e 's/^.*://'`
;;
"id")
i=$(($i + 1))
d=$(eval echo \${$i})
@@ -90,14 +90,16 @@ internally uses this value to determine which HBA or switch port a
device is connected to. The default is 4.

.TP
\fIslot\fR <bay|phy|id|lun>
\fIslot\fR <bay|phy|port|id|lun>
Specifies from which element of a SAS identifier the slot number is
taken. The default is bay.

\fIbay\fR - read the slot number from the bay identifier.

\fIphy\fR - read the slot number from the phy identifier.

\fIport\fR - use the SAS port as the slot number.

\fIid\fR - use the scsi id as the slot number.

\fIlun\fR - use the scsi lun as the slot number.

0 comments on commit 426563b

Please sign in to comment.