nfp: bpf: relax prog rejection for mtu check through max_pkt_offset
authorYu Xiao <yu.xiao@corigine.com>
Thu, 28 Oct 2021 10:00:36 +0000 (12:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Oct 2021 11:59:32 +0000 (12:59 +0100)
commit90a881fc352a953f1c8beb61977a2db0818157d4
tree9e39ff8b4c1120de94be934dc32e7b711d83645b
parent9159f102402a64ac85e676b75cc1f9c62c5b4b73
nfp: bpf: relax prog rejection for mtu check through max_pkt_offset

MTU change is refused whenever the value of new MTU is bigger than
the max packet bytes that fits in NFP Cluster Target Memory (CTM).
However, an eBPF program doesn't always need to access the whole
packet data.

The maximum direct packet access (DPA) offset has always been
caculated by verifier and stored in the max_pkt_offset field of prog
aux data.

Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
Reviewed-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Reviewed-by: Niklas Soderlund <niklas.soderlund@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c