Skip to content

Commit b7d9923

Browse files
Jakub Kicinskiborkmann
authored andcommitted
nfp: bpf: fix immed relocation for larger offsets
Immed relocation is missing a shift which means for larger offsets the lower and higher part of the address would be ORed together. Fixes: ce4ebfd ("nfp: bpf: add helpers for updating immediate instructions") Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Jiong Wang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 035d808 commit b7d9923

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/netronome/nfp/nfp_asm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ u16 immed_get_value(u64 instr)
107107
if (!unreg_is_imm(reg))
108108
reg = FIELD_GET(OP_IMMED_B_SRC, instr);
109109

110-
return (reg & 0xff) | FIELD_GET(OP_IMMED_IMM, instr);
110+
return (reg & 0xff) | FIELD_GET(OP_IMMED_IMM, instr) << 8;
111111
}
112112

113113
void immed_set_value(u64 *instr, u16 immed)

0 commit comments

Comments
 (0)