xsk: add umem fill queue support and mmap
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 2 May 2018 11:01:24 +0000 (13:01 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 May 2018 22:55:23 +0000 (15:55 -0700)
commit423f38329d267969130fb6f2c685f73d72687558
treeab7c0df0819c420846ac47c18ddc0fd614eaf035
parentc0c77d8fb787cfe0c3fca689c2a30d1dad4eaba7
xsk: add umem fill queue support and mmap

Here, we add another setsockopt for registered user memory (umem)
called XDP_UMEM_FILL_QUEUE. Using this socket option, the process can
ask the kernel to allocate a queue (ring buffer) and also mmap it
(XDP_UMEM_PGOFF_FILL_QUEUE) into the process.

The queue is used to explicitly pass ownership of umem frames from the
user process to the kernel. These frames will in a later patch be
filled in with Rx packet data by the kernel.

v2: Fixed potential crash in xsk_mmap.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/if_xdp.h
net/xdp/Makefile
net/xdp/xdp_umem.c
net/xdp/xdp_umem.h
net/xdp/xsk.c
net/xdp/xsk_queue.c [new file with mode: 0644]
net/xdp/xsk_queue.h [new file with mode: 0644]