Commit fc2f2f5d authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Jeff Kirsher

i40evf: Use pci_enable_msix_range() instead of pci_enable_msix()

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent df805f62
...@@ -1032,30 +1032,21 @@ i40evf_acquire_msix_vectors(struct i40evf_adapter *adapter, int vectors) ...@@ -1032,30 +1032,21 @@ i40evf_acquire_msix_vectors(struct i40evf_adapter *adapter, int vectors)
* Right now, we simply care about how many we'll get; we'll * Right now, we simply care about how many we'll get; we'll
* set them up later while requesting irq's. * set them up later while requesting irq's.
*/ */
while (vectors >= vector_threshold) { err = pci_enable_msix_range(adapter->pdev, adapter->msix_entries,
err = pci_enable_msix(adapter->pdev, adapter->msix_entries, vector_threshold, vectors);
vectors); if (err < 0) {
if (!err) /* Success in acquiring all requested vectors. */
break;
else if (err < 0)
vectors = 0; /* Nasty failure, quit now */
else /* err == number of vectors we should try again with */
vectors = err;
}
if (vectors < vector_threshold) {
dev_err(&adapter->pdev->dev, "Unable to allocate MSI-X interrupts.\n"); dev_err(&adapter->pdev->dev, "Unable to allocate MSI-X interrupts.\n");
kfree(adapter->msix_entries); kfree(adapter->msix_entries);
adapter->msix_entries = NULL; adapter->msix_entries = NULL;
err = -EIO; return err;
} else { }
/* Adjust for only the vectors we'll use, which is minimum /* Adjust for only the vectors we'll use, which is minimum
* of max_msix_q_vectors + NONQ_VECS, or the number of * of max_msix_q_vectors + NONQ_VECS, or the number of
* vectors we were allocated. * vectors we were allocated.
*/ */
adapter->num_msix_vectors = vectors; adapter->num_msix_vectors = err;
} return 0;
return err;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment