Skip to content

Commit a19d023

Browse files
alobakinkuba-moo
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 29b5407 commit a19d023

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/net/page_pool/helpers.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ static inline netmem_ref page_pool_alloc_netmem(struct page_pool *pool,
144144
return netmem;
145145
}
146146

147+
static inline netmem_ref page_pool_dev_alloc_netmem(struct page_pool *pool,
148+
unsigned int *offset,
149+
unsigned int *size)
150+
{
151+
gfp_t gfp = GFP_ATOMIC | __GFP_NOWARN;
152+
153+
return page_pool_alloc_netmem(pool, offset, size, gfp);
154+
}
155+
147156
static inline struct page *page_pool_alloc(struct page_pool *pool,
148157
unsigned int *offset,
149158
unsigned int *size, gfp_t gfp)

0 commit comments

Comments
 (0)