mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-02 15:53:42 +00:00
page_pool: add page_pool_dev_alloc_netmem()
Similarly to other _dev shorthands, add one for page_pool_alloc_netmem() to allocate a netmem using the default Rx GFP flags (ATOMIC | NOWARN) to make the page -> netmem transition of drivers easier. Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com> Link: https://patch.msgid.link/20241218174435.1445282-2-aleksander.lobakin@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
29b540795b
commit
a19d0236f4
@@ -144,6 +144,15 @@ static inline netmem_ref page_pool_alloc_netmem(struct page_pool *pool,
|
||||
return netmem;
|
||||
}
|
||||
|
||||
static inline netmem_ref page_pool_dev_alloc_netmem(struct page_pool *pool,
|
||||
unsigned int *offset,
|
||||
unsigned int *size)
|
||||
{
|
||||
gfp_t gfp = GFP_ATOMIC | __GFP_NOWARN;
|
||||
|
||||
return page_pool_alloc_netmem(pool, offset, size, gfp);
|
||||
}
|
||||
|
||||
static inline struct page *page_pool_alloc(struct page_pool *pool,
|
||||
unsigned int *offset,
|
||||
unsigned int *size, gfp_t gfp)
|
||||
|
||||
Reference in New Issue
Block a user