System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify ports of the same HBA from the details provided in /sys/class/fc_host

PrasannaKumari
Contributor

How to identify ports of the same HBA from the details provided in /sys/class/fc_host

I am referring to the details in /sys/class/fc_host and /sys/class/scsi_host directories for getting the HBA and port details. Which is the field that i can use to find out if the ports belong to the same HBA?

8 REPLIES
Turgay Cavdar
Honored Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Hi,

You can use both command combination:

 

# systool -c fc_host -v

 

# lspci -vt

 

Regards...

PrasannaKumari
Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Hi,

 

Thanks for the reply. Can you please let me know how i can identify which entry is for which HBA from lspci -vt command output.

 

Regards.

Turgay Cavdar
Honored Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Please post the output of the commands:

 

# systool -c fc_host -v

# lspci -vt

UVK
Trusted Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

try this

 

#systool -c fc_host -v | grep node_name
    node_name           = "0x50060b0000c32a01"
    node_name           = "0x50060b0000c32a03"

-------------------------------------------
Like it or worked !! Click kudos !!
PrasannaKumari
Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Hi,

Here are the command outputs.

 

# systool -c fc_host -v

Class = "fc_host"

  Class Device = "host0"
  Class Device path = "/sys/class/fc_host/host0"
    fabric_name         = "0x100500051ea1e4"
    issue_lip           = <store method only>
    node_name           = "0x200000e08b87a4f6"
    port_id             = "0x030c00"
    port_name           = "0x210000e08b87a4f6"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit"
    symbolic_name       = "QLA2342 FW:v3.03.26 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host0"
    Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0/0000:07:01.0/host0"
      ct                  =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      uevent              = <store method only>


  Class Device = "host1"
  Class Device path = "/sys/class/fc_host/host1"
    fabric_name         = "0x100500051ea1e4"
    issue_lip           = <store method only>
    node_name           = "0x200100e08ba7a4f6"
    port_id             = "0x031500"
    port_name           = "0x210100e08ba7a4f6"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit"
    symbolic_name       = "QLA2342 FW:v3.03.26 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0/0000:07:01.1/host1"
      ct                  =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      uevent              = <store method only>


  Class Device = "host2"
  Class Device path = "/sys/class/fc_host/host2"
    fabric_name         = "0x100500bf1e98c3"
    issue_lip           = <store method only>
    node_name           = "0x200000e08b126c07"
    port_id             = "0x061300"
    port_name           = "0x210000e08b126c07"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit"
    symbolic_name       = "QLA2342 FW:v3.03.26 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host2"
    Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2/0000:0a:01.0/host2"
      ct                  =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      uevent              = <store method only>


  Class Device = "host3"
  Class Device path = "/sys/class/fc_host/host3"
    fabric_name         = "0x100500051ea1e4"
    issue_lip           = <store method only>
    node_name           = "0x200100e08b326c07"
    port_id             = "0x032900"
    port_name           = "0x210100e08b326c07"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit"
    symbolic_name       = "QLA2342 FW:v3.03.26 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host3"
    Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2/0000:0a:01.1/host3"
      ct                  =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      uevent              = <store method only>

 

#lspci -vt
-[0000:00]-+-00.0  Intel Corporation E7520 Memory Controller Hub
           +-02.0-[0000:0d-0f]--
           +-04.0-[0000:06-0c]--+-00.0-[0000:07-09]--+-01.0  QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
           |                    |                    \-01.1  QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
           |                    \-00.2-[0000:0a-0c]--+-01.0  QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
           |                                         \-01.1  QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
           +-06.0-[0000:03-05]--
           +-1c.0-[0000:02]--+-01.0  Compaq Computer Corporation Smart Array 64xx
           |                 +-02.0  Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
           |                 \-02.1  Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
           +-1d.0  Intel Corporation 6300ESB USB Universal Host Controller
           +-1d.1  Intel Corporation 6300ESB USB Universal Host Controller
           +-1d.4  Intel Corporation 6300ESB Watchdog Timer
           +-1d.5  Intel Corporation 6300ESB I/O Advanced Programmable Interrupt Controller
           +-1d.7  Intel Corporation 6300ESB USB2 Enhanced Host Controller
           +-1e.0-[0000:01]--+-03.0  ATI Technologies Inc Rage XL
           |                 +-04.0  Compaq Computer Corporation Integrated Lights Out Controller
           |                 \-04.2  Compaq Computer Corporation Integrated Lights Out  Processor
           +-1f.0  Intel Corporation 6300ESB LPC Interface Controller
           \-1f.1  Intel Corporation 6300ESB PATA Storage Controller

 

 

