Ensure the requisite number of VF’s are created from the parent PF using the parent PF’s BDF value.
This has to be redone afresh every time the host machine is rebooted unless the config is made persistent, explained in the following section:
echo vf-num /sys/bus/pci/devices/parent PF bdf/sriov_numvfs
Using the lspci command, grep to search for Virtual Functions carved out from PF.
CSP NIC Mode
The following table explains NIC mapping options on CSP and the corresponding performance implications:
Mode |
Explanation |
Comments |
---|---|---|
SR-IOV mode |
Virtual Network Functionscreated from physical NIC |
Allows pNICs to be shared amongst VMs without sacrificing performance, since packets are switched in HW. Maximum 32 virtual functions (VFs) can be configured per pNIC. |
Making the Virtual Functions Persistent
To make the Virtual Functions persistent across reboots, use the editor of your choice to create an udev rule similar to the following, where you specify the intended number of VFs (in this example, 2), up to the limit supported by the network interface card.
vim /etc/udev/rules.d/enp14s0f0.rules ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_DRIVER}=="ixgbe", ATTR{device/sriov_numvfs}="2"
In the following example, replace enp14s0f0
with the PF network device name(s) and adjust the value of ENV{ID_NET_DRIVER} to match the driver in use.
To find the driver in use, run the following command:
ethtool -i | grep driver</code>
This will ensure the feature is enabled at boot-time.