diff mbox series

[net-next,v9,08/20] net: expose page_pool_{set,clear}_pp_info

Message ID 20241218003748.796939-9-dw@davidwei.uk (mailing list archive)
State New
Headers show
Series [net-next,v9,01/20] net: page_pool: don't cast mp param to devmem | expand

Commit Message

David Wei Dec. 18, 2024, 12:37 a.m. UTC
From: Pavel Begunkov <asml.silence@gmail.com>

Memory providers need to set page pool to its net_iovs on allocation, so
expose page_pool_{set,clear}_pp_info to providers outside net/.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: David Wei <dw@davidwei.uk>
---
 include/net/page_pool/helpers.h | 13 +++++++++++++
 net/core/page_pool_priv.h       |  9 ---------
 2 files changed, 13 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index e555921e5233..872947179bae 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -483,4 +483,17 @@  static inline void page_pool_nid_changed(struct page_pool *pool, int new_nid)
 		page_pool_update_nid(pool, new_nid);
 }
 
+#if defined(CONFIG_PAGE_POOL)
+void page_pool_set_pp_info(struct page_pool *pool, netmem_ref netmem);
+void page_pool_clear_pp_info(netmem_ref netmem);
+#else
+static inline void page_pool_set_pp_info(struct page_pool *pool,
+					 netmem_ref netmem)
+{
+}
+static inline void page_pool_clear_pp_info(netmem_ref netmem)
+{
+}
+#endif
+
 #endif /* _NET_PAGE_POOL_HELPERS_H */
diff --git a/net/core/page_pool_priv.h b/net/core/page_pool_priv.h
index 57439787b9c2..11a45a5f3c9c 100644
--- a/net/core/page_pool_priv.h
+++ b/net/core/page_pool_priv.h
@@ -36,18 +36,9 @@  static inline bool page_pool_set_dma_addr(struct page *page, dma_addr_t addr)
 }
 
 #if defined(CONFIG_PAGE_POOL)
-void page_pool_set_pp_info(struct page_pool *pool, netmem_ref netmem);
-void page_pool_clear_pp_info(netmem_ref netmem);
 int page_pool_check_memory_provider(struct net_device *dev,
 				    struct netdev_rx_queue *rxq);
 #else
-static inline void page_pool_set_pp_info(struct page_pool *pool,
-					 netmem_ref netmem)
-{
-}
-static inline void page_pool_clear_pp_info(netmem_ref netmem)
-{
-}
 static inline int page_pool_check_memory_provider(struct net_device *dev,
 						  struct netdev_rx_queue *rxq)
 {