Turgay Cavdar
Honored Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

You can see the device path matching...

/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0​/0000:07:01.0/host0
/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0​/0000:07:01.1/host1
00.0-[0000:07-09]--+-01.0 QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
01.1 QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA





/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2​/0000:0a:01.0/host2
/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2​/0000:0a:01.1/host3
00.2-[0000:0a-0c]--+-01.0 QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
01.1 QLogic Corp. ISP2312-based 2Gb Fibre Channel to PCI-X HBA
PrasannaKumari
Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Hi,

 

Thanks for the reply. I am trying to do this programatically. Can you please let me know how i can parse this output to be able to identify ports of the same HBA? which field of the device path should i compare with the output from the lspci -vt command?

 

Also, can you please tell me what the fabric_name field returned by the "systool -c fc_host -v" command means?

Can i use that field to identify if the ports belong to the same HBA? I observed this value to be the same for two ports belonging to the same HBA on one host. However, this is not happening on all the hosts.

 

Thanks, Prasanna

Matti_Kurkela
Honored Contributor

Re: How to identify ports of the same HBA from the details provided in /sys/class/fc_host

Look at the "Device path" strings.

Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0/0000:07:01.0/host0"

Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0/0000:07:01.1/host1"

Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2/0000:0a:01.0/host2"

Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2/0000:0a:01.1/host3"

 

The root of the PCI bus tree is the PCI domain 0000, bus 00 ("pci0000:00"). Small and medium servers usually have only one PCI domain: big things like Superdomes and big superclusters might have multiple PCI domains.

 

The next PCI element on all these 4 paths is 0000:00:04.0. This is a bridge device on PCI bus 00 that starts another sub-bus, bus 06 in this case. (The elements are of the form <domain>:<bus>:<device>.<function>).

 

The next PCI element is identical on both host pairs: 0000:06:00.0 on host0 + host1,  and 0000:06:00:2 on host2 + host3. Since this is not the last PCI element of the path, this is another bridge device. You might look read the files "vendor", "device", "subsystem_vendor" and "subsystem_device" in directories /sys/devices/pci0000:00/0000:00:04.0/0000:06:00.0 and /sys/devices/pci0000:00/0000:00:04.0/0000:06:00.2, and verify that the device IDs are not associated with any known FC HBA.

 

The last PCI element is different on each 4 cards:

  • 0000:07:01.0 on host0
  • 0000:07:01.1 on host1
  • 0000:0a:01.0 on host2
  • 0000:0a:01.1 on host3

But the only difference between host0 and host1 and also between host2 and host3 is in the "function" field. As far as I know, each individual physical PCI card must have its own "device" number, so it looks like host0 and host1 are on the same HBA card, and host2 and host3 are on the same HBA card.

 

But is this two separate 2-port HBAs, or a single 4-port HBA that has been designed by fitting the hardware of two 2-port HBAs on the same physical card and adding a bridge chip to present a single PCI interface? Unless you can positively identify the card model (by using the vendor/device/subsystem_vendor/subsystem_device IDs or any other method) or somehow already know whether the bridge device 0000:00:04.0 is part of the motherboard or not, you cannot know this. The device paths alone do not have enough information to determine that.

MK