nfp: bpf: double check vNIC capabilities after object sharing
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 16 Oct 2018 22:19:10 +0000 (15:19 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 16 Oct 2018 22:23:58 +0000 (15:23 -0700)
commit44b6fed0c16ea0057292d57c381a31e8986fa7a7
tree84a63bce9d9e3affca45063d33dba59d3deb3ecc
parent527db74b71ee5a279f818aae51f2c26b4e5c7648
nfp: bpf: double check vNIC capabilities after object sharing

Program translation stage checks that program can be offloaded to
the netdev which was passed during the load (bpf_attr->prog_ifindex).
After program sharing was introduced, however, the netdev on which
program is loaded can theoretically be different, and therefore
we should recheck the program size and max stack size at load time.

This was found by code inspection, AFAIK today all vNICs have
identical caps.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c
drivers/net/ethernet/netronome/nfp/bpf/verifier.c