aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorVladislav Zolotarov <vladz@broadcom.com>2010-04-18 21:14:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-19 16:17:09 -0400
commit1ac218c83fbfc6bcdbef36b38f79d0ee08420285 (patch)
treeccab0f2bcf64228b3028c182bfcfebf78fd518a9 /drivers/net/bnx2x_main.c
parentdea7aab1923a9ee81c5cafaa4bd47266abf30186 (diff)
bnx2x: Fixed MSI-X enabling flow
Try to enable less MSI-X vectors if initial request has failed. Author: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ad440c8616a5..23528deaf98d 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -7418,7 +7418,31 @@ static int bnx2x_enable_msix(struct bnx2x *bp)
7418 7418
7419 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], 7419 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0],
7420 BNX2X_NUM_QUEUES(bp) + offset); 7420 BNX2X_NUM_QUEUES(bp) + offset);
7421 if (rc) { 7421
7422 /*
7423 * reconfigure number of tx/rx queues according to available
7424 * MSI-X vectors
7425 */
7426 if (rc >= BNX2X_MIN_MSIX_VEC_CNT) {
7427 /* vectors available for FP */
7428 int fp_vec = rc - BNX2X_MSIX_VEC_FP_START;
7429
7430 DP(NETIF_MSG_IFUP,
7431 "Trying to use less MSI-X vectors: %d\n", rc);
7432
7433 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], rc);
7434
7435 if (rc) {
7436 DP(NETIF_MSG_IFUP,
7437 "MSI-X is not attainable rc %d\n", rc);
7438 return rc;
7439 }
7440
7441 bp->num_queues = min(bp->num_queues, fp_vec);
7442
7443 DP(NETIF_MSG_IFUP, "New queue configuration set: %d\n",
7444 bp->num_queues);
7445 } else if (rc) {
7422 DP(NETIF_MSG_IFUP, "MSI-X is not attainable rc %d\n", rc); 7446 DP(NETIF_MSG_IFUP, "MSI-X is not attainable rc %d\n", rc);
7423 return rc; 7447 return rc;
7424 } 7448 }
@@ -7841,8 +7865,6 @@ static int bnx2x_set_num_queues(struct bnx2x *bp)
7841 bp->num_queues = 1; 7865 bp->num_queues = 1;
7842 DP(NETIF_MSG_IFUP, "set number of queues to 1\n"); 7866 DP(NETIF_MSG_IFUP, "set number of queues to 1\n");
7843 break; 7867 break;
7844
7845 case INT_MODE_MSIX:
7846 default: 7868 default:
7847 /* Set number of queues according to bp->multi_mode value */ 7869 /* Set number of queues according to bp->multi_mode value */
7848 bnx2x_set_num_queues_msix(bp); 7870 bnx2x_set_num_queues_msix(bp);