mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
8aef7340ae
The xdp_umem_page holds the address for a page. Trade memory for faster lookup. Later, we'll add DMA address here as well. Signed-off-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
22 lines
556 B
C
22 lines
556 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* XDP user-space packet buffer
|
|
* Copyright(c) 2018 Intel Corporation.
|
|
*/
|
|
|
|
#ifndef XDP_UMEM_H_
|
|
#define XDP_UMEM_H_
|
|
|
|
#include <net/xdp_sock.h>
|
|
|
|
static inline char *xdp_umem_get_data(struct xdp_umem *umem, u64 addr)
|
|
{
|
|
return umem->pages[addr >> PAGE_SHIFT].addr + (addr & (PAGE_SIZE - 1));
|
|
}
|
|
|
|
bool xdp_umem_validate_queues(struct xdp_umem *umem);
|
|
void xdp_get_umem(struct xdp_umem *umem);
|
|
void xdp_put_umem(struct xdp_umem *umem);
|
|
struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr);
|
|
|
|
#endif /* XDP_UMEM_H_ */
|