netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Raju Rangoju <Raju.Rangoju@amd.com>
Cc: <netdev@vger.kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <davem@davemloft.net>,
	<andrew+netdev@lunn.ch>, <Shyam-sundar.S-k@amd.com>
Subject: Re: [PATCH net-next] amd-xgbe: schedule NAPI on Rx Buffer Unavailable to prevent RX stalls
Date: Wed, 26 Nov 2025 19:13:42 -0800	[thread overview]
Message-ID: <20251126191342.6728250d@kernel.org> (raw)
In-Reply-To: <20251124101111.1268731-1-Raju.Rangoju@amd.com>

On Mon, 24 Nov 2025 15:41:11 +0530 Raju Rangoju wrote:
> When Rx Buffer Unavailable (RBU) interrupt is asserted, the device can
> stall under load and suffer prolonged receive starvation if polling is
> not initiated. Treat RBU as a wakeup source and schedule the appropriate
> NAPI instance (per-channel or global) to promptly recover from buffer
> shortages and refill descriptors.

You need to say more.. Under heavy load network devices will routinely
run out of Rx buffers, it's expected if Rx processing is slower than
the network. What hw condition and scenario exactly are you describing
here?

>  		dma_ch_isr = XGMAC_DMA_IOREAD(channel, DMA_CH_SR);
> +		/* Precompute flags once */
> +		ti  = !!XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, TI);
> +		ri  = !!XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, RI);
> +		rbu = !!XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, RBU);
> +		fbe = !!XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, FBE);

Please split this into two patches, one pure refactoring with no
functional changes and second one changing RBU handling.

> +		if (rbu) {
> +			schedule_napi = true;
> +			pdata->ext_stats.rx_buffer_unavailable++;
> +			netif_dbg(pdata, intr, pdata->netdev,
> +				  "RBU on DMA_CH %u, scheduling %s NAPI\n",
> +				  i, per_ch_irq ? "per-channel" : "global");

I guess it's just _dbg() but as a general rule when the system is under
overload printing stuff (potentially over UART) is the last thing you
should be doing. How is this print useful to you?
-- 
pw-bot: cr

  reply	other threads:[~2025-11-27  3:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 10:11 [PATCH net-next] amd-xgbe: schedule NAPI on Rx Buffer Unavailable to prevent RX stalls Raju Rangoju
2025-11-27  3:13 ` Jakub Kicinski [this message]
2025-11-28  5:50   ` Rangoju, Raju
2025-11-28 18:38     ` Jakub Kicinski
2025-11-29  1:34       ` Rangoju, Raju

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=20251126191342.6728250d@kernel.org \
    --to=kuba@kernel.org \
    --cc=Raju.Rangoju@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).