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 <[email protected]> Signed-off-by: David Wei <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6be7aca commit cbc16bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)