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 |
On Tue, 17 Dec 2024 16:37:34 -0800 David Wei wrote: > 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/. I'd really rather not expose such low level functions in a header included by every single user of the page pool API.
On 12/20/24 22:31, Jakub Kicinski wrote: > On Tue, 17 Dec 2024 16:37:34 -0800 David Wei wrote: >> 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/. > > I'd really rather not expose such low level functions in a header > included by every single user of the page pool API. Are you fine if it's exposed in a new header file?
On Sat, 21 Dec 2024 01:07:44 +0000 Pavel Begunkov wrote: > >> 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/. > > > > I'd really rather not expose such low level functions in a header > > included by every single user of the page pool API. > > Are you fine if it's exposed in a new header file? I guess. I'm uncomfortable with the "outside net/" phrasing of the commit message. Nothing outside net should used this stuff. Next we'll have a four letter subsystem abusing it and claiming that it's in a header so it's a public. Maybe we should have a conversation about whether io_uring/zcrx.c is considered part of networking, whether all patches will get cross posted and need to get acks from both sides etc. Save ourselves unpleasant misunderstandings.
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) {