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

cxgb4: 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: Dimitris Michailidis <dm@chelsio.com>
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc1d0bf1
...@@ -5737,7 +5737,7 @@ static void reduce_ethqs(struct adapter *adap, int n) ...@@ -5737,7 +5737,7 @@ static void reduce_ethqs(struct adapter *adap, int n)
static int enable_msix(struct adapter *adap) static int enable_msix(struct adapter *adap)
{ {
int ofld_need = 0; int ofld_need = 0;
int i, err, want, need; int i, want, need;
struct sge *s = &adap->sge; struct sge *s = &adap->sge;
unsigned int nchan = adap->params.nports; unsigned int nchan = adap->params.nports;
struct msix_entry entries[MAX_INGQ + 1]; struct msix_entry entries[MAX_INGQ + 1];
...@@ -5753,32 +5753,30 @@ static int enable_msix(struct adapter *adap) ...@@ -5753,32 +5753,30 @@ static int enable_msix(struct adapter *adap)
} }
need = adap->params.nports + EXTRA_VECS + ofld_need; need = adap->params.nports + EXTRA_VECS + ofld_need;
while ((err = pci_enable_msix(adap->pdev, entries, want)) >= need) want = pci_enable_msix_range(adap->pdev, entries, need, want);
want = err; if (want < 0)
return want;
if (!err) { /*
/* * Distribute available vectors to the various queue groups.
* Distribute available vectors to the various queue groups. * Every group gets its minimum requirement and NIC gets top
* Every group gets its minimum requirement and NIC gets top * priority for leftovers.
* priority for leftovers. */
*/ i = want - EXTRA_VECS - ofld_need;
i = want - EXTRA_VECS - ofld_need; if (i < s->max_ethqsets) {
if (i < s->max_ethqsets) { s->max_ethqsets = i;
s->max_ethqsets = i; if (i < s->ethqsets)
if (i < s->ethqsets) reduce_ethqs(adap, i);
reduce_ethqs(adap, i); }
} if (is_offload(adap)) {
if (is_offload(adap)) { i = want - EXTRA_VECS - s->max_ethqsets;
i = want - EXTRA_VECS - s->max_ethqsets; i -= ofld_need - nchan;
i -= ofld_need - nchan; s->ofldqsets = (i / nchan) * nchan; /* round down */
s->ofldqsets = (i / nchan) * nchan; /* round down */ }
} for (i = 0; i < want; ++i)
for (i = 0; i < want; ++i) adap->msix_info[i].vec = entries[i].vector;
adap->msix_info[i].vec = entries[i].vector;
} else if (err > 0) return 0;
dev_info(adap->pdev_dev,
"only %d MSI-X vectors left, not using MSI-X\n", err);
return err;
} }
#undef EXTRA_VECS #undef EXTRA_VECS
......
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