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)
commit81ed18ab3098b6519274545e80a29caacb77d160
tree62cf05acb5648f25efd010110c6f40b70d1371c6
parent8041902dae5299c1f194ba42d14383f734631009
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