summaryrefslogtreecommitdiff
path: root/kernel/async.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2016-08-11 18:17:16 -0700
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:50:31 +0300
commit54369560a245da099fa715db4675be44088cef4b (patch)
tree2411332bc6a6bfca55359e0212edbe7fb3b07875 /kernel/async.c
parentbe359f3244d422a8efbbc4144ca9493283793be1 (diff)
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> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'kernel/async.c')
0 files changed, 0 insertions, 0 deletions