Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: contact@c127.dev
Cc: kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org,
	davem@davemloft.net, andrew+netdev@lunn.ch,
	maxime.chevallier@bootlin.com, me@ziyao.cc,
	mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, zhangfeionline@gmail.com
Subject: Re: [PATCH net-next 1/3] net: stmmac: dwmac4: do not treat TBU as a TX event
Date: Sat, 05 Dec 2026 20:37:55 +0000	[thread overview]
Message-ID: <179650307507.3148.11981509559101127373@kernel.org> (raw)
In-Reply-To: <20261204203130.287919-2-contact@c127.dev>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit fixes a defect introduced by commit 1103d3a5531c
  ("net: stmmac: dwmac4: Also use TBU interrupt to clean TX path") and…
- [Low] Removing the stuck-TBU => handle_tx path takes away the only
  thing that, on shared-IRQ dwmac4 setups, cleaned XDP TX descriptors…

--

net: stmmac: dwmac4: do not treat TBU as a TX event

This patch stops dwmac4_dma_interrupt() from returning handle_tx when the
TBU status bit is set. TBUE is never enabled, so TBU is never cleared, and
on a shared interrupt every idle TX channel had TX NAPI scheduled. It
follows the earlier xgmac fix in commit 305deb54c6c2.

Link: https://lore.kernel.org/netdev/20261014045607.3421104-1-zhangfeionline@gmail.com/

> Commit 1103d3a5531c ("net: stmmac: dwmac4: Also use TBU interrupt to
> clean TX path") made dwmac4_dma_interrupt() report TBU as TX work.

[Severity: Low]
This isn't a bug, but should this patch have a Fixes: tag for the commit
it names?

When 1103d3a5531c was applied, DMA_CHAN_INTR_NORMAL in dwmac4_dma.h was
already:

#define DMA_CHAN_INTR_NORMAL		(DMA_CHAN_INTR_ENA_NIE | \
					 DMA_CHAN_INTR_ENA_RIE | \
					 DMA_CHAN_INTR_ENA_TIE)

So TBU has stayed set since that commit. The matching xgmac fix,
305deb54c6c2 ("net: stmmac: xgmac: do not treat TBU as a TX event"),
has Fixes: 8d07a7930434 and was merged through net.

Something like:

Fixes: 1103d3a5531c ("net: stmmac: dwmac4: Also use TBU interrupt to clean TX path")

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
> index 02aa1a3dd1e25..55ca172332346 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
> @@ -188,8 +188,6 @@ int dwmac4_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr,
>  		ret |= handle_tx;
>  	}
>  
> -	if (unlikely(intr_status & DMA_CHAN_STATUS_TBU))
> -		ret |= handle_tx;

[Severity: Low]
With this check gone, can XDP TX descriptors go uncleaned on shared-IRQ
dwmac4 setups when the TX coalescing timer is off?

__stmmac_set_coalesce() accepts tx-usecs 0 if tx-frames is nonzero. In
that case stmmac_tx_timer_arm() returns right away:

	if (!tx_coal_timer)
		return;

stmmac_xdp_xmit_xdpf() sets IC only when the frame counter crosses a
multiple of tx_coal:

	tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
	if (tx_coal && (tx_q->tx_count_frames % tx_coal) < num_frames) {

stmmac_xmit() and the TSO path set IC when !netdev_xmit_more(). This path
has no such rule, so the last frames of an XDP_TX or ndo_xdp_xmit burst
raise no TI. Their callers, stmmac_finalize_xdp_rx() and stmmac_xdp_xmit(),
only call stmmac_tx_timer_arm(), which does nothing in this configuration.

Before this patch, TBU stayed set. Any later interrupt on the shared line
went through stmmac_dma_interrupt():

	for (chan = 0; chan < channels_to_check; chan++)
		status[chan] = stmmac_napi_check(priv, chan,
						 DMA_DIR_RXTX);

DMA_DIR_RXTX does not mask TBU, so the call returned handle_tx and
scheduled tx_napi, which cleaned those descriptors.

After this patch, only TI schedules tx_napi. For non-XSK queues, RX
interrupts only schedule rx_napi.

Would up to tx_coal_frames - 1 descriptors per queue, with their
xdp_frames and page_pool pages, then stay held until the next IC
completion on that queue?

The missing tail IC in the XDP paths predates this patch. The same
behaviour already exists with per-channel MSI, and on xgmac since
305deb54c6c2. This patch removes the fallback that hid it on shared-IRQ
dwmac4. The later patches in this series do not change the XDP IC logic
or the timer.

>  	if (unlikely(intr_status & DMA_CHAN_STATUS_ERI))
>  		x->rx_early_irq++;
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204203130.287919-1-contact%40c127.dev

  reply	other threads:[~2026-12-05 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 20:31 [PATCH net-next 0/3] net: stmmac: reduce DMA interrupt latency on YT6801 Johan Alvarado
2026-12-04 20:31 ` [PATCH net-next 1/3] net: stmmac: dwmac4: do not treat TBU as a TX event Johan Alvarado
2026-12-05 20:37   ` netdev-bot+sashiko [this message]
2026-12-04 20:31 ` [PATCH net-next 2/3] net: stmmac: add an opt-in MSI vector mask for NAPI Johan Alvarado
2026-12-05 20:37   ` netdev-bot+sashiko
2026-12-04 20:31 ` [PATCH net-next 3/3] net: stmmac: motorcomm: mask the MSI vector during NAPI Johan Alvarado
2026-12-05 20:37   ` netdev-bot+sashiko

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=179650307507.3148.11981509559101127373@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=contact@c127.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=me@ziyao.cc \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zhangfeionline@gmail.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