git: b06e4268aad4 - stable/14 - e1000: Fix the multiqueue debug register dump
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Aug 2026 01:07:03 UTC
The branch stable/14 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=b06e4268aad4720b479744f28b6f66d634fa27dd
commit b06e4268aad4720b479744f28b6f66d634fa27dd
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-12 00:33:18 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-26 01:02:02 +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 c9abee7eb65e..832d969e98fc 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -5928,9 +5928,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
@@ -5941,14 +5943,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)),