Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs
@ 2026-08-31 18:42 Danesh Petigara
  2026-08-31 18:42 ` [PATCH net 1/2] net: bcmasp: clear txcb->last before writing each descriptor Danesh Petigara
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Danesh Petigara @ 2026-08-31 18:42 UTC (permalink / raw)
  To: justin.chen, florian.fainelli, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: horms, bcm-kernel-feedback-list, netdev, linux-kernel,
	Danesh Petigara

Two fixes for TX descriptor ring handling in the bcmasp driver:

  - tx_spb_ring_full() re-initialized next_index from
    intf->tx_spb_index on every loop iteration instead of advancing
    it, so it only ever checked a single descriptor slot regardless
    of cnt. This let bcmasp_xmit() proceed even when the ring didn't
    actually have enough free slots for the SKB's fragments.

  - bcmasp_xmit() only set txcb->last for the final fragment of an
    SKB, leaving stale true values in reused descriptor slots from a
    prior transmission. Combined with the ring-full miscount above,
    this could cause bcmasp_tx_reclaim() to treat a mid-SKB
    descriptor as the last one and free the sk_buff while later
    fragments were still in flight.

Patch 1 clears txcb->last unconditionally before it is set, and
patch 2 fixes the ring-full slot check to advance through each
candidate slot.

Justin Chen (2):
  net: bcmasp: clear txcb->last before writing each descriptor
  net: bcmasp: fix tx_spb_ring_full() checking same slot cnt times

 drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.54.0


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

end of thread, other threads:[~2026-09-04  0:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 18:42 [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs Danesh Petigara
2026-08-31 18:42 ` [PATCH net 1/2] net: bcmasp: clear txcb->last before writing each descriptor Danesh Petigara
2026-09-03 22:39   ` Florian Fainelli
2026-08-31 18:42 ` [PATCH net 2/2] net: bcmasp: fix tx_spb_ring_full() checking same slot cnt times Danesh Petigara
2026-09-03 22:39   ` Florian Fainelli
2026-09-04  0:00 ` [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs patchwork-bot+netdevbpf

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