]> 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)
commita4a23275b13068307c8068a4586a56fdd3d61a56
tree76ea924a47f2bb58bb2caf5d5ae5464b7dbbab55
parent1ae420433878e3ed441bf829bbe588d4f93902e7
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