Thread (19 messages) 19 messages, 7 authors, 2025-11-10

Re: [PATCH net v1 1/2] page_pool: expose max page pool ring size

From: Jesper Dangaard Brouer <hawk@kernel.org>
Date: 2025-11-05 21:56:36
Also in: lkml


On 05/11/2025 21.07, Mina Almasry wrote:
Expose this as a constant so we can reuse it in drivers.

Signed-off-by: Mina Almasry <redacted>
---
  include/net/page_pool/types.h | 2 ++
  net/core/page_pool.c          | 2 +-
  2 files changed, 3 insertions(+), 1 deletion(-)

Looks good to me

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
quoted hunk ↗ jump to hunk
diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
index 1509a536cb85..5edba3122b10 100644
--- a/include/net/page_pool/types.h
+++ b/include/net/page_pool/types.h
@@ -58,6 +58,8 @@ struct pp_alloc_cache {
  	netmem_ref cache[PP_ALLOC_CACHE_SIZE];
  };
  
+#define PAGE_POOL_MAX_RING_SIZE 16384
+
IIRC this was recently reduced to 16384 (from 32K), do you have a
use-case for higher limits?
quoted hunk ↗ jump to hunk
  /**
   * struct page_pool_params - page pool parameters
   * @fast:	params accessed frequently on hotpath
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 1a5edec485f1..7b2808da294f 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -211,7 +211,7 @@ static int page_pool_init(struct page_pool *pool,
  		return -EINVAL;
  
  	if (pool->p.pool_size)
-		ring_qsize = min(pool->p.pool_size, 16384);
+		ring_qsize = min(pool->p.pool_size, PAGE_POOL_MAX_RING_SIZE);
  
  	/* DMA direction is either DMA_FROM_DEVICE or DMA_BIDIRECTIONAL.
  	 * DMA_BIDIRECTIONAL is for allowing page used for DMA sending,
base-commit: 327c20c21d80e0d87834b392d83ae73c955ad8ff
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help