Re: [PATCH] PCI: hv: support reporting serial number as slot information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 4 Jul 2018 17:08:34 +0100
Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx> wrote:

> On Tue, Jun 12, 2018 at 09:40:37AM -0700, Stephen Hemminger wrote:
> > The Hyper-V host API for PCI provides a unique "serial number" which
> > can be used as the basis for sysfs PCI slot table. This can be useful
> > for cases where userspace wants to find the PCI device based on
> > serial number.
> > 
> > When an SR-IOV NIC is added, the host sends an attach message
> > with a serial number. The kernel doesn't use the serial number, but
> > it is useful when doing the same thing in a userspace driver such
> > as the DPDK. By having /sys/bus/pci/slots/N it provides a direct
> > way to find the matching PCI device.
> > 
> > There may be some cases where the serial number is not unique such
> > as when using GPU's. But the PCI slot infrastructure will handle
> > that.
> > 
> > This also shortens the network device names generated by
> > systemd/udev. The new names use slot (ens2) rather than
> > PCI address (enP2p0s2).  
> 
> Hi Stephen,
> 
> I wanted to apply this patch but wanted to make sure all HV
> maintainers are in agreement first since this looks like
> a significant user-space ABI change.
> 
> I would also ask Bjorn's opinion on this since he has more
> insights into the slot interface history.
> 
> Thanks,
> Lorenzo

It adds an API, but does not change existing sysfs entries.
The potential issues are more about how that new API will cause systemd/udev
to respond. It makes Hyper-V look more like KVM and that is generally
a good thing.

The systemd developers should like this change, but it may cause some
users to have problems since in general the existing udev model does
not do persistent names on PCI devices.  But the PCI device for networking
is only used as a VF device paired with a PV device (netvsc). All network
configuration is done on the PV device; the name of the VF device doesn't
really matter.

The purpose of this was to take incremental steps to use the serial
number for matching PV and VF devices (rather than by MAC address).
There is ongoing work in DPDK (in userspace) where being able to find
a PCI device by serial number would be useful.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux