android_kernel_motorola_sm6225/kernel/bpf
Alexei Starovoitov 6841de8b0d bpf: allow helpers access the packet directly
The helper functions like bpf_map_lookup_elem(map, key) were only
allowing 'key' to point to the initialized stack area.
That is causing performance degradation when programs need to process
millions of packets per second and need to copy contents of the packet
into the stack just to pass the stack pointer into the lookup() function.
Allow such helpers read from the packet directly.
All helpers that expect ARG_PTR_TO_MAP_KEY, ARG_PTR_TO_MAP_VALUE,
ARG_PTR_TO_STACK assume byte aligned pointer, so no alignment concerns,
only need to check that helper will not be accessing beyond
the packet range verified by the prior 'if (ptr < data_end)' condition.
For now allow this feature for XDP programs only. Later it can be
relaxed for the clsact programs as well.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-08-12 21:56:18 -07:00
..
arraymap.c bpf: Add bpf_current_task_under_cgroup helper 2016-08-12 21:49:41 -07:00
core.c bpf: avoid stack copy and use skb ctx for event output 2016-07-15 14:23:56 -07:00
hashtab.c bpf: restore behavior of bpf_map_update_elem 2016-08-06 20:49:19 -04:00
helpers.c bpf: don't use raw processor id in generic helper 2016-06-30 05:54:40 -04:00
inode.c bpf: make inode code explicitly non-modular 2016-07-11 13:52:43 -07:00
Makefile bpf: introduce percpu_freelist 2016-03-08 15:28:31 -05:00
percpu_freelist.c bpf: introduce percpu_freelist 2016-03-08 15:28:31 -05:00
percpu_freelist.h bpf: introduce percpu_freelist 2016-03-08 15:28:31 -05:00
stackmap.c Merge branch 'linus' into perf/core, to refresh the branch 2016-06-08 09:26:46 +02:00
syscall.c bpf: add bpf_prog_add api for bulk prog refcnt 2016-07-19 21:46:31 -07:00
verifier.c bpf: allow helpers access the packet directly 2016-08-12 21:56:18 -07:00