Configuring SR-IOV in Linux
This section uses RHEL 7.2 as an example. For details about the configuration on other OSs, see the OS documentation provided by the OS vendors.
To configure SR-IOV in RHEL 7.2, perform the following steps:
- Enter the QLogic BIOS, and enable SR-IOV.
- Edit the grub.cfg file on the OS.The directory of the grub.cfg file varies with the boot mode used.
- In legacy mode, run the vi /boot/grub2/grub.cfg command to open the grub.cfg file.
- In the UEFI mode, run the vi /boot/efi/EFI/redhat/grub.cfg command to open the grub.cfg file.
- Add intel_iommu=on after rhgb quiet LANG=en_US.UTF-8.Figure 4-259 Editing the grub.cfg file
- Run the lspci | grep-i eth command to view NIC ports.Figure 4-260 Viewing NIC ports
- Enable SR-IOV as follows: In Linux, run the rmmod bnx2x command to uninstall the bnx2x driver and run the modprobe bnx2x num_vfs=[num] use_random_vf_mac=1 command. In this example, two VFs are configured for each port.Figure 4-261 Setting the number of VFs
- Run the lspci | grep-i eth command to view all NIC ports, which include four physical ports and the VFs added in the previous step.Figure 4-262 Checking the VF generation result (1)
You can also run the ifconfig -a command to view VFs.
Figure 4-263 Checking the VF generation result (2)After VFs are created for the MZ520, do not use commands (such as ifconfig or ip link set) to shut down physical ports or PFs; otherwise, the VFs cannot work properly. If physical ports or PFs are disabled accidentally, restart the OS.