Skip to content

net: bcmasp: fix TX ring accounting bugs

Danesh Petigara lkml netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: bcmasp: clear txcb->last before writing each descriptordrivers/net/ethernet/broadcom/asp2/bcmasp_intf.c+1 -01 replyApplied
2/2net: bcmasp: fix tx_spb_ring_full() checking same slot cnt timesdrivers/net/ethernet/broadcom/asp2/bcmasp_intf.c+2 -11 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFlorian Fainelli
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs

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(-)
Signature · 1 line
2.54.0