diff options
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 9df28985eba7..a6af7b7c59b1 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1817,7 +1817,6 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter) | |||
1817 | static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter, | 1817 | static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter, |
1818 | int vectors) | 1818 | int vectors) |
1819 | { | 1819 | { |
1820 | int err = 0; | ||
1821 | int vector_threshold; | 1820 | int vector_threshold; |
1822 | 1821 | ||
1823 | /* We'll want at least 2 (vector_threshold): | 1822 | /* We'll want at least 2 (vector_threshold): |
@@ -1831,33 +1830,24 @@ static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter, | |||
1831 | * Right now, we simply care about how many we'll get; we'll | 1830 | * Right now, we simply care about how many we'll get; we'll |
1832 | * set them up later while requesting irq's. | 1831 | * set them up later while requesting irq's. |
1833 | */ | 1832 | */ |
1834 | while (vectors >= vector_threshold) { | 1833 | vectors = pci_enable_msix_range(adapter->pdev, adapter->msix_entries, |
1835 | err = pci_enable_msix(adapter->pdev, adapter->msix_entries, | 1834 | vector_threshold, vectors); |
1836 | vectors); | ||
1837 | if (!err || err < 0) /* Success or a nasty failure. */ | ||
1838 | break; | ||
1839 | else /* err == number of vectors we should try again with */ | ||
1840 | vectors = err; | ||
1841 | } | ||
1842 | 1835 | ||
1843 | if (vectors < vector_threshold) | 1836 | if (vectors < 0) { |
1844 | err = -ENOMEM; | ||
1845 | |||
1846 | if (err) { | ||
1847 | dev_err(&adapter->pdev->dev, | 1837 | dev_err(&adapter->pdev->dev, |
1848 | "Unable to allocate MSI-X interrupts\n"); | 1838 | "Unable to allocate MSI-X interrupts\n"); |
1849 | kfree(adapter->msix_entries); | 1839 | kfree(adapter->msix_entries); |
1850 | adapter->msix_entries = NULL; | 1840 | adapter->msix_entries = NULL; |
1851 | } else { | 1841 | return vectors; |
1852 | /* | ||
1853 | * Adjust for only the vectors we'll use, which is minimum | ||
1854 | * of max_msix_q_vectors + NON_Q_VECTORS, or the number of | ||
1855 | * vectors we were allocated. | ||
1856 | */ | ||
1857 | adapter->num_msix_vectors = vectors; | ||
1858 | } | 1842 | } |
1859 | 1843 | ||
1860 | return err; | 1844 | /* Adjust for only the vectors we'll use, which is minimum |
1845 | * of max_msix_q_vectors + NON_Q_VECTORS, or the number of | ||
1846 | * vectors we were allocated. | ||
1847 | */ | ||
1848 | adapter->num_msix_vectors = vectors; | ||
1849 | |||
1850 | return 0; | ||
1861 | } | 1851 | } |
1862 | 1852 | ||
1863 | /** | 1853 | /** |