aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-11-09 13:03:26 +0000
committerAlexei Starovoitov <ast@kernel.org>2018-11-10 15:39:53 -0800
commit341b3e7b7b89315c43d262da3199098bcf9bbe57 (patch)
treed87fa4086f2f087e3be63b7a0e6533961432fae6 /include
parentbpf: pass a struct with offload callbacks to bpf_offload_dev_create() (diff)
downloadlinux-dev-341b3e7b7b89315c43d262da3199098bcf9bbe57.tar.xz
linux-dev-341b3e7b7b89315c43d262da3199098bcf9bbe57.zip
bpf: call verify_insn from its callback in struct bpf_offload_dev
We intend to remove the dev_ops in struct bpf_prog_offload, and to only keep the ops in struct bpf_offload_dev instead, which is accessible from more locations for passing function pointers. But dev_ops is used for calling the verify_insn hook. Switch to the newly added ops in struct bpf_prog_offload instead. To avoid table lookups for each eBPF instruction to verify, we remember the offdev attached to a netdev and modify bpf_offload_find_netdev() to avoid performing more than once a lookup for a given offload object. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index c0197c37b2b2..672714cd904f 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -273,6 +273,7 @@ struct bpf_prog_offload_ops {
struct bpf_prog_offload {
struct bpf_prog *prog;
struct net_device *netdev;
+ struct bpf_offload_dev *offdev;
void *dev_priv;
struct list_head offloads;
bool dev_state;