diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2010-09-28 21:05:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-29 22:45:37 -0400 |
commit | 8681dc3abd54e845a2effab441921b4c4457c241 (patch) | |
tree | 52fb86aa4ce9288ba4ef3578fe48d230cc45e857 /drivers/net/bnx2x | |
parent | 1b9f409293529da4630bfc5d6d8e7d7451a6ccb5 (diff) |
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: 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')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 05c05a496b15..8d42067a6989 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -1185,8 +1185,10 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) | |||
1185 | int rc = 0; | 1185 | int rc = 0; |
1186 | 1186 | ||
1187 | switch (bp->int_mode) { | 1187 | switch (bp->int_mode) { |
1188 | case INT_MODE_INTx: | ||
1189 | case INT_MODE_MSI: | 1188 | case INT_MODE_MSI: |
1189 | bnx2x_enable_msi(bp); | ||
1190 | /* falling through... */ | ||
1191 | case INT_MODE_INTx: | ||
1190 | bp->num_queues = 1; | 1192 | bp->num_queues = 1; |
1191 | DP(NETIF_MSG_IFUP, "set number of queues to 1\n"); | 1193 | DP(NETIF_MSG_IFUP, "set number of queues to 1\n"); |
1192 | break; | 1194 | break; |
@@ -1202,9 +1204,16 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) | |||
1202 | * and fallback to MSI or legacy INTx with one fp | 1204 | * and fallback to MSI or legacy INTx with one fp |
1203 | */ | 1205 | */ |
1204 | rc = bnx2x_enable_msix(bp); | 1206 | rc = bnx2x_enable_msix(bp); |
1205 | if (rc) | 1207 | if (rc) { |
1206 | /* failed to enable MSI-X */ | 1208 | /* failed to enable MSI-X */ |
1207 | bp->num_queues = 1; | 1209 | bp->num_queues = 1; |
1210 | |||
1211 | /* Fall to INTx if failed to enable MSI-X due to lack of | ||
1212 | * memory (in bnx2x_set_num_queues()) */ | ||
1213 | if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx)) | ||
1214 | bnx2x_enable_msi(bp); | ||
1215 | } | ||
1216 | |||
1208 | break; | 1217 | break; |
1209 | } | 1218 | } |
1210 | netif_set_real_num_tx_queues(bp->dev, bp->num_queues); | 1219 | 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 | goto load_error1; | 1274 | goto load_error1; |
1266 | } | 1275 | } |
1267 | } else { | 1276 | } else { |
1268 | /* Fall to INTx if failed to enable MSI-X due to lack of | ||
1269 | memory (in bnx2x_set_num_queues()) */ | ||
1270 | if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx)) | ||
1271 | bnx2x_enable_msi(bp); | ||
1272 | bnx2x_ack_int(bp); | 1277 | bnx2x_ack_int(bp); |
1273 | rc = bnx2x_req_irq(bp); | 1278 | rc = bnx2x_req_irq(bp); |
1274 | if (rc) { | 1279 | if (rc) { |