]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: offload: move offload device validation out to the drivers
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 20 Nov 2017 23:21:54 +0000 (15:21 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Nov 2017 23:37:35 +0000 (00:37 +0100)
commita9fd124f5f37c185ae0bc7677d0508f64dc866a7
tree9b8376e3af3c10bbbe144cae48ea5eb5bce8fa27
parent74bf29cd5fb971e17212a8e8f3441f1ede7c8036
bpf: offload: move offload device validation out to the drivers

With TC shared block changes we can't depend on correct netdev
pointer being available in cls_bpf.  Move the device validation
to the driver.  Core will only make sure that offloaded programs
are always attached in the driver (or in HW by the driver).  We
trust that drivers which implement offload callbacks will perform
necessary checks.

Moving the checks to the driver is generally a useful thing,
in practice the check should be against a switchdev instance,
not a netdev, given that most ASICs will probably allow using
the same program on many ports.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/offload.c
include/linux/bpf.h
kernel/bpf/syscall.c
net/core/dev.c
net/sched/cls_bpf.c