drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()
[drm/drm-misc.git] / net / core / page_pool_priv.h
blob57439787b9c2b21c8ce3ce066f7650db8f7f27c0
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __PAGE_POOL_PRIV_H
4 #define __PAGE_POOL_PRIV_H
6 #include <net/page_pool/helpers.h>
8 #include "netmem_priv.h"
10 s32 page_pool_inflight(const struct page_pool *pool, bool strict);
12 int page_pool_list(struct page_pool *pool);
13 void page_pool_detached(struct page_pool *pool);
14 void page_pool_unlist(struct page_pool *pool);
16 static inline bool
17 page_pool_set_dma_addr_netmem(netmem_ref netmem, dma_addr_t addr)
19 if (PAGE_POOL_32BIT_ARCH_WITH_64BIT_DMA) {
20 netmem_set_dma_addr(netmem, addr >> PAGE_SHIFT);
22 /* We assume page alignment to shave off bottom bits,
23 * if this "compression" doesn't work we need to drop.
25 return addr != (dma_addr_t)netmem_get_dma_addr(netmem)
26 << PAGE_SHIFT;
29 netmem_set_dma_addr(netmem, addr);
30 return false;
33 static inline bool page_pool_set_dma_addr(struct page *page, dma_addr_t addr)
35 return page_pool_set_dma_addr_netmem(page_to_netmem(page), addr);
38 #if defined(CONFIG_PAGE_POOL)
39 void page_pool_set_pp_info(struct page_pool *pool, netmem_ref netmem);
40 void page_pool_clear_pp_info(netmem_ref netmem);
41 int page_pool_check_memory_provider(struct net_device *dev,
42 struct netdev_rx_queue *rxq);
43 #else
44 static inline void page_pool_set_pp_info(struct page_pool *pool,
45 netmem_ref netmem)
48 static inline void page_pool_clear_pp_info(netmem_ref netmem)
51 static inline int page_pool_check_memory_provider(struct net_device *dev,
52 struct netdev_rx_queue *rxq)
54 return 0;
56 #endif
58 #endif