Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index

2021-03-08 Thread Viktor Mihajlovski
On 3/8/21 8:02 AM, Niklas Schnelle wrote: On 3/7/21 9:46 PM, Krzysztof Wilczyński wrote: Hi Niklas, [...] +static ssize_t index_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); +

Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index

2021-03-07 Thread Niklas Schnelle
On 3/7/21 9:46 PM, Krzysztof Wilczyński wrote: > Hi Niklas, > > [...] >> +static ssize_t index_show(struct device *dev, >> + struct device_attribute *attr, char *buf) >> +{ >> +struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); >> +u32 index = ~0; >> + >> +if

Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index

2021-03-07 Thread Krzysztof Wilczyński
Hi Niklas, [...] > +static ssize_t index_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); > + u32 index = ~0; > + > + if (zpci_unique_uid) > + index = zdev->uid; > + > +

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

2021-03-03 Thread Niklas Schnelle
On s390 each PCI device has a user-defined ID (UID) exposed under /sys/bus/pci/devices//uid. This ID was designed to serve as the PCI device's primary index and to match the device within Linux to the device configured in the hypervisor. To serve as a primary identifier the UID must be unique