]> 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)
commit83b62982536f8b52294034faec26ab8f10f22f0c
tree9e39ff8b4c1120de94be934dc32e7b711d83645b
parent86b533e5c2ce7cf4a0b691f58155c7a89f355294
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