]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita8dcd07d221a7565befb0795d1a155e2740096f5
tree9e39ff8b4c1120de94be934dc32e7b711d83645b
parent2935e460af14c97d6d9200c538411f14e9165ecc
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