Netdev List
 help / color / mirror / Atom feed
From: Johan Alvarado <contact@c127.dev>
To: Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Yao Zi <me@ziyao.cc>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	Johan Alvarado <contact@c127.dev>,
	Pengfei Zhang <zhangfeionline@gmail.com>
Subject: [PATCH net-next 0/3] net: stmmac: reduce DMA interrupt latency on YT6801
Date: Fri,  4 Dec 2026 15:31:27 -0500	[thread overview]
Message-ID: <20261204203130.287919-1-contact@c127.dev> (raw)

On the Motorcomm YT6801 (dwmac-motorcomm), an RX or TX completion that
happens while stmmac has the DMA channel interrupt masked for NAPI does
not raise a new MSI when it is unmasked. The glue's 200 us interrupt
moderation adds to the delay. At high packet rates the RX ring
overflows. With the series, ping RTT to a peer one routed hop away
goes from 0.82-0.86 to 0.60-0.66 ms and 64-byte UDP RX loss from
0.65-1.60 % to 0.01-0.06 %, with more interrupts. Patch 3 has the full numbers.

Patch 1 stops dwmac4 from reporting TBU as TX work, as commit
305deb54c6c2 ("net: stmmac: xgmac: do not treat TBU as a TX event")
did for xgmac.

Patch 2 adds an opt-in flag to mask the per-channel MSI vector during
NAPI instead of the DMA channel interrupt, as the vendor driver does,
so the irq core resends an event raised meanwhile. Patch 3 sets it for
the YT6801 with MSI-X and turns the glue moderation off. Neither change
is enough alone.

An alternative, keeping the DMA mask and rechecking RI/TI after
unmasking, performed the same, but needed a new DMA op, an MMIO read on
every unmask and about 2000 extra acknowledges/s under UDP TX.

Only the YT6801 is known to need this. I have no other multi-MSI
dwmac4 hardware (dwmac-intel, dwmac-loongson), so only dwmac-motorcomm
sets the flag. On an affected device, bpftrace shows gaps over 2 ms
between stmmac_napi_poll_tx() calls during a 64-byte UDP TX flood.

Tested on an Orange Pi 5 Pro (RK3588S, YT6801 on PCIe 2.0 x1) with the
series backported to 7.3.6. Build tested each patch with W=1 at
net-next d5cf954cebe4.

Johan Alvarado (3):
  net: stmmac: dwmac4: do not treat TBU as a TX event
  net: stmmac: add an opt-in MSI vector mask for NAPI
  net: stmmac: motorcomm: mask the MSI vector during NAPI

 .../ethernet/stmicro/stmmac/dwmac-motorcomm.c |   8 +-
 .../net/ethernet/stmicro/stmmac/dwmac4_lib.c  |   2 -
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   3 +
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 105 ++++++++++++++++--
 include/linux/stmmac.h                        |   1 +
 5 files changed, 106 insertions(+), 13 deletions(-)


base-commit: d5cf954cebe4f175dfd834e1dc471a3aa203ec7d
-- 
2.56.1


             reply	other threads:[~2026-12-04 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 20:31 Johan Alvarado [this message]
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-04 20:31 ` [PATCH net-next 2/3] net: stmmac: add an opt-in MSI vector mask for NAPI Johan Alvarado
2026-12-04 20:31 ` [PATCH net-next 3/3] net: stmmac: motorcomm: mask the MSI vector during NAPI Johan Alvarado

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=20261204203130.287919-1-contact@c127.dev \
    --to=contact@c127.dev \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --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