Obtaining diagnostic data for FCP channels

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

Diagnostic data about FCP channels is available as of z14 and FICON® Express8S.

About this task

FCP channel diagnostic data is available through sysfs attributes in /sys/bus/ccw/drivers/zfcp/<device_bus_id>/diagnostics, where <device_bus_id> is the device-bus ID of the FCP device that corresponds to the FCP channel.

After the diagnostic data is retrieved from the FCP channel, it is cached for a specific expiration interval, 5 seconds by default. Reading attributes within this interval results in the cached values. If you read attributes after the cache has expired, current values are retrieved from the FCP channel. You can use the diag_max_age sysfs attribute of the FCP device to change the expiration interval.

The following table summarizes the available attributes with diagnostic data.
Table 1. Attributes with diagnostic data about FCP channels
Attribute Explanation
sfp_invalid Flag that indicates whether the attributes with physical properties of the FCP channel provide valid (0) or useless (1) data. These attributes are: temperature, vcc, tx_bias, tx_power, and rx_power.
temperature Temperature of the transceiver. The value is a signed integer in units of 1/256 ℃. For example, interpret 1024 as 4 ℃.
vcc Supply voltage of the transceiver. The value is in units of 100 µV.
tx_bias Bias current of the transmitter laser. The value is in units of 2 µA.
tx_power Coupled output power of the transmitter laser. The value is in units of 0.1 µW.
rx_power Optical power that is measured at the receiving element. The value is in units of 0.1 µW.
optical_port Flag that indicates whether the transceiver uses an optical element (1) or does not use an optical element (0).
fec_active Flag that indicates whether forward error correction (FEC) is active (1) or inactive (0).
port_tx_type Type of the transmitting element. Possible values are:
0
Unknown
1
Short wave
2
Long wave, LC 1310 nm
3
Long wave, LL 1550 nm
connector_type Connector type. Possible values are:
0
Unknown
1
SFP+
b2b_credit Number of buffers available for receiving Class 2, or Class 3 frames on the local FC port.

Procedure

  1. Optional: Verify the validity of the data points with physical properties of the FCP channel.
    # cat /sys/bus/ccw/drivers/zfcp/<device_bus_id>/diagnostics/sfp_invalid
    
    For valid data, the attribute value must be 0.
  2. Optional: Adjust the expiration interval of the cached diagnostic data.
    1. Read the current expiration interval from the diag_max_age attribute.
      # cat /sys/bus/ccw/drivers/zfcp/<device_bus_id>/diag_max_age

      The attribute value is the expiration interval in milliseconds.

    2. Write the value, in milliseconds, of the new expiration interval to the diag_max_age attribute.
      # echo <expiration_interval> > /sys/bus/ccw/drivers/zfcp/<device_bus_id>/diag_max_age

    Setting the expiration interval to 0 disables caching. The combination of short expiration intervals or disabling caching and frequent reading of diagnostic data can adversely affect performance.

  3. Read the data of interest.
    # cat /sys/bus/ccw/drivers/zfcp/<device_bus_id>/diagnostics/<attribute>
    Where <attribute> is one of the attributes of Table 1.

Examples

  • In this example, the expiration interval for an FCP device that corresponds to bus ID 0.0.3d5c is changed from 5 seconds to 10 seconds.
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diag_max_age
    5000
    # echo 10000 > /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diag_max_age
    
  • In this example, the first command confirms that the attributes with physical properties of the FCP channel contain valid data. The next commands display data about the transceiver temperature, supply voltage, and type of the transmitting element.
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diagnostics/sfp_invalid
    0
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diagnostics/temperature
    7822
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diagnostics/vcc
    33000
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d5c/diagnostics/connector_type
    1
    The 0 returned from the first command confirms that the physical data is valid. The transceiver temperature is 30.55 ℃ (7822 / 256) and the supply voltage is 3.3000 V (33000 × 10-4). The connector_type is SFP+ (value 1).