]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: bpf: optimize the adjust_head calls in trivial cases
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 15 Dec 2017 05:29:19 +0000 (21:29 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Dec 2017 13:18:18 +0000 (14:18 +0100)
commitaf3267560b3f268555aad1a56aeb96ebfc9f0faf
tree6d28e0c7a5cb126f044cf45b9d1b6dff876fc53f
parent0db9dfbdf46ff529343ee4bf33bc110eafbdd5ac
nfp: bpf: optimize the adjust_head calls in trivial cases

If the program is simple and has only one adjust head call
with constant parameters, we can check that the call will
always succeed at translation time.  We need to track the
location of the call and make sure parameters are always
the same.  We also have to check the parameters against
datapath constraints and ETH_HLEN.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
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