git: 7f8feee5ab92 - main - iflib: Clear simple-TX quiescence before publishing admission

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Tue, 15 Sep 2026 19:49:31 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f8feee5ab922e6645f4061e9ca29109411aadef

commit 7f8feee5ab922e6645f4061e9ca29109411aadef
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-15 02:20:08 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-09-15 19:48:20 +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
---
 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 f3f963e5ab0e..334160dbc850 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2848,19 +2848,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);