Commit 8681dc3a authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller

bnx2x: Moved enabling of MSI to the bnx2x_set_num_queues()

Moved enabling of MSI to the bnx2x_set_num_queues() - the same functions that
 handles the initialization of the MSI-X.

From: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarVladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b9f4092
...@@ -1185,8 +1185,10 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) ...@@ -1185,8 +1185,10 @@ static int bnx2x_set_num_queues(struct bnx2x *bp)
int rc = 0; int rc = 0;
switch (bp->int_mode) { switch (bp->int_mode) {
case INT_MODE_INTx:
case INT_MODE_MSI: case INT_MODE_MSI:
bnx2x_enable_msi(bp);
/* falling through... */
case INT_MODE_INTx:
bp->num_queues = 1; bp->num_queues = 1;
DP(NETIF_MSG_IFUP, "set number of queues to 1\n"); DP(NETIF_MSG_IFUP, "set number of queues to 1\n");
break; break;
...@@ -1202,9 +1204,16 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) ...@@ -1202,9 +1204,16 @@ static int bnx2x_set_num_queues(struct bnx2x *bp)
* and fallback to MSI or legacy INTx with one fp * and fallback to MSI or legacy INTx with one fp
*/ */
rc = bnx2x_enable_msix(bp); rc = bnx2x_enable_msix(bp);
if (rc) if (rc) {
/* failed to enable MSI-X */ /* failed to enable MSI-X */
bp->num_queues = 1; bp->num_queues = 1;
/* Fall to INTx if failed to enable MSI-X due to lack of
* memory (in bnx2x_set_num_queues()) */
if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx))
bnx2x_enable_msi(bp);
}
break; break;
} }
netif_set_real_num_tx_queues(bp->dev, bp->num_queues); netif_set_real_num_tx_queues(bp->dev, bp->num_queues);
...@@ -1265,10 +1274,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) ...@@ -1265,10 +1274,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
goto load_error1; goto load_error1;
} }
} else { } else {
/* Fall to INTx if failed to enable MSI-X due to lack of
memory (in bnx2x_set_num_queues()) */
if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx))
bnx2x_enable_msi(bp);
bnx2x_ack_int(bp); bnx2x_ack_int(bp);
rc = bnx2x_req_irq(bp); rc = bnx2x_req_irq(bp);
if (rc) { if (rc) {
......
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