]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: offload: factor out netdev checking at allocation time
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 12 Jan 2018 04:29:08 +0000 (20:29 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Sun, 14 Jan 2018 22:36:29 +0000 (23:36 +0100)
commit4ef05ede5f60798d24bb73bd766135bc2e2a4839
tree0c7ade6e8eb85c8508c44fb267e3991145e093a0
parent2d70645e44064be4a5bae62c34844de9826dc36b
bpf: offload: factor out netdev checking at allocation time

Add a helper to check if netdev could be found and whether it
has .ndo_bpf callback.  There is no need to check the callback
every time it's invoked, ndos can't reasonably be swapped for
a set without .ndp_bpf while program is loaded.

bpf_dev_offload_check() will also be used by map offload.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/offload.c