Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: stmmac: reduce DMA interrupt latency on YT6801
@ 2026-12-04 20:31 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
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johan Alvarado @ 2026-12-04 20:31 UTC (permalink / raw)
  To: Jakub Kicinski, Paolo Abeni, Eric Dumazet, David S . Miller,
	Andrew Lunn, Maxime Chevallier, Yao Zi
  Cc: Maxime Coquelin, Alexandre Torgue, netdev, linux-stm32,
	linux-arm-kernel, Johan Alvarado, Pengfei Zhang

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-04 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox