Reset HBA port in Linux

There are several commands available that allow you to reset one or more interconnects in Linux, issue_lip is one and the most recommended command.

The following command can be used to find HBA device name.(in this example host1,host2):

[root@unixonline ~]# systool -c fc_host -v|egrep "Device =|node_name|port_state|speed"
  Class Device = "host1"
    node_name           = "0x20000032fff8dce3"
    port_state          = "Online"
    speed               = "8 Gbit"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    Device = "host1"
  Class Device = "host2"
    node_name           = "0x20000032fff8dce4"
    port_state          = "Online"
    speed               = "8 Gbit"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    Device = "host2"

The following command can be used to reset storage interconnects bus.(in this example host2):

[root@unixonline ~]# echo 1 > /sys/class/fc_host/host2/issue_lip

This operation performs a Loop Initialization Protocol (LIP) and then scans the interconnect and causes the SCSI layer to be updated to reflect the devices currently on the bus. A LIP is, essentially, a bus reset, and will cause device addition and removal. This procedure is necessary to configure a new SCSI target on a Fibre Channel interconnect. Bear in mind that issue_lip is an asynchronous operation.

The command may complete before the entire scan has completed. You must monitor /var/log/messages to determine when it is done. The lpfc and qla2xxx drivers support issue_lip.

Leave a Comment