Re: [PATCH net v4 05/10] net: au1000: serialize TX completion with packet submission
From: Simon Horman
Date: Tue Dec 01 2026 - 06:01:19 EST
On Fri, Nov 20, 2026 at 04:48:04PM -0800, Florian Fainelli wrote:
> TX completion runs in hard IRQ context while ndo_start_xmit updates the
> same descriptors and ring state without locking. An interrupt between
> netif_stop_queue() and setting tx_full can miss the wakeup and leave the
> queue stopped until the watchdog runs. Use the existing IRQ-safe device
> lock in both paths to serialize reclamation and queue state changes.
> Keep the packet copy and padding outside this lock so uncached DMA
> buffer writes do not extend the IRQ-disabled critical section.
>
> When submission reclaims a completed descriptor at tx_head, advance
> tx_tail and clear TX_T_DONE before dropping the lock so the interrupt
> handler cannot reclaim it twice. The TX queue lock reserves the idle
> descriptor while its buffer is filled; completion stops at a descriptor
> without TX_T_DONE and never accesses its payload. Reacquire the device
> lock to publish the length, DMA ownership and tx_head together. Consume
> the copied skb after releasing the lock with dev_consume_skb_any(),
> which also handles netpoll entry with hardware interrupts disabled.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>