linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Narendra K <narendra_k@dell.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Viktor Mihajlovski <mihajlov@linux.ibm.com>,
	Stefan Raspl <raspl@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: [RFC 0/1] s390/pci: expose a PCI device's UID as its index
Date: Wed,  3 Mar 2021 10:52:49 +0100	[thread overview]
Message-ID: <20210303095250.1360007-1-schnelle@linux.ibm.com> (raw)

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


             reply	other threads:[~2021-03-03 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  9:52 Niklas Schnelle [this message]
2021-03-03  9:52 ` [RFC 1/1] s390/pci: expose a PCI device's UID as its index Niklas Schnelle
2021-03-07 20:46   ` Krzysztof Wilczyński
2021-03-08  7:02     ` Niklas Schnelle
2021-03-08  8:42       ` Viktor Mihajlovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210303095250.1360007-1-schnelle@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mihajlov@linux.ibm.com \
    --cc=narendra_k@dell.com \
    --cc=oberpar@linux.ibm.com \
    --cc=raspl@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).