SR-IOV Configuration
To set up SR-IOV, do the following:
Install the mstflint tools.
# yum install mstflint
Check the device’s PCI.
# lspci | grep Mellanox
Example:
00:06.0Infiniband controller: Mellanox Technologies MT27520 Family [ConnectX-3Pro]Check if SR-IOV is enabled in the firmware.
mstconfig -d <device pci> q
Example:
# mstconfig -d
00:06.0q Device #1: Device type: ConnectX3Pro PCI device:00:06.0Configurations: Current SRIOV_EN True(1) NUM_OF_VFS8LINK_TYPE_P1 ETH(2) LINK_TYPE_P2 IB(1) LOG_BAR_SIZE3BOOT_PKEY_P10BOOT_PKEY_P20BOOT_OPTION_ROM_EN_P1 True(1) BOOT_VLAN_EN_P1 False(0) BOOT_RETRY_CNT_P10LEGACY_BOOT_PROTOCOL_P1 PXE(1) BOOT_VLAN_P11BOOT_OPTION_ROM_EN_P2 True(1) BOOT_VLAN_EN_P2 False(0) BOOT_RETRY_CNT_P20LEGACY_BOOT_PROTOCOL_P2 PXE(1) BOOT_VLAN_P21IP_VER_P1 IPv4(0) IP_VER_P2 IPv4(0)Enable SR-IOV:
mstconfig –d <device pci> s SRIOV_EN=<False|True>
Configure the needed number of VFs
mstconfig –d <device pci> s NUM_OF_VFS=<NUM>
WarningThis file will be generated only if IOMMU is set in the grub.conf file (by adding “intel_iommu=on” to /boot/grub/grub.conf file).
[mlx4 devices only] Create/Edit the file /etc/modprobe.d/mlx4.conf:
options mlx4_core num_vfs=[needed num of VFs] port_type_array=[
1/2forIB/ETH],[1/2forIB/ETH]Example:
options mlx4_core num_vfs=
8port_type_array=1,1[mlx5 devices only] Write to the sysfs file the number of needed
echo [num_vfs] > sys/
class/net/ib2/device/sriov_numvfsExample:
# echo
8> /sys/class/net/ib2/device/sriov_numvfsReboot the driver.
Load the driver and verify that the VFs were created.
# lspci | grep mellanox
Example:
00:06.0Network controller: Mellanox Technologies MT27520 Family [ConnectX-3Pro]00:06.1Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.2Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.3Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.4Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.5Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.6Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.7Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]00:06.0Network controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3Pro Virtual Function]
For further information, refer to section "Setting Up SR-IOV" in the MLNX_OFED User Manual.