nfp: bpf: support arithmetic right shift by constant (BPF_ARSH | BPF_K)
authorJiong Wang <jiong.wang@netronome.com>
Fri, 18 May 2018 19:12:10 +0000 (12:12 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 18 May 2018 19:35:55 +0000 (21:35 +0200)
commitf43d0f17fe9a4bb770ab38b36e2b5150d8c3d6cf
tree8181906f9bec541e5f0bfe8a35edf4e215f272f4
parent991f5b3651f6bb1cb5034f422e43f489e65f2701
nfp: bpf: support arithmetic right shift by constant (BPF_ARSH | BPF_K)

Code logic is similar with logic right shift except we also need to set
PREV_ALU result properly, the MSB of which is the bit that will be
replicated to fill in all the vacant positions.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-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/nfp_asm.h