Skip to content

Commit cbc16bc

Browse files
isilencekuba-moo
authored andcommitted
net: make page_pool_ref_netmem work with net iovs
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: 8ab79ed ("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>
1 parent 6be7aca commit cbc16bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/net/page_pool/helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static inline long page_pool_unref_page(struct page *page, long nr)
294294

295295
static inline void page_pool_ref_netmem(netmem_ref netmem)
296296
{
297-
atomic_long_inc(&netmem_to_page(netmem)->pp_ref_count);
297+
atomic_long_inc(netmem_get_pp_ref_count_ref(netmem));
298298
}
299299

300300
static inline void page_pool_ref_page(struct page *page)

0 commit comments

Comments
 (0)