aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2026-08-04 16:44:54 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2026-08-04 17:14:58 +0000
commit65349af4422ffffe40850168c5feb808d43ad06d (patch)
treea8a3ee35146bc5837574ebfa326f3dae46a5810b
parent5da9bc88936a49cf1d3bea00dee3eb55158d5309 (diff)
iflib: clear the deferred TX descriptor state when a queue is stopped
Stopping an interface frees the queued mbufs and zeroes a transmit queue's descriptor accounting, but the three counters that track descriptors deferred to a later doorbell write or report-status request are not cleared there: they only reach zero when the code that acts on them runs. After a reset they therefore describe descriptors that no longer exist, until enough new traffic flushes them. The consequences are small - one doorbell written from a stale count, and a report-status request on the first packet after the reset - but the state is simply wrong, and the transmit-hang check in iflib_timer() reads one of them. MFC after: 1 week Assisted-by: Claude Code (Opus 5)
-rw-r--r--sys/net/iflib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index f865f2414281..63455fb46d70 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2701,6 +2701,8 @@ iflib_stop(if_ctx_t ctx)
txq->ift_outstanding_prev = 0;
txq->ift_wdog_armed = 0;
txq->ift_in_use = txq->ift_gen = txq->ift_no_desc_avail = 0;
+ txq->ift_npending = txq->ift_db_pending = 0;
+ txq->ift_rs_pending = 0;
if (sctx->isc_flags & IFLIB_PRESERVE_TX_INDICES)
txq->ift_cidx = txq->ift_pidx;
else