Files
android_kernel_xiaomi_sm8450/include/uapi/linux
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
..
2018-07-23 19:18:10 +01:00
2018-08-06 10:24:33 +02:00
2018-08-22 10:52:49 -07:00
2018-10-19 13:24:31 -07:00
2018-07-25 06:59:23 -04:00
2018-07-19 13:58:44 -07:00
2018-06-18 15:11:53 +10:00
2018-09-05 22:27:11 -07:00
2018-07-17 15:33:47 +02:00
2018-07-07 17:41:38 +02:00
2018-08-03 10:03:57 -07:00
2017-11-28 16:54:00 +01:00
2018-04-11 10:28:37 -07:00
2018-01-14 23:06:30 -05:00
2018-01-16 16:47:29 +01:00
2018-08-15 14:59:06 -05:00
2018-06-15 18:10:01 -03:00
2018-02-06 22:53:56 +00:00
2018-05-31 00:13:56 +08:00
2018-03-20 03:17:41 +02:00
2018-04-14 11:59:31 -04:00
2017-11-24 10:18:41 +00:00
2017-11-16 10:49:00 +09:00
2018-04-11 10:28:37 -07:00
2018-10-08 15:45:18 +01:00
2018-02-06 18:32:44 -08:00
2018-03-26 13:22:58 -06:00
2016-12-16 00:13:32 +02:00