]>
Commit | Line | Data |
---|---|---|
dac09149 BT |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* XDP user-space packet buffer | |
c0c77d8f | 3 | * Copyright(c) 2018 Intel Corporation. |
c0c77d8f BT |
4 | */ |
5 | ||
6 | #ifndef XDP_UMEM_H_ | |
7 | #define XDP_UMEM_H_ | |
8 | ||
e61e62b9 | 9 | #include <net/xdp_sock.h> |
c0c77d8f | 10 | |
bbff2f32 | 11 | static inline char *xdp_umem_get_data(struct xdp_umem *umem, u64 addr) |
c497176c | 12 | { |
8aef7340 | 13 | return umem->pages[addr >> PAGE_SHIFT].addr + (addr & (PAGE_SIZE - 1)); |
c497176c BT |
14 | } |
15 | ||
965a9909 | 16 | bool xdp_umem_validate_queues(struct xdp_umem *umem); |
c0c77d8f BT |
17 | void xdp_get_umem(struct xdp_umem *umem); |
18 | void xdp_put_umem(struct xdp_umem *umem); | |
a49049ea | 19 | struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr); |
c0c77d8f BT |
20 | |
21 | #endif /* XDP_UMEM_H_ */ |