summaryrefslogtreecommitdiff
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-11-09 13:03:32 +0000
committerAlexei Starovoitov <ast@kernel.org>2018-11-10 15:39:54 -0800
commit16a8cb5cffd0a2929ae97bc258d2d9c92a4e7f6d (patch)
tree76ea924a47f2bb58bb2caf5d5ae5464b7dbbab55 /include/linux/bpf.h
parenta40a26322a83d4a26a99ad2616cbd77394c19587 (diff)
bpf: do not pass netdev to translate() and prepare() offload callbacks
The kernel functions to prepare verifier and translate for offloaded program retrieve "offload" from "prog", and "netdev" from "offload". Then both "prog" and "netdev" are passed to the callbacks. Simplify this by letting the drivers retrieve the net device themselves from the offload object attached to prog - if they need it at all. There is currently no need to pass the netdev as an argument to those functions. 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/linux/bpf.h')
-rw-r--r--include/linux/bpf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 888111350d0e..987815152629 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -268,8 +268,8 @@ struct bpf_prog_offload_ops {
int (*insn_hook)(struct bpf_verifier_env *env,
int insn_idx, int prev_insn_idx);
int (*finalize)(struct bpf_verifier_env *env);
- int (*prepare)(struct net_device *netdev, struct bpf_prog *prog);
- int (*translate)(struct net_device *netdev, struct bpf_prog *prog);
+ int (*prepare)(struct bpf_prog *prog);
+ int (*translate)(struct bpf_prog *prog);
void (*destroy)(struct bpf_prog *prog);
};