git: 5122a6181aa4 - stable/15 - e1000: Fix the multiqueue debug register dump

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Wed, 26 Aug 2026 00:57:02 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=5122a6181aa4268761cda41980af62c0245f1816

commit 5122a6181aa4268761cda41980af62c0245f1816
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-12 00:33:18 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-26 00:56:51 +0000

    e1000: Fix the multiqueue debug register dump
    
    The debug routine advanced ring pointers as if rings were contiguous.
    They are embedded in queue structures, so rings beyond queue zero had
    the wrong stride.  The bogus queue index could cause an invalid MMIO
    read and panic the machine.
    
    Index the queue arrays first and then select the embedded ring.
    
    (cherry picked from commit 7dd826171b69a01c234ba6e9117917398ba2705e)
---
 sys/dev/e1000/if_em.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 6032c7945947..bf3369a20bad 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -6043,9 +6043,11 @@ em_print_debug_info(struct e1000_softc *sc)
 {
 	device_t dev = iflib_get_dev(sc->ctx);
 	if_t ifp = iflib_get_ifp(sc->ctx);
-	struct tx_ring *txr = &sc->tx_queues->txr;
-	struct rx_ring *rxr = &sc->rx_queues->rxr;
 
+	if (sc->tx_queues == NULL || sc->rx_queues == NULL) {
+		device_printf(dev, "queue state is unavailable\n");
+		return;
+	}
 	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
 		printf("Interface is RUNNING ");
 	else
@@ -6056,14 +6058,14 @@ em_print_debug_info(struct e1000_softc *sc)
 	else
 		printf("and ACTIVE\n");
 
-	for (int i = 0; i < sc->tx_num_queues; i++, txr++) {
+	for (int i = 0; i < sc->tx_num_queues; i++) {
 		device_printf(dev, "TX Queue %d ------\n", i);
 		device_printf(dev, "hw tdh = %d, hw tdt = %d\n",
 		    E1000_READ_REG(&sc->hw, E1000_TDH(i)),
 		    E1000_READ_REG(&sc->hw, E1000_TDT(i)));
 
 	}
-	for (int j=0; j < sc->rx_num_queues; j++, rxr++) {
+	for (int j = 0; j < sc->rx_num_queues; j++) {
 		device_printf(dev, "RX Queue %d ------\n", j);
 		device_printf(dev, "hw rdh = %d, hw rdt = %d\n",
 		    E1000_READ_REG(&sc->hw, E1000_RDH(j)),