aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Lobakin <[email protected]>2024-12-18 17:44:29 +0000
committerJakub Kicinski <[email protected]>2024-12-20 03:51:13 +0000
commita19d0236f466f1ce8f44a04a96c302d3023eebf4 (patch)
tree9d7b9a110d072901988468f50a350adac3b73d6b
parentgre: Drop ip_route_output_gre(). (diff)
downloadkernel-a19d0236f466f1ce8f44a04a96c302d3023eebf4.tar.gz
kernel-a19d0236f466f1ce8f44a04a96c302d3023eebf4.zip
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]>
-rw-r--r--include/net/page_pool/helpers.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index 776a3008ac28..543f54fa3020 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -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)