Hi Henrik, On Thu, 2016-01-21 at 17:12 +0100, Henrik Goldman wrote: > Hello, > > In a new system we're testing QLE2564's but unfortunately only 3 out > of 4 ports are available. > > According to targetcli (Ubuntu 14.04 LTS kernel 3.13.0-71-generic) it > looks like this: > > /qla2xxx> ls > o- qla2xxx .............................................................................................................. > [1 Target] > o- 11:5c:00:24:ff:23:6d:37 > ............................................................................................. > [enabled] > o- acls ............................................................................................................... > [0 ACLs] > o- luns ............................................................................................................... > [3 LUNs] > o- lun0 ............................................................................................. > [fileio/SSD1 (/dev/sda)] > o- lun1 ............................................................................................. > [fileio/SSD2 (/dev/sdb)] > o- lun2 ............................................................................................. > [fileio/SSD3 (/dev/sdc)] > /qla2xxx> create > 15:c0:02:4f:f2:36:d3:7 21:5c:00:24:ff:23:6d:37 31:5c:00:24:ff:23:6d:37 wwn= > .................wwn|keyword= > /qla2xxx> create 15:c0:02:4f:f2:36:d3:7 > Traceback (most recent call last): > File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line > 983, in run_interactive > self._cli_loop() > File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line > 806, in _cli_loop > self.run_cmdline(cmdline) > File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line > 927, in run_cmdline > self._execute_command(path, command, pparams, kparams) > File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line > 902, in _execute_command > result = target.execute_command(command, pparams, kparams) > File "/usr/lib/python2.7/dist-packages/targetcli/ui_node.py", line > 216, in execute_command > > The issue is that one of the wwn's is missing a leading zero. > The wwn 15:c0:02:4f:f2:36:d3:7 should in fact be > 01:5c:00:24:ff:23:6d:37 and in this case it would look like the rest. > > This seems to come from the driver itself: > > root@linuxstore-7:/# cat /sys/class/fc_host/host0/port_name > 0x15c0024ff236d37 > root@linuxstore-7:/# cat /sys/class/fc_host/host9/port_name > 0x115c0024ff236d37 > This looks like a genuine string formatting bug in qla2xxx LLD + libfc code. (Adding Qlogic folks CC') As a simple work-around, you can add the following awk hackery to your /var/target/fabric/qla2xxx.spec:wwn_from_files_filter to insert the missing leading zero: wwn_from_files_filter = "awk -F, '{ if (length($1)==18) print $1 } { if (length($1)==17) { gsub("0x","&0") ; print $0 }}' | sed -e s/0x// -e 's/../&:/g' -e s/:$//" Which translates to: # echo "0x15c0024ff236d37" | awk -F, '{ if (length($1)==18) print $1 } { if (length($1)==17) { gsub("0x","&0") ; print $0 }}' | sed -e s/0x// -e 's/../&:/g' -e s/:$// 01:5c:00:24:ff:23:6d:37 Thanks for reporting. --nab -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html