git: 710c7f7db62d - stable/15 - iflib: Clear simple-TX quiescence before publishing admission

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 06:03:19 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=710c7f7db62d51b36b9b1faddd5f33ea1de3fdda

commit 710c7f7db62d51b36b9b1faddd5f33ea1de3fdda
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-15 02:20:08 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 05:38:10 +0000

    iflib: Clear simple-TX quiescence before publishing admission
    
    Initialization publishes RUNNING and enables interrupts before clearing
    the simple-TX producer barrier. A transmitter admitted in that window
    still sees IFLIB_TXQ_QUIESCING and drops its packet with ENETDOWN. A TX
    completion task can likewise return without draining deferred packets.
    
    Clear the barrier on every TX queue after driver initialization and RX
    buffer setup succeed, before publishing admission. Keep failed init
    paths closed and retain the existing stop, interrupt and timer ordering.
    This changes only initialization; no work is added to the packet path.
    
    Reviewed by:    iflib (gallatin)
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D59690
    
    (cherry picked from commit 7f8feee5ab922e6645f4061e9ca29109411aadef)
---
 sys/net/iflib.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 5e3bcd2bbb78..37c7870fb45d 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2847,19 +2847,21 @@ iflib_init_locked(if_ctx_t ctx)
 			}
 		}
 	}
+	/* Open every TX queue before publishing admission to transmitters. */
+	if (ctx->ifc_sysctl_simple_tx) {
+		for (i = 0, txq = ctx->ifc_txqs; i < scctx->isc_ntxqsets;
+		    i++, txq++)
+			atomic_clear_rel_int(&txq->ift_producers,
+			    IFLIB_TXQ_QUIESCING);
+	}
 	STATE_LOCK(ctx);
 	iflib_set_running(ctx, true);
 	STATE_UNLOCK(ctx);
 	IFDI_INTR_ENABLE(ctx);
 	txq = ctx->ifc_txqs;
-	for (i = 0; i < scctx->isc_ntxqsets; i++, txq++) {
+	for (i = 0; i < scctx->isc_ntxqsets; i++, txq++)
 		callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
 			txq->ift_timer.c_cpu);
-		if (ctx->ifc_sysctl_simple_tx) {
-			atomic_clear_rel_int(&txq->ift_producers,
-			    IFLIB_TXQ_QUIESCING);
-		}
-	}
 
 	/* Re-enable txsync/rxsync. */
 	netmap_enable_all_rings(ifp);