aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-10-16 19:40:54 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-18 09:17:10 -0400
commit00176a34d9e27ab1e77db75fe13abc005cffe0ca (patch)
tree5bc104a145c96a042214e6b7f3e860502cc2bd96 /kernel/bpf/syscall.c
parent7de16e3a35578f4f5accc6f5f23970310483d0a2 (diff)
bpf: remove the verifier ops from program structure
Since the verifier ops don't have to be associated with the program for its entire lifetime we can move it to verifier's struct bpf_verifier_env. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 444902b5a30d..0e893cac6795 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -748,22 +748,12 @@ static const struct bpf_prog_ops * const bpf_prog_types[] = {
748#undef BPF_MAP_TYPE 748#undef BPF_MAP_TYPE
749}; 749};
750 750
751static const struct bpf_verifier_ops * const bpf_verifier_ops[] = {
752#define BPF_PROG_TYPE(_id, _name) \
753 [_id] = & _name ## _verifier_ops,
754#define BPF_MAP_TYPE(_id, _ops)
755#include <linux/bpf_types.h>
756#undef BPF_PROG_TYPE
757#undef BPF_MAP_TYPE
758};
759
760static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) 751static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
761{ 752{
762 if (type >= ARRAY_SIZE(bpf_prog_types) || !bpf_prog_types[type]) 753 if (type >= ARRAY_SIZE(bpf_prog_types) || !bpf_prog_types[type])
763 return -EINVAL; 754 return -EINVAL;
764 755
765 prog->aux->ops = bpf_prog_types[type]; 756 prog->aux->ops = bpf_prog_types[type];
766 prog->aux->vops = bpf_verifier_ops[type];
767 prog->type = type; 757 prog->type = type;
768 return 0; 758 return 0;
769} 759}