Configuring SR-IOV - Configuring SR-IOV - UG1739

AMD Solarflare X4 Series Ethernet Adapter User Guide (UG1739)

Document ID
UG1739
Release Date
2026-08-04
Revision
1.4 English

This section describes how to configure SR-IOV.

Enabling Virtual Functions Through sysfs

You can enable VFs through sysfs:

  • Use the following command to enable VFs:
    echo <numvfs> > /sys/class/net/<interface>/device/sriov_numvfs
    For example to enable two VFs on the eth8 PF:
    echo 2 > /sys/class/net/eth8/device/sriov_numvfs
  • Use the following command to view the enabled VFs:
    cat /sys/class/net/<interface>/device/sriov_totalvfs
    For example to view the enabled VFs on the eth8 PF:
    cat /sys/class/net/eth8/device/sriov_totalvfs

Enabling Virtual Functions with Module Options

You can instead use the AMD Solarflare net driver module option max_vfs to enable VFs. This is useful if the kernel does not provide VF control via sysfs.

You should set the max_vfs module option in a user-created file (for example sfc.conf) in the /etc/modprobe.d directory. Its value applies to all adapters:

  • You can set it to a single integer for all adapter PFs to have the same number of VFs. For example:
    options sfc max_vfs=4
  • You can set it to a comma separated list to have different numbers of VFs per PF. For example:
    options sfc max_vfs=2,4,8

    The first VF count is assigned to the PF with the lowest index (that is, the lowest MAC address), then the next VF count to the PF with the next highest MAC address, and so on.

Reload the sfc driver following any changes to its module options:

modprobe -r sfc
modprobe sfc

Assigning VLAN Tags

You can dynamically assigned VLAN tags to VFs using libvirt commands, or using the ip command:

ip link vf NUM [mac LLADDR] [vlan VLANID]

To ensure VLAN tags persist after reboot, you can configure them in the VM XML file.

Using OpenOnload in a Virtual Machine

Onload users should refer to the Onload User Guide (UG1586) for further information about using Onload in a KVM.

When Onload and the sfc net driver have been installed in the guest, the sfc driver module option num_vis is used to allocate the required number of virtual interfaces. One VI is needed for each Onload stack using a VF.

You should enable driver module options in a user-created file (for example sfc.conf) in the /etc/modprobe.d directory.

options sfc num_vis=<num>

Reload the driver after setting/changing this value:

# onload_tool reload