Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Fix discovery of device, subsystem_vendor and subsystem_device #193

@gauravkghildiyal

Description

@gauravkghildiyal

We're looking for these files in the wrong location:

device, err = os.ReadFile(filepath.Join(sysdevPath, ifName, "device/device"))
if err == nil {
subsystemVendor, err = os.ReadFile(filepath.Join(sysdevPath, ifName, "device/subsystem_vendor"))
if err == nil {
subsystemDevice, _ = os.ReadFile(filepath.Join(sysdevPath, ifName, "device/subsystem_device"))
}
}

These files are located as /sys/class/net/<INTERFACE_NAME>/device/ and not at /sys/devices/<INTERFACE_NAME>/device

Also, it appears that correctly deriving these values causes some downstream issues where we fail to fetch the device from pcidb:

entry, err := pcidb.GetDevice(
strings.TrimPrefix(strings.TrimSpace(string(vendor)), "0x"),
strings.TrimPrefix(strings.TrimSpace(string(device)), "0x"),
strings.TrimPrefix(strings.TrimSpace(string(subsystemVendor)), "0x"),
strings.TrimPrefix(strings.TrimSpace(string(subsystemDevice)), "0x"),
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions