Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

page_pool: Clamp pool size to max 16K pages

page_pool_init() returns E2BIG when the page_pool size goes above 32K
pages. As some drivers are configuring the page_pool size according to
the MTU and ring size, there are cases where this limit is exceeded and
the queue creation fails.

The page_pool size doesn't have to cover a full queue, especially for
larger ring size. So clamp the size instead of returning an error. Do
this in the core to avoid having each driver do the clamping.

The current limit was deemed to high [1] so it was reduced to 16K to avoid
page waste.

[1] https://lore.kernel.org/all/1758532715-820422-3-git-send-email-tariqt@nvidia.com/

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250926131605.2276734-2-dtatulea@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Dragos Tatulea and committed by
Paolo Abeni
a1b501a8 2ade9170

+1 -5
+1 -5
net/core/page_pool.c
··· 211 211 return -EINVAL; 212 212 213 213 if (pool->p.pool_size) 214 - ring_qsize = pool->p.pool_size; 215 - 216 - /* Sanity limit mem that can be pinned down */ 217 - if (ring_qsize > 32768) 218 - return -E2BIG; 214 + ring_qsize = min(pool->p.pool_size, 16384); 219 215 220 216 /* DMA direction is either DMA_FROM_DEVICE or DMA_BIDIRECTIONAL. 221 217 * DMA_BIDIRECTIONAL is for allowing page used for DMA sending,