]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add helper inlining infra and optimize map_array lookup
authorAlexei Starovoitov <ast@fb.com>
Thu, 16 Mar 2017 01:26:42 +0000 (18:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Mar 2017 03:44:11 +0000 (20:44 -0700)
commite06571cef39a4451de1bf85b552929f0faa7037e
tree62cf05acb5648f25efd010110c6f40b70d1371c6
parent18188766ed5e1b4865273e3857ef7c114f6aeff4
bpf: add helper inlining infra and optimize map_array lookup

Optimize bpf_call -> bpf_map_lookup_elem() -> array_map_lookup_elem()
into a sequence of bpf instructions.
When JIT is on the sequence of bpf instructions is the sequence
of native cpu instructions with significantly faster performance
than indirect call and two function's prologue/epilogue.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf.h
include/linux/bpf_verifier.h
include/linux/filter.h
kernel/bpf/arraymap.c
kernel/bpf/verifier.c