[SRU][J][PATCH 0/1] [UBUNTU 22.04] PCHID per Port Toleration - IBM z17 Enablement (LP: #2119650)

Massimiliano Pellizzer massimiliano.pellizzer at canonical.com
Thu Aug 28 09:30:51 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2119650

[ Impact ]

Improve how s390 kernel discovers and organizes PCI devices, making it more
robust, predictable, and compatible with modern hardware and virtualization
scenarios.

Previously, PCI functions were grouped based on firmware-provided order and
physical channel IDs (PCHIDs), leading to unstable device numbering and
incorrect grouping in complex setups.

The new implementation explicitly sorts PCI functions by Requester ID (RID) and
uses Topology IDs (TIDs) to group multi-function devices, ensuring deterministic
and future-proof bus/domain creation. It fixes SR-IOV behavior by properly
grouping Physical Functions (PFs) and Virtual Functions (VFs), allowing PFs
initially in standby to form shared domains and treating isolated VFs without a
parent PF as standalone devices.

Parent PF detection has been refactored for consistency, and error handling has
been improved to prevent leaks and crashes when adding devices dynamically.

[ Fix ]

Backport to Jammy the following commits:
52c79e636a58da s390/pci: make better use of zpci_dbg() levels
0467cdde8c4320 s390/pci: Sort PCI functions prior to creating virtual busses
126034faaac5f3 s390/pci: Use topology ID for multi-function devices
fd1ae23b495b3a PCI: Prefer 'unsigned int' over bare 'unsigned'
c3df83e01a96ca PCI: Clean up pci_scan_slot()
fbed59ed8781d7 PCI: Split out next_ari_fn() from next_fn()
db360b1ea7faef PCI: Move jailhouse's isolated function handling to
pci_scan_slot()
189c6c33ff421d PCI: Extend isolated function probing to s390
960ac362648780 s390/pci: allow zPCI zbus without a function zero
45e5f0c017e0d0 s390/pci: clean up left over special treatment for function zero
25f39d3dcb48bb s390/pci: Ignore RID for isolated VFs
48796104c864cf s390/pci: Fix leak of struct zpci_dev when zpci_add_device()
fails
dc287e4c9149ab s390/pci: Fix SR-IOV for PFs initially in standby
05793884a1f305 s390/pci: Pull search for parent PF out of
zpci_iov_setup_virtfn()
2844ddbd540fc8 s390/pci: Fix handling of isolated VFs
8691abd3afaadd s390/pci: Fix zpci_bus_is_isolated_vf() for non-VFs
42420c50c68f3e s390/pci: Fix missing check for zpci_create_device() error return

[ Test Case ]

Testing must be performed on an IBM z17 with Network Express adapters in direct
mode.

Begin by attaching at least one adapter with two PFs, each mapped to a separate
port, and confirm that the kernel groups them correctly into distinct domains
without relying on PCHID ordering.

Next, enable SR-IOV on each PF and verify that child VFs are discovered, grouped
with the correct PFs, and functional. Test with PFs initially in standby to
ensure that shared domains are created dynamically. Introduce isolated VFs
without a visible PF and confirm they enumerate as standalone devices.

Finally, perform hotplug and removal of both PFs and VFs, checking that zpci_dev
structures are cleaned up correctly without leaks or crashes.

[ Regression Potential ]

The patchset affects s390 PCI subsystem, in particular:
- device enumeration
- function grouping
- SR-IOV handling
An issue in this code may introduce problems such as incorrect grouping of PFs
and VFs, unstable bus numbering, or failure to associate VFs with their parent
PFs.

[ Other Info ]

The patchset has already been tested by IBM using the following PPA:
- https://launchpad.net/~mpellizzer/+archive/ubuntu/ibm-z




More information about the kernel-team mailing list