Skip to content

Commit 9dda511

Browse files
emuslndavem330
authored andcommitted
ionic: fix txrx work accounting
Take the tx accounting out of the work_done calculation to prevent a possible duplicate napi_schedule call when under high Tx stress but low Rx traffic. Fixes: b14e4e9 ("ionic: tx separate servicing") Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e9d572d commit 9dda511

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/net/ethernet/pensando/ionic/ionic_txrx.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,7 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
496496
struct ionic_cq *txcq;
497497
u32 rx_work_done = 0;
498498
u32 tx_work_done = 0;
499-
u32 work_done = 0;
500499
u32 flags = 0;
501-
bool unmask;
502500

503501
lif = rxcq->bound_q->lif;
504502
idev = &lif->ionic->idev;
@@ -512,17 +510,12 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
512510
if (rx_work_done)
513511
ionic_rx_fill_cb(rxcq->bound_q);
514512

515-
unmask = (rx_work_done < budget) && (tx_work_done < lif->tx_budget);
516-
517-
if (unmask && napi_complete_done(napi, rx_work_done)) {
513+
if (rx_work_done < budget && napi_complete_done(napi, rx_work_done)) {
518514
flags |= IONIC_INTR_CRED_UNMASK;
519515
DEBUG_STATS_INTR_REARM(rxcq->bound_intr);
520-
work_done = rx_work_done;
521-
} else {
522-
work_done = budget;
523516
}
524517

525-
if (work_done || flags) {
518+
if (rx_work_done || flags) {
526519
flags |= IONIC_INTR_CRED_RESET_COALESCE;
527520
ionic_intr_credits(idev->intr_ctrl, rxcq->bound_intr->index,
528521
tx_work_done + rx_work_done, flags);
@@ -531,7 +524,7 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
531524
DEBUG_STATS_NAPI_POLL(qcq, rx_work_done);
532525
DEBUG_STATS_NAPI_POLL(qcq, tx_work_done);
533526

534-
return work_done;
527+
return rx_work_done;
535528
}
536529

537530
static dma_addr_t ionic_tx_map_single(struct ionic_queue *q,

0 commit comments

Comments
 (0)