]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: hv: support reporting serial number as slot information
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 14 Sep 2018 19:54:56 +0000 (12:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Sep 2018 14:59:41 +0000 (07:59 -0700)
commit35ddd36bfa6b6f54dbe8deed7e54993f497dc1d7
tree11c90439f7fa23e52d1a4ac07472f361439f344e
parentc4435b28fc87310daaca8964c61fa123b245a325
PCI: hv: support reporting serial number as slot information

The Hyper-V host API for PCI provides a unique "serial number" which
can be used as 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 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 maybe some cases where serial number is not unique such
as when using GPU's. But the PCI slot infrastructure will handle
that.

This has a side effect which may also be useful. The common udev
network device naming policy uses the slot information (rather
than PCI address).

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/pci/controller/pci-hyperv.c