Skip to content

Commit 71c1902

Browse files
Jiong Wangborkmann
authored andcommitted
nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K
The intended optimization should be A ^ 0 = A, not A ^ -1 = A. Fixes: cd7df56 ("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>
1 parent 7c0cdf0 commit 71c1902

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/netronome/nfp/bpf

1 file changed

+1
-1
lines changed

drivers/net/ethernet/netronome/nfp/bpf/jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ static int xor_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
23092309

23102310
static int xor_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
23112311
{
2312-
return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !~meta->insn.imm);
2312+
return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !meta->insn.imm);
23132313
}
23142314

23152315
static int and_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)

0 commit comments

Comments
 (0)