git: 9a1756f831a7 - main - enetc: Correct transmit queue timeout detection

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 17 Sep 2026 06:16:31 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=9a1756f831a77ee8292821c9efd38c2125bff88c

commit 9a1756f831a77ee8292821c9efd38c2125bff88c
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-07 13:44:59 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-09-17 06:16:13 +0000

    enetc: Correct transmit queue timeout detection
    
    Test the producer and consumer indices after waiting for transmit
    completion. The post-decrement loop leaves timeout at -1 on exhaustion,
    so testing timeout == 0 missed the actual timeout and could report one
    when the final poll completed successfully.
    
    Leave the hardware shutdown sequence unchanged. This only corrects the
    diagnostic; runtime FLR recovery and command-buffer lifetime handling
    remain separate work.
    
    MFC after:      2 weeks
    Sponsored by:   BBOX.io
---
 sys/dev/enetc/if_enetc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c
index 55fec66266fe..81e59dc10559 100644
--- a/sys/dev/enetc/if_enetc.c
+++ b/sys/dev/enetc/if_enetc.c
@@ -972,7 +972,7 @@ enetc_disable_txq(struct enetc_softc *sc, int qid)
 		cidx = ENETC_TXQ_RD4(sc, qid, ENETC_TBCIR);
 	}
 
-	if (timeout == 0)
+	if (pidx != cidx)
 		device_printf(sc->dev,
 		    "Timeout while waiting for txq%d to stop transmitting packets\n",
 		    qid);