public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: stmmac: fix interrupt coalescing
@ 2026-02-23 11:41 Russell King (Oracle)
  2026-02-23 11:41 ` [PATCH net-next 1/2] net: stmmac: use circ_buf helpers for descriptors Russell King (Oracle)
  2026-02-23 11:41 ` [PATCH net-next 2/2] net: stmmac: fix transmit interrupt coalescing Russell King (Oracle)
  0 siblings, 2 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2026-02-23 11:41 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
	Paolo Abeni

Hi,

While cleaning up the descriptor handling, I noticed that the accounting
of transmit "packets" for interrupt coalescing was buggy in that it
takes the difference of the two indexes into the circular list of
transmit discriptors and merely subtracts one from the other without
regard for the indexes wrapping.

This can result in a negative number or very large positive number
which would have the effect of either reducing tx_q->tx_count_frames
or making that very large.

Either way, the result is numerically incorrect, and could trigger
interrupts or not trigger interrupts when required.

This series converts stmmac to use the circ_buf helpers, and then fixes
this problem.

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 28 ++++++++---------------
 1 file changed, 10 insertions(+), 18 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

end of thread, other threads:[~2026-02-23 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 11:41 [PATCH net-next 0/2] net: stmmac: fix interrupt coalescing Russell King (Oracle)
2026-02-23 11:41 ` [PATCH net-next 1/2] net: stmmac: use circ_buf helpers for descriptors Russell King (Oracle)
2026-02-23 12:02   ` Russell King (Oracle)
2026-02-23 11:41 ` [PATCH net-next 2/2] net: stmmac: fix transmit interrupt coalescing Russell King (Oracle)

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