linux/include
Mauricio Vasquez B f1a2e44a3a bpf: add queue and stack maps
Queue/stack maps implement a FIFO/LIFO data storage for ebpf programs.
These maps support peek, pop and push operations that are exposed to eBPF
programs through the new bpf_map[peek/pop/push] helpers.  Those operations
are exposed to userspace applications through the already existing
syscalls in the following way:

BPF_MAP_LOOKUP_ELEM            -> peek
BPF_MAP_LOOKUP_AND_DELETE_ELEM -> pop
BPF_MAP_UPDATE_ELEM            -> push

Queue/stack maps are implemented using a buffer, tail and head indexes,
hence BPF_F_NO_PREALLOC is not supported.

As opposite to other maps, queue and stack do not use RCU for protecting
maps values, the bpf_map[peek/pop] have a ARG_PTR_TO_UNINIT_MAP_VALUE
argument that is a pointer to a memory zone where to save the value of a
map.  Basically the same as ARG_PTR_TO_UNINIT_MEM, but the size has not
be passed as an extra argument.

Our main motivation for implementing queue/stack maps was to keep track
of a pool of elements, like network ports in a SNAT, however we forsee
other use cases, like for exampling saving last N kernel events in a map
and then analysing from userspace.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-10-19 13:24:31 -07:00
..
acpi ACPICA: Update version to 20180810 2018-08-14 23:49:13 +02:00
asm-generic vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections 2018-10-12 08:55:29 +11:00
clocksource
crypto
drm drm/cma-helper: Fix crash in fbdev error path 2018-10-02 13:03:34 +02:00
dt-bindings dt-bindings: net: vsc8531: add two additional LED modes for VSC8584 2018-10-08 10:31:27 -07:00
keys
kvm KVM: arm/arm64: vgic-v3: Add core support for Group0 SGIs 2018-08-12 12:06:34 +01:00
linux bpf: add queue and stack maps 2018-10-19 13:24:31 -07:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
memory
misc
net bpf: sockmap, support for msg_peek in sk_msg with redirect ingress 2018-10-17 02:30:32 +02:00
pcmcia pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
ras
rdma RDMA/netdev: Fix netlink support in IPoIB 2018-10-10 17:58:12 -07:00
scsi SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-10-12 21:38:46 -07:00
sound ASoC: Fixes for v4.19 2018-09-17 18:59:21 +02:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-10-12 21:38:46 -07:00
uapi bpf: add queue and stack maps 2018-10-19 13:24:31 -07:00
video fbdev changes for v4.19: 2018-08-23 15:44:58 -07:00
xen xen/balloon: add runtime control for scrubbing ballooned out pages 2018-09-14 08:51:10 -04:00