aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-08-19 19:56:50 -0700
committerJakub Kicinski <kuba@kernel.org>2025-08-21 08:03:54 -0700
commit07cf71bf25cd4e5735ff13468e7b86f02c3665cb (patch)
treef38bb859939713242358651b695efd30d0cc430e /include
parentMerge branch 'add-ppe-driver-for-qualcomm-ipq9574-soc' (diff)
downloadlinux-07cf71bf25cd4e5735ff13468e7b86f02c3665cb.tar.gz
linux-07cf71bf25cd4e5735ff13468e7b86f02c3665cb.zip
net: page_pool: add page_pool_get()
There is a page_pool_put() function but no get equivalent. Having multiple references to a page pool is quite useful. It avoids branching in create / destroy paths in drivers which support memory providers. Use the new helper in bnxt. Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20250820025704.166248-2-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/page_pool/helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index db180626be06..aa3719f28216 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -489,6 +489,11 @@ page_pool_dma_sync_netmem_for_cpu(const struct page_pool *pool,
offset, dma_sync_size);
}
+static inline void page_pool_get(struct page_pool *pool)
+{
+ refcount_inc(&pool->user_cnt);
+}
+
static inline bool page_pool_put(struct page_pool *pool)
{
return refcount_dec_and_test(&pool->user_cnt);