bpf: do not pass netdev to translate() and prepare() offload callbacks
authorQuentin Monnet <quentin.monnet@netronome.com>
Fri, 9 Nov 2018 13:03:32 +0000 (13:03 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 10 Nov 2018 23:39:54 +0000 (15:39 -0800)
commit16a8cb5cffd0a2929ae97bc258d2d9c92a4e7f6d
tree76ea924a47f2bb58bb2caf5d5ae5464b7dbbab55
parenta40a26322a83d4a26a99ad2616cbd77394c19587
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>
drivers/net/ethernet/netronome/nfp/bpf/offload.c
drivers/net/netdevsim/bpf.c
include/linux/bpf.h
kernel/bpf/offload.c