diff options
author | Alexei Starovoitov <ast@fb.com> | 2017-03-16 04:26:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-17 06:44:11 +0300 |
commit | 81ed18ab3098b6519274545e80a29caacb77d160 (patch) | |
tree | 62cf05acb5648f25efd010110c6f40b70d1371c6 /include/linux/bpf_verifier.h | |
parent | 8041902dae5299c1f194ba42d14383f734631009 (diff) | |
download | linux-81ed18ab3098b6519274545e80a29caacb77d160.tar.xz |
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>
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r-- | include/linux/bpf_verifier.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index a13b031dc6b8..5efb4db44e1e 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -66,7 +66,10 @@ struct bpf_verifier_state_list { }; struct bpf_insn_aux_data { - enum bpf_reg_type ptr_type; /* pointer type for load/store insns */ + union { + enum bpf_reg_type ptr_type; /* pointer type for load/store insns */ + struct bpf_map *map_ptr; /* pointer for call insn into lookup_elem */ + }; }; #define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */ |