]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: libwx: fix the creation of page_pool
authorJiawen Wu <jiawenwu@trustnetic.com>
Wed, 25 Jun 2025 02:39:24 +0000 (10:39 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 26 Jun 2025 09:02:23 +0000 (11:02 +0200)
'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>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/434C72BFB40E350A+20250625023924.21821-1-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/wangxun/libwx/wx_lib.c

index 7f2e6cddfeb1063d51e0ea86d312b76e69d462bc..c57cc4f2724970397dd2c672b381e74b7b6285b5 100644 (file)
@@ -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,