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-10-03 07:42:29 -07:00
2018-08-18 15:55:59 -07:00
2018-09-30 08:49:55 -07:00
2018-10-10 14:03:27 +02:00
2018-08-22 14:07:56 +02:00
2018-08-09 16:11:21 -04:00
2018-09-10 16:58:36 +01:00
2018-10-10 17:58:11 -07:00
2018-08-11 12:19:35 +02:00
2018-09-17 11:40:07 +02:00
2018-10-05 14:36:44 -07:00
2018-08-26 17:45:25 -07:00
2018-10-02 11:29:40 -07:00
2018-09-03 16:10:40 +01:00
2018-08-22 12:34:08 -07:00
2018-08-23 13:44:43 -07:00
2018-09-28 18:04:06 -07:00
2018-08-09 18:47:47 +03:00
2018-08-23 16:03:58 -07:00
2018-10-02 22:22:46 -07:00
2018-08-22 08:08:27 -07:00
2018-08-30 14:18:03 +01:00
2018-08-22 10:52:46 -07:00
2018-08-22 10:52:46 -07:00
2018-08-17 16:20:27 -07:00
2018-08-22 10:52:48 -07:00
2018-08-31 14:48:56 -06:00
2018-08-14 10:23:25 -07:00
2018-09-11 10:59:53 -06:00
2018-10-19 13:24:31 -07:00
2018-10-08 10:24:12 +02:00
2018-10-01 16:18:32 +02:00
2018-10-19 13:24:31 -07:00
2018-08-07 15:48:38 -07:00
2018-10-04 13:28:08 -07:00
2018-08-13 01:02:39 +02:00
2018-08-17 16:20:32 -07:00
2018-08-14 16:39:13 -07:00
2018-09-20 15:23:58 +02:00
2018-08-22 17:31:34 -07:00
2018-09-20 15:23:58 +02:00
2018-08-22 17:31:34 -07:00
2018-08-22 10:52:47 -07:00
2018-08-14 13:12:24 -07:00
2018-08-23 13:44:43 -07:00
2018-08-13 09:05:05 -07:00
2018-08-22 10:52:46 -07:00
2018-08-22 10:52:48 -07:00
2018-08-21 18:19:09 -07:00
2018-08-18 11:44:53 -07:00
2018-08-17 16:20:32 -07:00
2018-10-04 09:40:52 -07:00
2018-08-29 19:46:10 -07:00
2018-08-25 13:40:38 -07:00
2018-10-15 12:23:19 -07:00
2018-09-24 10:54:01 +02:00
2018-08-17 16:49:31 -07:00
2018-09-21 20:26:59 -06:00
2018-08-23 18:48:43 -07:00
2018-09-04 21:31:43 +02:00
2018-08-25 18:43:59 -07:00
2018-10-05 16:32:04 -07:00
2018-08-30 23:13:15 +02:00
2018-08-26 11:48:42 -07:00
2018-10-11 16:01:00 +02:00
2018-09-13 09:25:40 -07:00
2018-08-15 10:25:26 -07:00
2018-08-22 10:52:47 -07:00
2018-08-08 12:02:27 +02:00
2018-08-08 11:06:20 +02:00
2018-08-22 10:52:52 -07:00
2018-09-13 08:17:27 -07:00
2018-08-10 15:11:25 -04:00
2018-08-16 19:36:55 +02:00
2018-08-17 16:20:30 -07:00
2018-08-26 11:25:21 -07:00
2018-08-22 10:52:46 -07:00
2018-08-18 11:44:53 -07:00
2018-09-20 00:51:43 +02:00
2018-08-24 13:20:33 -07:00
2018-10-01 22:55:36 -07:00
2018-08-17 16:20:32 -07:00
2018-08-10 15:11:25 -04:00
2018-08-15 10:25:26 -07:00
2018-08-22 10:52:45 -07:00
2018-08-22 10:52:45 -07:00
2018-10-01 22:55:36 -07:00
2018-09-13 15:18:04 -10:00
2018-09-13 15:18:04 -10:00
2018-10-05 16:32:04 -07:00
2018-08-22 10:52:44 -07:00
2018-10-09 08:30:51 +02:00
2018-09-05 14:36:53 +02:00
2018-10-16 00:13:39 -07:00
2018-08-22 10:52:48 -07:00
2018-10-15 21:46:06 -07:00
2018-09-28 14:47:40 +02:00
2018-10-16 00:13:12 -07:00
2018-09-23 21:55:24 -07:00
2018-08-23 16:03:58 -07:00
2018-08-09 12:56:39 -04:00
2018-08-13 17:04:23 -04:00
2018-08-09 12:56:39 -04:00
2018-08-17 16:20:29 -07:00
2018-08-22 10:52:45 -07:00
2018-08-08 11:55:45 +02:00
2018-08-31 08:30:42 -04:00
2018-08-23 18:48:44 -07:00
2018-08-08 09:47:26 -06:00
2018-08-17 16:20:28 -07:00
2018-08-23 18:48:43 -07:00
2018-09-03 19:05:13 -07:00
2018-09-11 21:44:52 -05:00
2018-08-22 10:52:45 -07:00
2018-10-01 23:14:10 -07:00
2018-08-09 11:08:19 -07:00
2018-08-14 13:36:15 +02:00
2018-08-22 10:52:46 -07:00
2018-10-13 20:31:37 +03:00
2018-08-22 18:17:29 +02:00
2018-08-09 11:15:06 +01:00
2018-09-25 20:17:35 -07:00
2018-08-22 12:34:08 -07:00
2018-08-15 10:25:26 -07:00
2018-10-02 14:38:02 -07:00
2018-08-20 09:22:45 -07:00
2018-08-22 10:52:43 -07:00
2018-08-22 12:34:08 -07:00
2018-10-02 11:18:09 -07:00
2018-10-17 02:30:31 +02:00
2018-08-17 16:20:30 -07:00
2018-08-16 12:14:42 -07:00
2018-09-18 19:48:08 -07:00
2018-10-12 12:35:02 +02:00
2018-08-22 10:52:44 -07:00
2018-08-23 18:48:44 -07:00
2018-08-14 16:39:13 -07:00
2018-08-18 11:44:53 -07:00
2018-10-15 22:56:41 -07:00
2018-08-22 15:11:35 +02:00
2018-09-03 13:26:44 +02:00
2018-09-05 11:23:21 -04:00
2018-09-12 14:58:47 -07:00
2018-08-13 20:08:33 -04:00
2018-08-23 18:48:44 -07:00
2018-08-16 09:57:20 -07:00
2018-09-13 17:58:30 +02:00
2018-08-11 12:02:18 -07:00
2018-10-04 22:23:15 -07:00
2018-09-13 15:18:04 -10:00
2018-09-13 15:18:04 -10:00