* [PATCH net] net: libwx: fix the creation of page_pool
@ 2025-06-25 2:39 Jiawen Wu
2025-06-25 16:50 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiawen Wu @ 2025-06-25 2:39 UTC (permalink / raw)
To: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms
Cc: mengyuanlou, duanqiangwen, Jiawen Wu, stable
'rx_ring->size' means the count of ring descriptors multiplied by the
size of one descriptor. When increasing the count of ring descriptors,
it may exceed the limit of pool size.
[ 864.209610] page_pool_create_percpu() gave up with errno -7
[ 864.209613] txgbe 0000:11:00.0: Page pool creation failed: -7
Fix to set the pool_size to the count of ring descriptors.
Fixes: 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 7f2e6cddfeb1..c57cc4f27249 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -2623,7 +2623,7 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring)
struct page_pool_params pp_params = {
.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV,
.order = 0,
- .pool_size = rx_ring->size,
+ .pool_size = rx_ring->count,
.nid = dev_to_node(rx_ring->dev),
.dev = rx_ring->dev,
.dma_dir = DMA_FROM_DEVICE,
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: libwx: fix the creation of page_pool
2025-06-25 2:39 [PATCH net] net: libwx: fix the creation of page_pool Jiawen Wu
@ 2025-06-25 16:50 ` Simon Horman
2025-06-25 23:27 ` Mina Almasry
2025-06-26 9:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-25 16:50 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, mengyuanlou,
duanqiangwen, stable
On Wed, Jun 25, 2025 at 10:39:24AM +0800, Jiawen Wu wrote:
> 'rx_ring->size' means the count of ring descriptors multiplied by the
> size of one descriptor. When increasing the count of ring descriptors,
> it may exceed the limit of pool size.
>
> [ 864.209610] page_pool_create_percpu() gave up with errno -7
> [ 864.209613] txgbe 0000:11:00.0: Page pool creation failed: -7
>
> Fix to set the pool_size to the count of ring descriptors.
>
> Fixes: 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: libwx: fix the creation of page_pool
2025-06-25 2:39 [PATCH net] net: libwx: fix the creation of page_pool Jiawen Wu
2025-06-25 16:50 ` Simon Horman
@ 2025-06-25 23:27 ` Mina Almasry
2025-06-26 9:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Mina Almasry @ 2025-06-25 23:27 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms,
mengyuanlou, duanqiangwen, stable
On Tue, Jun 24, 2025 at 7:41 PM Jiawen Wu <jiawenwu@trustnetic.com> wrote:
>
> 'rx_ring->size' means the count of ring descriptors multiplied by the
> size of one descriptor. When increasing the count of ring descriptors,
> it may exceed the limit of pool size.
>
> [ 864.209610] page_pool_create_percpu() gave up with errno -7
> [ 864.209613] txgbe 0000:11:00.0: Page pool creation failed: -7
>
> Fix to set the pool_size to the count of ring descriptors.
>
> Fixes: 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Looks correct to me. pool_size is meant to be the number of entries in
the ptr_ring indeed, not a size in bytes. wx_setup_rx_resources does
set up rx_ring->size to be the size in bytes based on the
rx_ring->count.
Reviewed-by: Mina Almasry <almasrymina@google.com>
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: libwx: fix the creation of page_pool
2025-06-25 2:39 [PATCH net] net: libwx: fix the creation of page_pool Jiawen Wu
2025-06-25 16:50 ` Simon Horman
2025-06-25 23:27 ` Mina Almasry
@ 2025-06-26 9:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-26 9:10 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms,
mengyuanlou, duanqiangwen, stable
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Wed, 25 Jun 2025 10:39:24 +0800 you wrote:
> 'rx_ring->size' means the count of ring descriptors multiplied by the
> size of one descriptor. When increasing the count of ring descriptors,
> it may exceed the limit of pool size.
>
> [ 864.209610] page_pool_create_percpu() gave up with errno -7
> [ 864.209613] txgbe 0000:11:00.0: Page pool creation failed: -7
>
> [...]
Here is the summary with links:
- [net] net: libwx: fix the creation of page_pool
https://git.kernel.org/netdev/net/c/85720e04d9af
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-26 9:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 2:39 [PATCH net] net: libwx: fix the creation of page_pool Jiawen Wu
2025-06-25 16:50 ` Simon Horman
2025-06-25 23:27 ` Mina Almasry
2025-06-26 9:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).