diff options
Diffstat (limited to 'drivers/net/cxgb4vf/cxgb4vf_main.c')
-rw-r--r-- | drivers/net/cxgb4vf/cxgb4vf_main.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index e988031f7e86..d065516c0ffd 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
@@ -423,12 +423,13 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
423 | 423 | ||
424 | case CPL_SGE_EGR_UPDATE: { | 424 | case CPL_SGE_EGR_UPDATE: { |
425 | /* | 425 | /* |
426 | * We've received an Egress Queue status update message. | 426 | * We've received an Egress Queue Status Update message. We |
427 | * We get these, as the SGE is currently configured, when | 427 | * get these, if the SGE is configured to send these when the |
428 | * the firmware passes certain points in processing our | 428 | * firmware passes certain points in processing our TX |
429 | * TX Ethernet Queue. We use these updates to determine | 429 | * Ethernet Queue or if we make an explicit request for one. |
430 | * when we may need to restart a TX Ethernet Queue which | 430 | * We use these updates to determine when we may need to |
431 | * was stopped for lack of free slots ... | 431 | * restart a TX Ethernet Queue which was stopped for lack of |
432 | * free TX Queue Descriptors ... | ||
432 | */ | 433 | */ |
433 | const struct cpl_sge_egr_update *p = (void *)cpl; | 434 | const struct cpl_sge_egr_update *p = (void *)cpl; |
434 | unsigned int qid = EGR_QID(be32_to_cpu(p->opcode_qid)); | 435 | unsigned int qid = EGR_QID(be32_to_cpu(p->opcode_qid)); |
@@ -436,7 +437,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
436 | struct sge_txq *tq; | 437 | struct sge_txq *tq; |
437 | struct sge_eth_txq *txq; | 438 | struct sge_eth_txq *txq; |
438 | unsigned int eq_idx; | 439 | unsigned int eq_idx; |
439 | int hw_cidx, reclaimable, in_use; | ||
440 | 440 | ||
441 | /* | 441 | /* |
442 | * Perform sanity checking on the Queue ID to make sure it | 442 | * Perform sanity checking on the Queue ID to make sure it |
@@ -466,24 +466,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
466 | } | 466 | } |
467 | 467 | ||
468 | /* | 468 | /* |
469 | * Skip TX Queues which aren't stopped. | ||
470 | */ | ||
471 | if (likely(!netif_tx_queue_stopped(txq->txq))) | ||
472 | break; | ||
473 | |||
474 | /* | ||
475 | * Skip stopped TX Queues which have more than half of their | ||
476 | * DMA rings occupied with unacknowledged writes. | ||
477 | */ | ||
478 | hw_cidx = be16_to_cpu(txq->q.stat->cidx); | ||
479 | reclaimable = hw_cidx - txq->q.cidx; | ||
480 | if (reclaimable < 0) | ||
481 | reclaimable += txq->q.size; | ||
482 | in_use = txq->q.in_use - reclaimable; | ||
483 | if (in_use >= txq->q.size/2) | ||
484 | break; | ||
485 | |||
486 | /* | ||
487 | * Restart a stopped TX Queue which has less than half of its | 469 | * Restart a stopped TX Queue which has less than half of its |
488 | * TX ring in use ... | 470 | * TX ring in use ... |
489 | */ | 471 | */ |