Skip to content

Linux - Fiber Channel

Commands

List FC cards:

lspci -nn | grep Fibre

Retrieve FC host info with this path:

find /sys | grep  "15:00.0" | grep port_name

Display FC card detail:

lspci -v -s "05:00.0"

Display FC driver version:

modinfo -F version qla2xxx
modinfo qla2xxx | grep version

Check that FC driver is load in kernel:

lsmod | grep qla2xxx

Display FC host port name:

cat /sys/class/fc_host/host5/port_name

Display FC host info:

for port in /sys/class/fc_host/host?/port_*; { echo "$port: $(cat $port)"; }

Display speed of card:

grep -Hv "zz" /sys/class/fc_host/host*/speed

Procedures

Disable HBA Port via FC Driver:

# Get FC host:
ls -l /sys/class/fc_host

# Deactivate card from driver
echo "0000:3c:00.0" > /sys/bus/pci/drivers/qla2xxx/unbind

# Reactivate card from driver
echo "0000:3c:00.0" > /sys/bus/pci/drivers/qla2xxx/bind

Enable verbose log from FC driver:

chmod u+w /sys/module/qla2xxx/parameters/ql2xextended_error_logging

echo "1" > /sys/module/qla2xxx/parameters/ql2xextended_error_logging

sysctl -w dev.scsi.logging_level=0x1003
Back to top