🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Nicolai Buchwitz Tue, 17 Nov 2026 13:18
Re: [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails
#17890
Author: Nicolai Buchwitz
Date: Tue, 17 Nov 2026 13:18
60 lines
10623 bytes
On 17.11.2026 13:49, Daniel Machon wrote:
> lan966x_fdma_init() allocates the RX ring and fills its DCBs with pages
> from the RX page pool, then allocates the TX ring. If the TX allocation
> fails, the error path frees the RX ring and destroys the page pool, but
> does not return the pages to the pool first.
> 
> The pool then never finishes its shutdown, and 
> page_pool_release_retry()
> keeps warning about the pages still in flight.
> 
> To let the pool shut down, return the RX pages before destroying it, as
> lan966x_fdma_deinit() does. lan966x_fdma_rx_alloc() does not check that
> every DCB got its pages, so skip the entries that are still empty.
> 
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c 
> b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> index 1fbe910c5ec38..586ee648c7741 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> @@ -54,9 +54,11 @@ static void lan966x_fdma_rx_free_pages(struct 
> lan966x_rx *rx)
>  	int i, j;
> 
>  	for (i = 0; i < fdma->n_dcbs; ++i) {
> -		for (j = 0; j < fdma->n_dbs; ++j)
> -			page_pool_put_full_page(rx->page_pool,
> -						rx->page[i][j], false);
> +		for (j = 0; j < fdma->n_dbs; ++j) {
> +			if (rx->page[i][j])
> +				page_pool_put_full_page(rx->page_pool,
> +							rx->page[i][j], false);
> +		}
>  	}
>  }
> 
> @@ -999,6 +1001,7 @@ int lan966x_fdma_init(struct lan966x *lan966x)
> 
>  	err = lan966x_fdma_tx_alloc(&lan966x->tx);
>  	if (err) {
> +		lan966x_fdma_rx_free_pages(&lan966x->rx);
>  		fdma_free_coherent(lan966x->dma_dev, &lan966x->rx.fdma);
>  		page_pool_destroy(lan966x->rx.page_pool);
>  		return err;
> 
> ---
> base-commit: 994089a3fa3882f27f4bed9fc5815ee7df502e88
> change-id: 20261116-lan966x-rx-pages-tx-alloc-fail-2b8e412f15f2
> 
> Best regards,

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Regards
Nicolai
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads