cilium/cilium · error
pf kernel ifname for device %s: %w
Error message
pf kernel ifname for device %s: %w
What it means
In parseDevice, after resolving the VF's parent PF PCI address from sysfs, the manager looks up the PF's netlink attributes by PCI address; if absent it cannot determine the PF kernel interface name and fails with errInterfaceNotFound. The PF netdev either doesn't exist or wasn't enumerated.
Source
Thrown at pkg/networkdriver/sriov/sriov.go:471
dev.Vendor = strings.TrimSpace(string(vendor))
device, err := os.ReadFile(filepath.Join(devicePath, "device"))
if err != nil {
return nil, err
}
dev.DeviceID = strings.TrimSpace(string(device))
pfPath, err := os.Readlink(filepath.Join(devicePath, "physfn"))
if err != nil {
// this is not a vf
return nil, errNotAVF
}
pfAddr := filepath.Base(pfPath)
pfAttrs, ok := netlinkAttrs[PCIAddr(pfAddr)]
if !ok {
return nil, fmt.Errorf("pf kernel ifname for device %s: %w", pfAddr, errInterfaceNotFound)
}
dev.PFName = pfAttrs.Name
pfDevPath := filepath.Join(mgr.pciDevicesPath(), pfAddr)
// to resolve the VF id, we iterate over all VFs under the PF attributes
// and map the ids to the `virtfn$x` path under the pf device.
// if the path linked matches the path of our vf address, then we found the id.
for _, vf := range pfAttrs.Vfs {
// root@c3-small-x86-01-bernardo:/sys/class/net/enp2s0f0np0/device# readlink virtfn0
// ../0000:02:00.2
// root@c3-small-x86-01-bernardo:/sys/class/net/enp2s0f0np0/device# readlink virtfn1
// ../0000:02:00.3
v, err := os.Readlink(filepath.Join(pfDevPath, fmt.Sprintf("virtfn%d", vf.ID)))
if err != nil {
continue
}
View on GitHub (pinned to ac7b90affa)
Solutions
- Verify the PF has a kernel netdev: ls /sys/bus/pci/devices/<pf-addr>/net/.
- If the PF must be kernel-managed, rebind it to its NIC driver (e.g. mlx5_core) instead of vfio-pci.
- Re-run discovery after the PF netdev is registered; boot-time races resolve once links are up.
- Check the manager's sysfs root (/host/sys) is mounted correctly in the container.
Defensive patterns
Strategy: validation
Validate before calling
pfNet := "/sys/bus/pci/devices/" + pfAddr + "/net"
if entries, err := os.ReadDir(pfNet); err != nil || len(entries) == 0 {
return fmt.Errorf("PF %s has no kernel netdev; SR-IOV discovery will fail", pfAddr)
} Try / catch
devices, err := mgr.ListDevices(ctx)
if err != nil {
if errors.Is(err, sriov.ErrInterfaceNotFound) {
// PF bound to userspace driver or missing; alert and re-run after fix
}
return err
} Prevention
- Keep the PF bound to its kernel NIC driver when using the sriov manager.
- Mount host /sys at the path the manager expects.
- Start the manager after NIC drivers have registered their links.
When it happens
Trigger: Discovering a VF whose parent PF's PCI address is not in the pciAddr→netlink-attrs map built from LinkList — PF netdev missing, PF bound to a non-netdev driver (vfio-pci), or safenetlink.LinkList failing to return the PF.
Common situations: PF bound to DPDK drivers so no kernel interface exists; BIOS/boot option disabling the PF netdev; netlink enumeration race during node boot; sysfs mounted at a non-standard path so ParentDev resolution mismatches.
Related errors
- device is not a vf
- failed to re-create device %s on demand: %w
- failed to set up VF: PF name is empty, device with name %s (
- failed to set vlan id %d for vf %d on link %s: %w
- failed to free VF: PF name is empty, device with name %s (%s
AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31).
Data as JSON: /api/errors/29e2bb657952be51.
Report an issue: GitHub.