Finding out whether NPIV is in use

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

An FCP device runs in NPIV mode if the port_type attribute of the FCP device attribute contains the string "NPIV". Alternatively, if the applicable permanent_port_name and port_name are not the same and are not NULL.

Procedure

Read the port_type attribute of the FCP device.
Issue a command of the following form:
# cat /sys/bus/ccw/drivers/zfcp/<device_bus_id>/<host_no>/fc_host/<host_no>/port_type
NPIV VPORT
For example:
# cat /sys/bus/ccw/drivers/zfcp/0.0.3d0c/host0/fc_host/host0/port_type
NPIV VPORT
Alternatively, compare the values of the permanent_port_name attribute and the port_name.
Tip: You can use lszfcp (see lszfcp - List zfcp devices) to list the FCP device attributes.

Example

# lszfcp -b 0.0.3d0c -a
0.0.3d0c host0
Bus = "ccw"
    availability        = "good"
    ...
Class = "fc_host"
    ...
    node_name           = "0x5005076400c829e7"
    permanent_port_name = "0xc05076ffeb001201"
    port_id             = "0x67e35d"
    port_name           = "0xc05076ffeb001b48"
    port_state          = "Online"
    port_type           = "NPIV VPORT" 
    ...
    symbolic_name       = "IBM type serial  PCHID: 0120 NPIV UlpId: 02600F18   DEVNO: 0.0.3d0c NAME: hostname.domain"
    ...

The port_type attribute directly indicates that NPIV is used. The example also shows that permanent_port_name is different from port_name and neither is NULL. The example also shows the symbolic_name attribute that shows the symbolic port name that was registered on the FC name server.