aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/brocade')
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 4ad1187e82fb..aeec9ccc0b39 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -2669,9 +2669,11 @@ bnad_enable_msix(struct bnad *bnad)
2669 for (i = 0; i < bnad->msix_num; i++) 2669 for (i = 0; i < bnad->msix_num; i++)
2670 bnad->msix_table[i].entry = i; 2670 bnad->msix_table[i].entry = i;
2671 2671
2672 ret = pci_enable_msix(bnad->pcidev, bnad->msix_table, bnad->msix_num); 2672 ret = pci_enable_msix_range(bnad->pcidev, bnad->msix_table,
2673 if (ret > 0) { 2673 1, bnad->msix_num);
2674 /* Not enough MSI-X vectors. */ 2674 if (ret < 0) {
2675 goto intx_mode;
2676 } else if (ret < bnad->msix_num) {
2675 pr_warn("BNA: %d MSI-X vectors allocated < %d requested\n", 2677 pr_warn("BNA: %d MSI-X vectors allocated < %d requested\n",
2676 ret, bnad->msix_num); 2678 ret, bnad->msix_num);
2677 2679
@@ -2684,18 +2686,11 @@ bnad_enable_msix(struct bnad *bnad)
2684 bnad->msix_num = BNAD_NUM_TXQ + BNAD_NUM_RXP + 2686 bnad->msix_num = BNAD_NUM_TXQ + BNAD_NUM_RXP +
2685 BNAD_MAILBOX_MSIX_VECTORS; 2687 BNAD_MAILBOX_MSIX_VECTORS;
2686 2688
2687 if (bnad->msix_num > ret) 2689 if (bnad->msix_num > ret) {
2688 goto intx_mode; 2690 pci_disable_msix(bnad->pcidev);
2689
2690 /* Try once more with adjusted numbers */
2691 /* If this fails, fall back to INTx */
2692 ret = pci_enable_msix(bnad->pcidev, bnad->msix_table,
2693 bnad->msix_num);
2694 if (ret)
2695 goto intx_mode; 2691 goto intx_mode;
2696 2692 }
2697 } else if (ret < 0) 2693 }
2698 goto intx_mode;
2699 2694
2700 pci_intx(bnad->pcidev, 0); 2695 pci_intx(bnad->pcidev, 0);
2701 2696