diff options
| author | Andrew Gallatin <gallatin@FreeBSD.org> | 2026-04-17 15:52:36 +0000 |
|---|---|---|
| committer | Andrew Gallatin <gallatin@FreeBSD.org> | 2026-04-17 17:34:27 +0000 |
| commit | 52e7958702be469a61a5e3173c20a08fc0721b4d (patch) | |
| tree | d46eb117d6df745586f69de330420e77a36c7ad6 | |
| parent | f46d75c90f5feb87259635134dde4da328282842 (diff) | |
iflib: ignore reclaim coalescing when low on tx descriptors
If we are low on TX descriptors, bypass iflib_txq_can_reclaim()
and force a reclaim. This is intended to reduce the number of
output drops under heavy load when using simple transmit.
Differential Revision: https://reviews.freebsd.org/D56339
Sponsored by: Netflix
| -rw-r--r-- | sys/net/iflib.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c index b58544255efd..085b69b62553 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -703,6 +703,7 @@ static struct mbuf *iflib_fixup_rx(struct mbuf *m); #endif static __inline int iflib_completed_tx_reclaim(iflib_txq_t txq, struct mbuf **m_defer); +static __inline void iflib_completed_tx_reclaim_force(iflib_txq_t txq); static SLIST_HEAD(cpu_offset_list, cpu_offset) cpu_offsets = SLIST_HEAD_INITIALIZER(cpu_offsets); @@ -3600,7 +3601,7 @@ defrag: * cxgb */ if (__predict_false(nsegs > TXQ_AVAIL(txq))) { - (void)iflib_completed_tx_reclaim(txq, NULL); + iflib_completed_tx_reclaim_force(txq); if (__predict_false(nsegs > TXQ_AVAIL(txq))) { txq->ift_no_desc_avail++; bus_dmamap_unload(buf_tag, map); @@ -3789,6 +3790,20 @@ iflib_completed_tx_reclaim(iflib_txq_t txq, struct mbuf **m_defer) return (reclaim); } +/* + * Reclaim any transmit descriptors possible, ignoring coalescing + */ +static __inline void +iflib_completed_tx_reclaim_force(iflib_txq_t txq) +{ + int reclaim; + + iflib_tx_credits_update(txq->ift_ctx, txq); + reclaim = DESC_RECLAIMABLE(txq); + if (reclaim != 0) + _iflib_completed_tx_reclaim(txq, NULL, reclaim); +} + static struct mbuf ** _ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining) { |
