Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Aug 2026 17:15:24 +0000
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5da9bc88936a - main - iflib: remove the unused TX queue state machine
Message-ID:  <6a721e2c.213fb.47542da@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by netchild:

URL: https://cgit.FreeBSD.org/src/commit/?id=5da9bc88936a49cf1d3bea00dee3eb55158d5309

commit 5da9bc88936a49cf1d3bea00dee3eb55158d5309
Author:     Alexander Leidinger <netchild@FreeBSD.org>
AuthorDate: 2026-08-04 16:44:53 +0000
Commit:     Alexander Leidinger <netchild@FreeBSD.org>
CommitDate: 2026-08-04 17:14:31 +0000

    iflib: remove the unused TX queue state machine
    
    The previous commit stopped using ift_qstatus and the IFLIB_QUEUE_*
    states for the TX watchdog decision, leaving only dead stores.
    Remove the field, the states, and all assignments.  The byte the
    field frees stays behind as explicit padding.  No functional change.
    
    Reviewed by:    gallatin, markj
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D58282
    Assisted-by:    Claude Code (Fable 5, Opus 5)
---
 sys/net/iflib.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 1b43f5833d57..f865f2414281 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -312,9 +312,6 @@ typedef struct iflib_sw_tx_desc_array {
 /* The minimum descriptors per second before we start coalescing */
 #define IFLIB_MIN_DESC_SEC		16384
 #define IFLIB_DEFAULT_TX_UPDATE_FREQ	16
-#define IFLIB_QUEUE_IDLE		0
-#define IFLIB_QUEUE_HUNG		1
-#define IFLIB_QUEUE_WORKING		2
 /* maximum number of txqs that can share an rx interrupt */
 #define IFLIB_MAX_TX_SHARED_INTR	4
 
@@ -414,10 +411,9 @@ struct iflib_txq {
 	 */
 	qidx_t		ift_outstanding_prev;
 	uint16_t	ift_wdog_armed;
-	uint8_t		ift_qstatus;
 	uint8_t		ift_closed;
 	uint8_t		ift_update_freq;
-	uint8_t		ift_spare0;	/* pad to the next pointer boundary */
+	uint8_t		ift_spare0[2];	/* pad to the next pointer boundary */
 	struct iflib_filter_info ift_filter_info;
 	bus_dma_tag_t	ift_buf_tag;
 	bus_dma_tag_t	ift_tso_buf_tag;
@@ -1931,8 +1927,6 @@ iflib_txq_setup(iflib_txq_t txq)
 	iflib_dma_info_t di;
 	int i;
 
-	/* Set number of descriptors available */
-	txq->ift_qstatus = IFLIB_QUEUE_IDLE;
 	/* XXX make configurable */
 	txq->ift_update_freq = IFLIB_DEFAULT_TX_UPDATE_FREQ;
 
@@ -3978,7 +3972,6 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx)
 	}
 
 	if (__predict_false(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) {
-		txq->ift_qstatus = IFLIB_QUEUE_IDLE;
 		CALLOUT_LOCK(txq);
 		callout_stop(&txq->ift_timer);
 		CALLOUT_UNLOCK(txq);
@@ -3986,11 +3979,6 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx)
 		return (0);
 	}
 
-	/*
-	 * If we've reclaimed any packets this queue cannot be hung.
-	 */
-	if (reclaimed)
-		txq->ift_qstatus = IFLIB_QUEUE_IDLE;
 	consumed = mcast_sent = bytes_sent = pkt_sent = 0;
 	count = MIN(avail, TX_BATCH_SIZE);
 #ifdef INVARIANTS
@@ -4066,7 +4054,6 @@ iflib_txq_drain_free(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx)
 
 	txq = r->cookie;
 
-	txq->ift_qstatus = IFLIB_QUEUE_IDLE;
 	CALLOUT_LOCK(txq);
 	callout_stop(&txq->ift_timer);
 	CALLOUT_UNLOCK(txq);
@@ -6562,7 +6549,6 @@ void
 iflib_link_state_change(if_ctx_t ctx, int link_state, uint64_t baudrate)
 {
 	if_t ifp = ctx->ifc_ifp;
-	iflib_txq_t txq = ctx->ifc_txqs;
 
 	if_setbaudrate(ifp, baudrate);
 	if (baudrate >= IF_Gbps(10)) {
@@ -6570,11 +6556,6 @@ iflib_link_state_change(if_ctx_t ctx, int link_state, uint64_t baudrate)
 		ctx->ifc_flags |= IFC_PREFETCH;
 		STATE_UNLOCK(ctx);
 	}
-	/* If link down, disable watchdog */
-	if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) {
-		for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++)
-			txq->ift_qstatus = IFLIB_QUEUE_IDLE;
-	}
 	ctx->ifc_link_state = link_state;
 	if_link_state_change(ifp, link_state);
 }


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a721e2c.213fb.47542da>