xdp_umem.h 565 字节
Newer Older
B
Björn Töpel 已提交
1 2
/* SPDX-License-Identifier: GPL-2.0 */
/* XDP user-space packet buffer
3 4 5 6 7 8
 * Copyright(c) 2018 Intel Corporation.
 */

#ifndef XDP_UMEM_H_
#define XDP_UMEM_H_

9
#include <net/xdp_sock.h>
10

11
static inline char *xdp_umem_get_data(struct xdp_umem *umem, u64 addr)
12
{
13 14
	return page_address(umem->pgs[addr >> PAGE_SHIFT]) +
		(addr & (PAGE_SIZE - 1));
15 16
}

17
bool xdp_umem_validate_queues(struct xdp_umem *umem);
18 19
void xdp_get_umem(struct xdp_umem *umem);
void xdp_put_umem(struct xdp_umem *umem);
B
Björn Töpel 已提交
20
struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr);
21 22

#endif /* XDP_UMEM_H_ */