[RFC 12/19] netmem: introduce page_pool_recycle_direct_netmem()

From: Byungchul Park
Date: Fri May 09 2025 - 07:55:22 EST


All the callers to page_pool_recycle_direct() need to be converted to
use netmem descriptor and API instead of struct page things.

As part of the work, introduce page_pool_recycle_direct_netmem()
allowing the callers to use netmem descriptor and API.

Signed-off-by: Byungchul Park <byungchul@xxxxxx>
---
include/net/page_pool/helpers.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index 582a3d00cbe23..9b7a3a996bbea 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -395,6 +395,12 @@ static inline void page_pool_recycle_direct(struct page_pool *pool,
page_pool_put_full_page(pool, page, true);
}

+static inline void page_pool_recycle_direct_netmem(struct page_pool *pool,
+ netmem_ref netmem)
+{
+ page_pool_put_full_netmem(pool, netmem, true);
+}
+
#define PAGE_POOL_32BIT_ARCH_WITH_64BIT_DMA \
(sizeof(dma_addr_t) > sizeof(unsigned long))

--
2.17.1