]> asedeno.scripts.mit.edu Git - linux.git/commit
nfp: bpf: optimize comparisons to negative constants
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 25 Apr 2018 04:22:39 +0000 (21:22 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 25 Apr 2018 07:56:10 +0000 (09:56 +0200)
commit7bdc97be9075c074be0f0aa9c59a8d2238224743
tree16281ac7de8247d60c728a93b7db5bc92a1e74ca
parent61dd8f0007799e88d35624f63e24e98a978df9d9
nfp: bpf: optimize comparisons to negative constants

Comparison instruction requires a subtraction.  If the constant
is negative we are more likely to fit it into a NFP instruction
directly if we change the sign and use addition.

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.h