net: bcmasp: fix TX ring accounting bugs
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: bcmasp: clear txcb->last before writing each descriptordrivers/ | +1 | 1 reply | Applied |
| 2/2 | net: bcmasp: fix tx_spb_ring_full() checking same slot cnt timesdrivers/ | +2 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Florian Fainelli |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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