Alexei Starovoitov
15a07b3381
bpf: add lookup/update support for per-cpu hash and array maps
...
The functions bpf_map_lookup_elem(map, key, value) and
bpf_map_update_elem(map, key, value, flags) need to get/set
values from all-cpus for per-cpu hash and array maps,
so that user space can aggregate/update them as necessary.
Example of single counter aggregation in user space:
unsigned int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
long values[nr_cpus];
long value = 0;
bpf_lookup_elem(fd, key, values);
for (i = 0; i < nr_cpus; i++)
value += values[i];
The user space must provide round_up(value_size, 8) * nr_cpus
array to get/set values, since kernel will use 'long' copy
of per-cpu values to try to copy good counters atomically.
It's a best-effort, since bpf programs and user space are racing
to access the same memory.
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Signed-off-by: David S. Miller <davem@davemloft.net >
2016-02-06 03:34:36 -05:00
..
2016-01-21 19:36:08 +01:00
2016-01-20 18:03:56 -08:00
2016-01-18 12:10:45 -08:00
2016-01-23 18:45:06 -08:00
2016-01-23 18:45:06 -08:00
2016-01-24 12:50:56 -08:00
2016-01-20 18:42:30 -08:00
2016-01-23 18:45:06 -08:00
2016-01-17 19:13:15 -08:00
2016-01-24 03:47:37 +01:00
2016-01-24 03:49:03 +01:00
2016-01-21 19:58:02 -08:00
2016-02-06 03:34:36 -05:00
2016-01-27 09:10:29 -05:00
2016-01-20 17:20:53 -08:00
2016-01-16 11:17:25 -08:00
2016-01-20 17:09:18 -08:00
2016-01-30 13:35:32 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 22:08:45 +01:00
2016-01-16 11:17:24 -08:00
2016-01-30 13:35:31 -08:00
2016-01-28 17:00:50 -08:00
2016-01-14 16:00:49 -08:00
2016-01-17 11:13:55 +01:00
2016-01-21 17:20:51 -08:00
2016-01-15 17:56:32 -08:00
2016-02-06 02:59:51 -05:00
2016-01-23 18:45:06 -08:00
2016-01-20 17:09:18 -08:00
2016-01-29 12:34:29 +01:00
2016-01-26 16:00:14 +01:00
2016-01-16 11:17:23 -08:00
2016-01-16 11:17:22 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 17:56:32 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 17:56:32 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2016-01-21 11:52:16 -08:00
2016-02-06 03:13:49 -05:00
2016-01-14 16:08:23 -08:00
2016-01-14 16:08:23 -08:00
2016-01-15 12:30:35 -06:00
2016-01-15 17:56:32 -08:00
2016-01-22 17:02:18 -08:00
2016-01-15 17:29:37 -06:00
2016-01-21 11:52:16 -08:00
2016-01-29 08:35:35 +01:00
2016-01-31 09:10:19 -08:00
2016-01-15 17:56:32 -08:00
2016-01-19 19:25:21 -05:00
2016-01-22 17:02:18 -08:00
2016-01-16 11:17:22 -08:00
2016-01-16 11:17:29 -08:00
2016-01-20 17:09:18 -08:00
2016-01-22 17:02:18 -08:00
2016-01-20 17:09:18 -08:00
2016-01-15 17:56:32 -08:00
2016-01-22 10:24:03 -08:00
2016-01-20 17:09:18 -08:00
2016-01-22 18:08:52 -05:00
2016-01-15 14:35:24 -05:00
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 17:29:52 -05:00
2016-01-14 16:00:49 -08:00
2016-01-15 22:34:39 +01:00
2016-01-18 14:49:33 -05:00
2016-01-26 23:17:54 -08:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2016-01-14 16:00:49 -08:00
2016-01-14 16:00:49 -08:00