diff --git a/pkg/inventory/db.go b/pkg/inventory/db.go index a206d049..467005c9 100644 --- a/pkg/inventory/db.go +++ b/pkg/inventory/db.go @@ -326,7 +326,9 @@ func addPCIAttributes(device *resourceapi.Device, ifName string, path string) { } func setPciRootAttr(device *resourceapi.Device, address *pciAddress) error { - pcieRootAttr, err := deviceattribute.GetPCIeRootAttributeByPCIBusID(address.bus) + // TODO(#199): Investigate ways to test correctness of PCI attributes + // discovery e2e (like standard PCI root attribute) + pcieRootAttr, err := deviceattribute.GetPCIeRootAttributeByPCIBusID(address.String()) if err != nil { return err } diff --git a/pkg/inventory/sysfs.go b/pkg/inventory/sysfs.go index e7fddda6..1c287b1e 100644 --- a/pkg/inventory/sysfs.go +++ b/pkg/inventory/sysfs.go @@ -124,6 +124,13 @@ type pciAddress struct { function string } +func (a pciAddress) String() string { + if a.domain == "" { + return fmt.Sprintf("%s:%s.%s", a.bus, a.device, a.function) + } + return fmt.Sprintf("%s:%s:%s.%s", a.domain, a.bus, a.device, a.function) +} + // The PCI root is the root PCI device, derived from the // pciAddress of a device. Spec is defined from the DRA KEP. // https://github.com/kubernetes/enhancements/pull/5316