igb: don't allow SR-IOV without MSI-X
authorMitch A Williams <mitch.a.williams@intel.com>
Thu, 20 Jun 2013 06:03:36 +0000 (06:03 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 22 Aug 2013 09:25:44 +0000 (02:25 -0700)
MSI-X interrupts are required for SR-IOV operation. Check to make sure
they're enabled before allowing the user to turn on VFs.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 8e7c1b83da19c821cf7dd186a8f6239ac4ab06f5..94295a06c12482b4c1721c34cff63609c7140ee3 100644 (file)
@@ -2436,6 +2436,11 @@ static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs)
        int err = 0;
        int i;
 
+       if (!adapter->msix_entries) {
+               err = -EPERM;
+               goto out;
+       }
+
        if (!num_vfs)
                goto out;
        else if (old_vfs && old_vfs == num_vfs)