nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K
authorJiong Wang <jiong.wang@netronome.com>
Fri, 22 Feb 2019 22:36:03 +0000 (22:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:51 +0000 (20:09 +0100)
commit7ca1faa52be70fd08ba08b8c4039c06c944d45de
tree33caf55330f6169287542bd227521716b6a8c3f4
parent4523507c52b8a4125fa0a2c7e4e423b3e566426b
nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K

[ Upstream commit 71c190249f0ced5b26377ea6bf829ab3af77a40c ]

The intended optimization should be A ^ 0 = A, not A ^ -1 = A.

Fixes: cd7df56ed3e6 ("nfp: add BPF to NFP code translator")
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/bpf/jit.c