Re: [PATCH net] net: axienet: free outstanding TX buffers in axienet_dma_bd_release()

From: Sagi Maimon

Date: Tue Sep 29 2026 - 01:38:03 EST


On Tue, Sep 29, 2026 at 3:12 AM Joe Damato <joe@xxxxxxx> wrote:
>
> On Sun, Sep 27, 2026 at 11:10:34AM +0300, Sagi Maimon wrote:
>
> [...]
>
> > Walk the TX ring the way axienet_dma_err_handler() already does: unmap
> > every descriptor whose cntrl is still set - axienet_free_tx_chain()
> > clears it on reclaim - and free any skb still attached.
>
> The code added in this patch and in axienet_dma_err_handler are almost
> identical (as your commit message suggests). I am wondering if it's possible
> to factor this code out into a helper and instead call it from both places
> instead of repeating the same code?

Yes, the unmap-and-free part is the same; the error handler also clears
each descriptor for reuse, and frees with dev_kfree_skb_irq() where this
uses dev_kfree_skb(), so a shared helper would use dev_kfree_skb_any().
Since this goes to net with a Fixes: tag I kept it to the minimal
change. I will send the helper to net-next once this fix has reached
it, if that works for you.
Thanks,
Sagi