# \[RFC 12/19\] netmem: introduce page\_pool\_recycle\_direct\_netmem()

- From: Byungchul Park \<byungchul@sk.com\>
- Date: 2025-05-09 11:51:44 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/05/3048943
- Thread: https://ratatoskr.run/netdev/2025/05/3048935/t.md

```text
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@sk.com>
---
 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

```
