summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-01-08 14:06:22 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:22:51 +0100
commit7a4fd3df85b3a388bdb849ab2cee01aacb1d75cb (patch)
tree076ecf665b027f281857ebac0dea527275e77bd8
parent1425cb829556398f594658512d49292f988a2ab0 (diff)
net: make page_pool_ref_netmem work with net iovs
[ Upstream commit cbc16bceea784210d585a42ac9f8f10ce62b300e ] page_pool_ref_netmem() should work with either netmem representation, but currently it casts to a page with netmem_to_page(), which will fail with net iovs. Use netmem_get_pp_ref_count_ref() instead. Fixes: 8ab79ed50cf1 ("page_pool: devmem support") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: David Wei <dw@davidwei.uk> Link: https://lore.kernel.org/20250108220644.3528845-2-dw@davidwei.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--include/net/page_pool/helpers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index 793e6fd78bc5..60a5347922be 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -294,7 +294,7 @@ static inline long page_pool_unref_page(struct page *page, long nr)
static inline void page_pool_ref_netmem(netmem_ref netmem)
{
- atomic_long_inc(&netmem_to_page(netmem)->pp_ref_count);
+ atomic_long_inc(netmem_get_pp_ref_count_ref(netmem));
}
static inline void page_pool_ref_page(struct page *page)