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
);
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
)
29 netmem_set_dma_addr(netmem
, addr
);
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
);
44 static inline void page_pool_set_pp_info(struct page_pool
*pool
,
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
)