To enable SR-IOV on KVM, perform the following steps.

If you don’t have Virtual Functions, but you have a NIC that supports Virtual Functions, you will need to enable it.

  1. Enable SR-IOV in BIOS.

    This will be dependent on your BIOS. Login to the BIOS console and look for SR-IOV Support/DMA. You can verify support on prompt by checking that Intel has the correct CPU flag.

    cat /proc/cpuinfo | grep vmx
  2. Add the Options on Boot (in /etc/default/grub).
    GRUB_CMDLINE_LINUX="intel_iommu=on"
    1. After this. run the following commands:
      update-grub
      update-initramfs -u
    2. Reboot and make sure iommu is enabled.
      velocloud@KVMperf3:~$ dmesg | grep -i IOMMU
      [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.13.0-107-generic root=/dev/mapper/qa--multiboot--002--vg-root ro intel_iommu=on splash quiet vt.handoff=7 
      [ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.13.0-107-generic root=/dev/mapper/qa--multiboot--002--vg-root ro intel_iommu=on splash quiet vt.handoff=7 
      [ 0.000000] Intel-IOMMU: enabled
      [ 0.083191] dmar: IOMMU 0: reg_base_addr fbffc000 ver 1:0 cap d2078c106f0466 ecap f020de 
      [ 0.083197] dmar: IOMMU 1: reg_base_addr c7ffc000 ver 1:0 cap d2078c106f0466 ecap f020de 
      velocloud@KVMperf3:~$ 
  3. Add the ixgbe Driver in Linux by clicking the link below. https://downloadcenter.intel.com/download/14687/Intel-Network-Adapter-Driver-for-PCIe-Intel-10-Gigabit-Ethernet-Network-Connections-Under-Linux-
    1. On the left section of the Intel website ( Other Versions section), click the 5.2.1 link.
    2. Download ixgbe from Intel. Follow compile options.
    3. Configure ixgbe config (tar and sudo make install).
      velocloud@KVMperf1:~$ cat /etc/modprobe.d/ixgbe.conf
    4. If the file doesn’t exist, create it.
      options ixgbe max_vfs=32,32
      options ixgbe allow_unsupported_sfp=1
      options ixgbe MDD=0,0
      blacklist ixgbevf 
    5. Execute the following command and reboot:
      update-initramfs -u
    6. Use modinfo to see if it is property installed.
       velocloud@KVMperf1:~$ modinfo ixgbe and ip link 
       filename: /lib/modules/4.4.0-62-generic/updates/drivers/net/ethernet/intel/ixgbe/ixgbe.ko 
       version: 5.0.4 
       license: GPL 
       description: Intel(R) 10GbE PCI Express Linux Network Driver 
       author: Intel Corporation, <linux.nics@intel.com> 
       srcversion: BA7E024DFE57A92C4F1DC93                       

      After rebooting the VM, you should see the interfaces.

To properly validate that SR-IOV is ready to be used:

  • Verify this by running:
    lspci | grep -i ethernet
  • Verify that you have Virtual Functions:
    01:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)