summaryrefslogtreecommitdiff
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/bpf/offload.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
index 397d206e184b..52c5617e3716 100644
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@ -131,7 +131,7 @@ int bpf_prog_offload_verifier_prep(struct bpf_prog *prog)
down_read(&bpf_devs_lock);
offload = prog->aux->offload;
if (offload)
- ret = offload->offdev->ops->prepare(offload->netdev, prog);
+ ret = offload->offdev->ops->prepare(prog);
offload->dev_state = !ret;
up_read(&bpf_devs_lock);
@@ -203,7 +203,7 @@ static int bpf_prog_offload_translate(struct bpf_prog *prog)
down_read(&bpf_devs_lock);
offload = prog->aux->offload;
if (offload)
- ret = offload->offdev->ops->translate(offload->netdev, prog);
+ ret = offload->offdev->ops->translate(prog);
up_read(&bpf_devs_lock);
return ret;