Finding the physical channel associated with a CHPID

Ubuntu 22.04 LTS LPAR mode z/VM guest KVM guest

Use the mapping of physical channel IDs (PCHID) to CHPIDs to find the hardware from the CHPID number or the CHPID numbers from the PCHID.

About this task

A CHPID is associated with either a physical port or with an internal connection defined inside the mainframe, such as HiperSockets. See Figure 1. You can determine the PCHID or internal channel ID number that is associated with a CHPID number.
Figure 1. Relationships between CHPIDs, PCHIDs, and internal channel ID numbers.
Knowing the PCHID number can be useful in the following situations:
  • When Linux® indicates that a CHPID is in an error state, you can use the PCHID number to identify the associated hardware.
  • When a hardware interface requires service action, the PCHID mapping can be used to determine which CHPIDs and I/O devices will be affected.
The internal channel ID number can be useful to determine which CHPIDs are connected to the same communication path, such as a HiperSockets link.

Procedure

To find the physical channel ID corresponding to a CHPID, either:

  • Display the mapping of all CHPIDs to PCHIDs. Issue the lschp command:
    # lschp
  • Find the channel-ID related files for the CHPID.
    These sysfs files are located under /sys/devices/css0/chp0.<num>, where <num> is the two-digit, lowercase, hexadecimal CHPID number. There are two attribute files:
    chid
    The channel ID number.
    chid_external
    A flag that indicates whether this CHPID is associated with an internal channel ID (value 0) or a physical channel ID (value 1).

    The sysfs attribute files are not created when no channel ID information is available to Linux. For Linux in LPAR mode, this information is always available. For Linux on z/VM® and Linux on KVM, the availability depends on the configuration and on the hypervisor version.

Example

The lschp command shows channel ID information in a column labeled PCHID. Internal channel IDs are enclosed in brackets. If no channel ID information is available, the column shows "-".
# lschp
CHPID  Vary  Cfg.  Type  Cmg  Shared  PCHID
============================================
0.30   1     1     1b    2    1       0390
0.31   1     1     1b    2    1       0392
0.32   1     1     1b    2    1       0510
0.33   1     1     1b    2    1       0512
0.34   1     0     1b    -    -       0580
0.fc   1     1     24    3    1      (0702)
0.fd   1     1     24    3    1      (0703)
0.fe   1     1     24    3    1      (0704)
This example shows that CHPID 30 is associated with PCHID 0390, while CHPID fe is associated with internal channel ID 0704.
Alternatively, check the channel ID sysfs files, for example for CHPID 30:
# cat /sys/devices/css0/chp0.30/chid
0390
# cat /sys/devices/css0/chp0.30/chid_external
1