]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: bpf: xdp_adjust_tail support
authorJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 4 Aug 2018 05:06:00 +0000 (22:06 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 4 Aug 2018 19:58:12 +0000 (21:58 +0200)
commit03630e54f34ed5abc01068efa244a8f85124785d
tree430e93b2339610231eaa3f5e3236ff1723487d27
parent0c8ba20fd13ce36eec6092513a4b32e4a9cdfd89
nfp: bpf: xdp_adjust_tail support

Add support for adjust_tail.  There are no FW changes needed but add
a FW capability just in case there would be any issue with previously
released FW, or we will have to change the ABI in the future.

The helper is trivial and shouldn't be used too often so just inline
the body of the function.  We add the delta to locally maintained
packet length register and check for overflow, since add of negative
value must overflow if result is positive.  Note that if delta of 0
would be allowed in the kernel this trick stops working and we need
one more instruction to compare lengths before and after the change.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/fw.h
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/verifier.c
drivers/net/ethernet/netronome/nfp/nfp_asm.h