Re: [PATCH] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask

From: Paolo Abeni

Date: Thu Jun 04 2026 - 05:05:17 EST


From: AI Reviewer <ai@xxxxxxxxxxx>

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 Receive Buffer Unavailable (RBUE) interrupt from
the default RX and DMA interrupt masks. The goal is to prevent MAC
interrupt storms when the DMA runs out of descriptors under heavy
RX pressure.

> 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)

[Severity: Medium]
Does removing XGMAC_RBUE from XGMAC_DMA_INT_DEFAULT_EN prevent the
XGMAC_RBU status bit from being cleared in dwxgmac2_dma_interrupt()?

If this default mask is used to clear pending interrupts, writing a 0 to
the XGMAC_RBU position would fail to clear it. Would this cause the bit
to latch indefinitely, triggering redundant NAPI schedules on unrelated
abnormal interrupts?

> -#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RBUE | XGMAC_RIE)
> +#define XGMAC_DMA_INT_DEFAULT_RX (XGMAC_RIE)

[Severity: High]
Does disabling RBUE entirely break RX out-of-memory recovery?

If the RX ring becomes completely empty during memory pressure because
stmmac_rx_refill() fails to allocate SKBs, the MAC DMA will suspend. Once
a new packet arrives, the MAC drops it and sets the XGMAC_RBU status.

Since RIE is only asserted when a packet is successfully received and
transferred to a descriptor, and RBUE is now disabled, it appears no
interrupt will fire at all in this state. Could this leave NAPI
unscheduled and result in a permanent RX path lockup even after memory
becomes available again?
--
This is an AI-generated review.