git: 59a9c20d7736 - stable/13 - cxgbe: Flush transmitted packets more regularly in netmap mode
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 08 Aug 2024 16:00:55 UTC
The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=59a9c20d7736d41be22791ec9a797cc535734ace commit 59a9c20d7736d41be22791ec9a797cc535734ace Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-05-21 19:18:32 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-08-08 15:58:12 +0000 cxgbe: Flush transmitted packets more regularly in netmap mode Previously, when transmitting short runs of packets via cxgbe_nm_tx(), we would wait until a large number of packets were buffered before scheduling a task to clean transmit buffers. Obtained from: np (cherry picked from commit 6af3d59962449c66688361598163dd174cc5fb2a) --- sys/dev/cxgbe/t4_netmap.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 581094735c36..b60c1a88168c 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -1025,29 +1025,28 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_txq, nm_txq->pidx = 0; } - if (npkt == 0 && npkt_remaining == 0) { + if (npkt + npkt_remaining == 0) { /* All done. */ - if (lazy_tx_credit_flush == 0) { + if (lazy_tx_credit_flush == 0 || + NMIDXDIFF(nm_txq, equiqidx) >= nm_txq->sidx / 2) { wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ | F_FW_WR_EQUIQ); nm_txq->equeqidx = nm_txq->pidx; nm_txq->equiqidx = nm_txq->pidx; + } else if (NMIDXDIFF(nm_txq, equeqidx) >= 64) { + wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); + nm_txq->equeqidx = nm_txq->pidx; } ring_nm_txq_db(sc, nm_txq); return; } - - if (NMIDXDIFF(nm_txq, equiqidx) >= nm_txq->sidx / 2) { - wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ | - F_FW_WR_EQUIQ); - nm_txq->equeqidx = nm_txq->pidx; - nm_txq->equiqidx = nm_txq->pidx; - } else if (NMIDXDIFF(nm_txq, equeqidx) >= 64) { - wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - nm_txq->equeqidx = nm_txq->pidx; - } - if (NMIDXDIFF(nm_txq, dbidx) >= 2 * SGE_MAX_WR_NDESC) + if (NMIDXDIFF(nm_txq, dbidx) >= 2 * SGE_MAX_WR_NDESC) { + if (NMIDXDIFF(nm_txq, equeqidx) >= 64) { + wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); + nm_txq->equeqidx = nm_txq->pidx; + } ring_nm_txq_db(sc, nm_txq); + } } /* Will get called again. */