summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/bpf/main.h
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-10-17 01:19:10 +0300
committerAlexei Starovoitov <ast@kernel.org>2018-10-17 01:23:58 +0300
commit44b6fed0c16ea0057292d57c381a31e8986fa7a7 (patch)
tree84a63bce9d9e3affca45063d33dba59d3deb3ecc /drivers/net/ethernet/netronome/nfp/bpf/main.h
parent527db74b71ee5a279f818aae51f2c26b4e5c7648 (diff)
downloadlinux-44b6fed0c16ea0057292d57c381a31e8986fa7a7.tar.xz
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>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/bpf/main.h')
-rw-r--r--drivers/net/ethernet/netronome/nfp/bpf/main.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.h b/drivers/net/ethernet/netronome/nfp/bpf/main.h
index 12e98a0a58e5..7f591d71ab28 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/main.h
+++ b/drivers/net/ethernet/netronome/nfp/bpf/main.h
@@ -441,6 +441,7 @@ struct nfp_bpf_subprog_info {
* @prog: machine code
* @prog_len: number of valid instructions in @prog array
* @__prog_alloc_len: alloc size of @prog array
+ * @stack_size: total amount of stack used
* @verifier_meta: temporary storage for verifier's insn meta
* @type: BPF program type
* @last_bpf_off: address of the last instruction translated from BPF
@@ -465,6 +466,8 @@ struct nfp_prog {
unsigned int prog_len;
unsigned int __prog_alloc_len;
+ unsigned int stack_size;
+
struct nfp_insn_meta *verifier_meta;
enum bpf_prog_type type;