Commit 7b37f376 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by David S. Miller

i40e: 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() and pci_enable_msix_range()
interfaces.
Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0cc7c959
...@@ -5856,37 +5856,16 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) ...@@ -5856,37 +5856,16 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi)
**/ **/
static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors) static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors)
{ {
int err = 0; vectors = pci_enable_msix_range(pf->pdev, pf->msix_entries,
I40E_MIN_MSIX, vectors);
pf->num_msix_entries = 0; if (vectors < 0) {
while (vectors >= I40E_MIN_MSIX) {
err = pci_enable_msix(pf->pdev, pf->msix_entries, vectors);
if (err == 0) {
/* good to go */
pf->num_msix_entries = vectors;
break;
} else if (err < 0) {
/* total failure */
dev_info(&pf->pdev->dev,
"MSI-X vector reservation failed: %d\n", err);
vectors = 0;
break;
} else {
/* err > 0 is the hint for retry */
dev_info(&pf->pdev->dev,
"MSI-X vectors wanted %d, retrying with %d\n",
vectors, err);
vectors = err;
}
}
if (vectors > 0 && vectors < I40E_MIN_MSIX) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Couldn't get enough vectors, only %d available\n", "MSI-X vector reservation failed: %d\n", vectors);
vectors);
vectors = 0; vectors = 0;
} }
pf->num_msix_entries = vectors;
return vectors; return vectors;
} }
......
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