]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbb56d0f177c5f0f621873e80ae848508f707150c
tree76ea924a47f2bb58bb2caf5d5ae5464b7dbbab55
parentc49ebb4f8374bccc141e3c0315fd5fc568d67caf
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