2021-03-04 23:13:58

by Niklas Schnelle

[permalink] [raw]
Subject: [RFC 0/1] s390/pci: expose a PCI device's UID as its index

Hi,

On s390 each PCI device has a user-defined ID (UID). This ID was
designed to serve as the PCI device's primary index and to match the
device within Linux to the with the view in the hypervisor
configuration. To serve as a primary identifier the UID must be unique
within the Linux instance, this is guaranteed by the platform if and
only if the UID Uniqueness Checking flag is set within the CLP List PCI
Functions response which is also currently used to determine whether the
UID is also used as the Domain part of the geographical PCI address of
the device.

As primary identifier of a PCI device, the UID serves an analogous
function as the SMBIOS instance number or ACPI index exposed as the
"index" respectively "acpi_index" device attributes. These attributes
are used by e.g. systemd/udev to set network interface names. As s390
does not use ACPI nor SMBIOS there is no conflict and we can expose the
UID under the "index" attribute whenever UID Uniqueness Checking is
active and systemd/udev will then create "eno<UID>.." interface names.

Note: This is an evolution of an earlier patch I sent for exposing the
UID Uniqueness Checking flag directly. Thank you Greg for making me
realize that we were looking too much at just exposing platform details
instead of looking how existing interfaces could suit our purpose.

Thanks,
Niklas Schnelle

Niklas Schnelle (1):
s390/pci: expose a PCI device's UID as its index

Documentation/ABI/testing/sysfs-bus-pci | 11 +++++---
arch/s390/pci/pci_sysfs.c | 36 +++++++++++++++++++++++++
2 files changed, 43 insertions(+), 4 deletions(-)

--
2.25.1