* [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails
@ 2026-11-17 12:49 Daniel Machon
2026-11-17 12:53 ` netdev-bot+sinfo
2026-11-17 13:18 ` Nicolai Buchwitz
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Machon @ 2026-11-17 12:49 UTC (permalink / raw)
To: Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Daniel Machon
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,
--
Daniel Machon <daniel.machon@microchip.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails
2026-11-17 12:49 [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails Daniel Machon
@ 2026-11-17 12:53 ` netdev-bot+sinfo
2026-11-17 13:18 ` Nicolai Buchwitz
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-17 12:53 UTC (permalink / raw)
To: Daniel Machon
Cc: Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails
2026-11-17 12:49 [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails Daniel Machon
2026-11-17 12:53 ` netdev-bot+sinfo
@ 2026-11-17 13:18 ` Nicolai Buchwitz
1 sibling, 0 replies; 3+ messages in thread
From: Nicolai Buchwitz @ 2026-11-17 13:18 UTC (permalink / raw)
To: Daniel Machon
Cc: Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-17 13:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 12:49 [PATCH net-next] net: lan966x: free the RX pages when the TX allocation fails Daniel Machon
2026-11-17 12:53 ` netdev-bot+sinfo
2026-11-17 13:18 ` Nicolai Buchwitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®