1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Dmabuf device memory provider.
5 * Authors: Mina Almasry <almasrymina@google.com>
8 #ifndef _NET_MP_DMABUF_DEVMEM_H
9 #define _NET_MP_DMABUF_DEVMEM_H
11 #include <net/netmem.h>
13 #if defined(CONFIG_NET_DEVMEM)
14 int mp_dmabuf_devmem_init(struct page_pool
*pool
);
16 netmem_ref
mp_dmabuf_devmem_alloc_netmems(struct page_pool
*pool
, gfp_t gfp
);
18 void mp_dmabuf_devmem_destroy(struct page_pool
*pool
);
20 bool mp_dmabuf_devmem_release_page(struct page_pool
*pool
, netmem_ref netmem
);
22 static inline int mp_dmabuf_devmem_init(struct page_pool
*pool
)
27 static inline netmem_ref
28 mp_dmabuf_devmem_alloc_netmems(struct page_pool
*pool
, gfp_t gfp
)
33 static inline void mp_dmabuf_devmem_destroy(struct page_pool
*pool
)
38 mp_dmabuf_devmem_release_page(struct page_pool
*pool
, netmem_ref netmem
)
44 #endif /* _NET_MP_DMABUF_DEVMEM_H */