cxgb4vf: 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: Alexander Gordeev <agordeev@redhat.com> Cc: Casey Leedom <leedom@chelsio.com> Cc: netdev@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f6f273bfe1
commit
bd66368940
|
@ -2444,7 +2444,7 @@ static void reduce_ethqs(struct adapter *adapter, int n)
|
|||
*/
|
||||
static int enable_msix(struct adapter *adapter)
|
||||
{
|
||||
int i, err, want, need;
|
||||
int i, want, need, nqsets;
|
||||
struct msix_entry entries[MSIX_ENTRIES];
|
||||
struct sge *s = &adapter->sge;
|
||||
|
||||
|
@ -2460,11 +2460,12 @@ static int enable_msix(struct adapter *adapter)
|
|||
*/
|
||||
want = s->max_ethqsets + MSIX_EXTRAS;
|
||||
need = adapter->params.nports + MSIX_EXTRAS;
|
||||
while ((err = pci_enable_msix(adapter->pdev, entries, want)) >= need)
|
||||
want = err;
|
||||
|
||||
if (err == 0) {
|
||||
int nqsets = want - MSIX_EXTRAS;
|
||||
want = pci_enable_msix_range(adapter->pdev, entries, need, want);
|
||||
if (want < 0)
|
||||
return want;
|
||||
|
||||
nqsets = want - MSIX_EXTRAS;
|
||||
if (nqsets < s->max_ethqsets) {
|
||||
dev_warn(adapter->pdev_dev, "only enough MSI-X vectors"
|
||||
" for %d Queue Sets\n", nqsets);
|
||||
|
@ -2474,11 +2475,8 @@ static int enable_msix(struct adapter *adapter)
|
|||
}
|
||||
for (i = 0; i < want; ++i)
|
||||
adapter->msix_info[i].vec = entries[i].vector;
|
||||
} else if (err > 0) {
|
||||
dev_info(adapter->pdev_dev, "only %d MSI-X vectors left,"
|
||||
" not using MSI-X\n", err);
|
||||
}
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops cxgb4vf_netdev_ops = {
|
||||
|
|
Loading…
Reference in New Issue