nfp: bpf: relax prog rejection through max_pkt_offset
authorJiong Wang <jiong.wang@netronome.com>
Thu, 8 Nov 2018 09:08:43 +0000 (04:08 -0500)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 9 Nov 2018 08:16:32 +0000 (09:16 +0100)
commitcf599f50311dd4a5d3b5fc427beb9303dfa6be4b
treed89f4a220e92ba787649adc101d2e7861791539d
parente647815a4d3b3be9d85b5750ed0f2947fd78fac7
nfp: bpf: relax prog rejection through max_pkt_offset

NFP is refusing to offload programs whenever the MTU is set to a value
larger than the max packet bytes that fits in NFP Cluster Target Memory
(CTM). However, a eBPF program doesn't always need to access the whole
packet data.

Verifier has always calculated maximum direct packet access (DPA) offset,
and kept it in max_pkt_offset inside prog auxiliar information. This patch
relax prog rejection based on max_pkt_offset.

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/offload.c