diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-02-18 05:08:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-18 15:33:30 -0500 |
commit | bd66368940ae1c8c7491f55650b813c9d790f92c (patch) | |
tree | 5488e28d345c7e87b90fd4b06bc8c9ee67982175 /drivers/net/ethernet/chelsio/cxgb4vf | |
parent | f6f273bfe1e9d678de3598feb7906138cfe68b71 (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4vf')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 509fed946a2c..1d0fe9b60312 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2444,7 +2444,7 @@ static void reduce_ethqs(struct adapter *adapter, int n) | |||
2444 | */ | 2444 | */ |
2445 | static int enable_msix(struct adapter *adapter) | 2445 | static int enable_msix(struct adapter *adapter) |
2446 | { | 2446 | { |
2447 | int i, err, want, need; | 2447 | int i, want, need, nqsets; |
2448 | struct msix_entry entries[MSIX_ENTRIES]; | 2448 | struct msix_entry entries[MSIX_ENTRIES]; |
2449 | struct sge *s = &adapter->sge; | 2449 | struct sge *s = &adapter->sge; |
2450 | 2450 | ||
@@ -2460,25 +2460,23 @@ static int enable_msix(struct adapter *adapter) | |||
2460 | */ | 2460 | */ |
2461 | want = s->max_ethqsets + MSIX_EXTRAS; | 2461 | want = s->max_ethqsets + MSIX_EXTRAS; |
2462 | need = adapter->params.nports + MSIX_EXTRAS; | 2462 | need = adapter->params.nports + MSIX_EXTRAS; |
2463 | while ((err = pci_enable_msix(adapter->pdev, entries, want)) >= need) | ||
2464 | want = err; | ||
2465 | 2463 | ||
2466 | if (err == 0) { | 2464 | want = pci_enable_msix_range(adapter->pdev, entries, need, want); |
2467 | int nqsets = want - MSIX_EXTRAS; | 2465 | if (want < 0) |
2468 | if (nqsets < s->max_ethqsets) { | 2466 | return want; |
2469 | dev_warn(adapter->pdev_dev, "only enough MSI-X vectors" | 2467 | |
2470 | " for %d Queue Sets\n", nqsets); | 2468 | nqsets = want - MSIX_EXTRAS; |
2471 | s->max_ethqsets = nqsets; | 2469 | if (nqsets < s->max_ethqsets) { |
2472 | if (nqsets < s->ethqsets) | 2470 | dev_warn(adapter->pdev_dev, "only enough MSI-X vectors" |
2473 | reduce_ethqs(adapter, nqsets); | 2471 | " for %d Queue Sets\n", nqsets); |
2474 | } | 2472 | s->max_ethqsets = nqsets; |
2475 | for (i = 0; i < want; ++i) | 2473 | if (nqsets < s->ethqsets) |
2476 | adapter->msix_info[i].vec = entries[i].vector; | 2474 | reduce_ethqs(adapter, nqsets); |
2477 | } else if (err > 0) { | ||
2478 | dev_info(adapter->pdev_dev, "only %d MSI-X vectors left," | ||
2479 | " not using MSI-X\n", err); | ||
2480 | } | 2475 | } |
2481 | return err; | 2476 | for (i = 0; i < want; ++i) |
2477 | adapter->msix_info[i].vec = entries[i].vector; | ||
2478 | |||
2479 | return 0; | ||
2482 | } | 2480 | } |
2483 | 2481 | ||
2484 | static const struct net_device_ops cxgb4vf_netdev_ops = { | 2482 | static const struct net_device_ops cxgb4vf_netdev_ops = { |