aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-12 00:33:18 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-12 02:59:21 +0000
commit7dd826171b69a01c234ba6e9117917398ba2705e (patch)
tree846843b8a5eac92b18ebd257c4dd2a1e87ad4900
parent28f96cc3748fc46408cc6ab6172f09bc2182cad7 (diff)
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. MFC after: 2 weeks
-rw-r--r--sys/dev/e1000/if_em.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 66a298ecf21c..691531601b8a 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -6749,9 +6749,6 @@ em_print_debug_info(struct e1000_softc *sc)
device_printf(dev, "queue state is unavailable\n");
return;
}
- txr = &sc->tx_queues->txr;
- rxr = &sc->rx_queues->rxr;
-
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
printf("Interface is RUNNING ");
else
@@ -6762,14 +6759,16 @@ 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++) {
+ txr = &sc->tx_queues[i].txr;
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(txr->me)),
E1000_READ_REG(&sc->hw, E1000_TDT(txr->me)));
}
- for (int j=0; j < sc->rx_num_queues; j++, rxr++) {
+ for (int j = 0; j < sc->rx_num_queues; j++) {
+ rxr = &sc->rx_queues[j].rxr;
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(rxr->me)),