mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nazle Asmade, Muhammad Nazim Amirul" <muhammad.nazim.amirul.nazle.asmade@altera.com>
To: Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"mcoquelin.stm32@gmail.com" <mcoquelin.stm32@gmail.com>,
	"alexandre.torgue@foss.st.com" <alexandre.torgue@foss.st.com>,
	"rmk+kernel@armlinux.org.uk" <rmk+kernel@armlinux.org.uk>,
	"maxime.chevallier@bootlin.com" <maxime.chevallier@bootlin.com>,
	"Jose.Abreu@synopsys.com" <Jose.Abreu@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: stmmac: xgmac2: disable RBUE in default RX interrupt mask
Date: Tue, 9 Jun 2026 12:14:36 +0000	[thread overview]
Message-ID: <a343fd07-385d-442f-9895-5b5a31439266@altera.com> (raw)
In-Reply-To: <8bac773f-5016-4afb-8506-9d48eb2e70d0@redhat.com>

On 9/6/2026 5:12 pm, Paolo Abeni wrote:
> On 6/8/26 5:27 PM, Simon Horman wrote:
>> 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.
>
> Nazim, you need at least to clarify in the commit message why this patch
> is safe.
>
> /P
>
Hi Simon, Paolo

Thanks for the review! Will send out v3 with commit message updated.

BR,
Nazim

      reply	other threads:[~2026-06-09 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  9:45 muhammad.nazim.amirul.nazle.asmade
2026-06-08 15:27 ` Simon Horman
2026-06-09  9:12   ` Paolo Abeni
2026-06-09 12:14     ` Nazle Asmade, Muhammad Nazim Amirul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a343fd07-385d-442f-9895-5b5a31439266@altera.com \
    --to=muhammad.nazim.amirul.nazle.asmade@altera.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®