summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/if_xdp.h
diff options
context:
space:
mode:
authorMagnus Karlsson2018-05-02 13:01:31 +0200
committerAlexei Starovoitov2018-05-04 00:55:24 +0200
commitfe2308328cd2f26ebc986f543796e7d13ae00bc4 (patch)
treef455bf4955aec597ac177eb89dc60e21b55c9191 /include/uapi/linux/if_xdp.h
parentxsk: wire up XDP_SKB side of AF_XDP (diff)
downloadkernel-qcow2-linux-fe2308328cd2f26ebc986f543796e7d13ae00bc4.tar.gz
kernel-qcow2-linux-fe2308328cd2f26ebc986f543796e7d13ae00bc4.tar.xz
kernel-qcow2-linux-fe2308328cd2f26ebc986f543796e7d13ae00bc4.zip
xsk: add umem completion queue support and mmap
Here, we add another setsockopt for registered user memory (umem) called XDP_UMEM_COMPLETION_QUEUE. Using this socket option, the process can ask the kernel to allocate a queue (ring buffer) and also mmap it (XDP_UMEM_PGOFF_COMPLETION_QUEUE) into the process. The queue is used to explicitly pass ownership of umem frames from the kernel to user process. This will be used by the TX path to tell user space that a certain frame has been transmitted and user space can use it for something else, if it wishes. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/uapi/linux/if_xdp.h')
-rw-r--r--include/uapi/linux/if_xdp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h
index e5091881f776..71581a139f26 100644
--- a/include/uapi/linux/if_xdp.h
+++ b/include/uapi/linux/if_xdp.h
@@ -36,6 +36,7 @@ struct sockaddr_xdp {
#define XDP_RX_RING 1
#define XDP_UMEM_REG 3
#define XDP_UMEM_FILL_RING 4
+#define XDP_UMEM_COMPLETION_RING 5
struct xdp_umem_reg {
__u64 addr; /* Start of packet data area */
@@ -47,6 +48,7 @@ struct xdp_umem_reg {
/* Pgoff for mmaping the rings */
#define XDP_PGOFF_RX_RING 0
#define XDP_UMEM_PGOFF_FILL_RING 0x100000000
+#define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000
struct xdp_desc {
__u32 idx;