nfp: bpf: allow control message sizing for map ops
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 2 Oct 2018 01:30:34 +0000 (18:30 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 2 Oct 2018 12:39:59 +0000 (14:39 +0200)
commit0c9864c05f34b0b29109dc5f94707e5943fcfda3
treecf6d33223aaf040bbca061a7b37ca2e0469811ea
parent9bbdd41b8a458d8a0bf1d9096bc1e704c7b46a00
nfp: bpf: allow control message sizing for map ops

In current ABI the size of the messages carrying map elements was
statically defined to at most 16 words of key and 16 words of value
(NFP word is 4 bytes).  We should not make this assumption and use
the max key and value sizes from the BPF capability instead.

To make sure old kernels don't get surprised with larger (or smaller)
messages bump the FW ABI version to 3 when key/value size is different
than 16 words.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
drivers/net/ethernet/netronome/nfp/bpf/fw.h
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h