* [PATCH v2] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask
@ 2026-06-04 9:45 muhammad.nazim.amirul.nazle.asmade
2026-06-08 15:27 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: muhammad.nazim.amirul.nazle.asmade @ 2026-06-04 9:45 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
alexandre.torgue, rmk+kernel, maxime.chevallier, Jose.Abreu,
linux-kernel
From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Enabling the RX Buffer Unavailable (RBUE) interrupt is counterproductive
and can trigger a MAC interrupt storm under heavy RX pressure. When the
DMA runs out of RX descriptors it fires RBUE continuously until software
refills the ring.
However, RBUE is redundant: the normal RX completion interrupt (RIE)
already triggers NAPI, which processes completed descriptors and refills
the ring, causing the DMA to resume. The RBUE handler itself only sets
handle_rx - the same outcome as RIE.
On Agilex5 under heavy RX pressure, the MAC interrupt (which includes
RBUE) was observed firing 1,821,811,555 times against only 2,618,627
actual RX completions - a ~695x ratio - confirming the severity of the
storm.
Note: as a consequence of disabling RBUE, the rx_buf_unav_irq ethtool
counter will always read 0 on XGMAC2 devices. This behaviour is already
inconsistent across DWMAC core versions.
Remove RBUE from XGMAC_DMA_INT_DEFAULT_EN and XGMAC_DMA_INT_DEFAULT_RX
to prevent the interrupt storm while keeping normal RX handling intact.
Fixes: d6ddfacd95c7 ("net: stmmac: Add DMA related callbacks for XGMAC2")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
---
Changes in v2:
- Added performance measurements to commit message (Maxime Chevallier)
- Noted that rx_buf_unav_irq will always read 0 on XGMAC2 devices
after this change (Maxime Chevallier)
---
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
index 51943705a2b0..b5fdc253a2f2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
@@ -379,9 +379,9 @@
#define XGMAC_RIE BIT(6)
#define XGMAC_TBUE BIT(2)
#define XGMAC_TIE BIT(0)
-#define XGMAC_DMA_INT_DEFAULT_EN (XGMAC_NIE | XGMAC_AIE | XGMAC_RBUE | \
+#define XGMAC_DMA_INT_DEFAULT_EN (XGMAC_NIE | XGMAC_AIE | \
XGMAC_RIE | XGMAC_TIE)
-#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RBUE | XGMAC_RIE)
+#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RIE)
#define XGMAC_DMA_INT_DEFAULT_TX (XGMAC_TIE)
#define XGMAC_DMA_CH_Rx_WATCHDOG(x) (0x0000313c + (0x80 * (x)))
#define XGMAC_RWT GENMASK(7, 0)
--
2.43.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask
2026-06-04 9:45 [PATCH v2] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask muhammad.nazim.amirul.nazle.asmade
@ 2026-06-08 15:27 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-06-08 15:27 UTC (permalink / raw)
To: muhammad.nazim.amirul.nazle.asmade
Cc: 'Simon Horman', netdev, andrew+netdev, davem, edumazet,
kuba, pabeni, mcoquelin.stm32, alexandre.torgue, rmk+kernel,
maxime.chevallier, Jose.Abreu, linux-kernel
From: 'Simon Horman' <horms@kernel.org>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev
---
net: stmmac: xgmac2: disable RBUE in default RX interrupt mask
This commit removes the RX Buffer Unavailable (RBUE) interrupt from the
default enable masks for XGMAC2 devices. This is intended to prevent MAC
interrupt storms that can occur under heavy RX pressure when the DMA
runs out of RX descriptors.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> index 51943705a2b03..b5fdc253a2f24 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> @@ -379,9 +379,9 @@
> #define XGMAC_RIE BIT(6)
> #define XGMAC_TBUE BIT(2)
> #define XGMAC_TIE BIT(0)
> -#define XGMAC_DMA_INT_DEFAULT_EN (XGMAC_NIE | XGMAC_AIE | XGMAC_RBUE | \
> +#define XGMAC_DMA_INT_DEFAULT_EN (XGMAC_NIE | XGMAC_AIE | \
> XGMAC_RIE | XGMAC_TIE)
> -#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RBUE | XGMAC_RIE)
> +#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RIE)
[Severity: High]
Does removing the RBUE interrupt break the driver's ability to recover from
RX out-of-memory conditions, leading to a permanent RX queue stall?
When stmmac_rx() processes packets, it calls stmmac_rx_refill() to replenish
the ring descriptors. If page_pool_alloc_pages() fails due to memory
pressure, the descriptors remain empty:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:stmmac_rx_refill() {
...
buf->page = page_pool_alloc_pages(rx_q->page_pool, gfp);
if (!buf->page)
break;
...
}
stmmac_rx() then returns the number of processed packets, which will be
less than the NAPI budget if the ring is empty. This causes
stmmac_napi_poll_rx() to complete NAPI and re-enable interrupts:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:stmmac_napi_poll_rx() {
...
work_done = stmmac_rx(priv, budget, chan);
if (work_done < budget && napi_complete_done(napi, work_done)) {
...
stmmac_enable_dma_irq(priv, priv->ioaddr, chan, 1, 0);
}
...
}
When the hardware subsequently tries to receive a packet, it finds no
descriptors and enters the Receive Buffer Unavailable (RBU) state. By
removing XGMAC_RBUE from the RX interrupt enable mask, the MAC will no
longer trigger an interrupt for the RBU state.
Because no packets can be successfully received without descriptors, the
normal Receive Interrupt (RIE) will also never fire. With NAPI stopped and
no interrupts firing, the driver has no polling timer to retry allocation,
which could result in a permanent stall of the RX queue.
> #define XGMAC_DMA_INT_DEFAULT_TX (XGMAC_TIE)
> #define XGMAC_DMA_CH_Rx_WATCHDOG(x) (0x0000313c + (0x80 * (x)))
> #define XGMAC_RWT GENMASK(7, 0)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-08 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 9:45 [PATCH v2] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask muhammad.nazim.amirul.nazle.asmade
2026-06-08 15:27 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox