When constructing NvidiaPCIDevice objects for each 'parent' device in the
'/sys/class/mdev_bus' directory, use the default PCI devices root
'/sys/bus/pci/devices'. All devices in '/sys/class/mdev_bus' will have
a corresponding directory at '/sys/bus/pci/devices'.
Starting with bf3f431fc8
the construction of the NvidiaPCIDevice object will fail when attempting to detect the physfn.
When SRIOV is used, all the VFs will show up under '/sys/class/mdev_bus', but the physfn will
only show up under '/sys/bus/pci/devices'.
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This change adds a GetGPUByPciBusID method to the nvpci Interface.
The exising NewDevice function is moved to nvmdev where it is used.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
The 'mdev' string now represents the absolute path to an
mdev device (/sys/bus/pci/devices/<addr>/<uuid>) instead
of the mdev_type directory for the mdev device
(/sys/bus/pci/devices/<addr>/mdev_supported_types/<mdev-type>).
This is more intuitive and will make it easier to get
more information about a particular mdev device -
like the driver or iommu_group it belongs to - which can
be found at /sys/bus/pci/devices/<addr>/<uuid>.
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>