diff options
author | Quentin Monnet <quentin.monnet@netronome.com> | 2018-10-07 14:56:54 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-08 11:24:13 +0300 |
commit | bdf4c66faf5fa6fd5ffb0b59c39c7629103d6479 (patch) | |
tree | 0b8b6af330756c93b4cda35eb61fabe929b373f8 /drivers/net/ethernet/netronome/nfp/bpf/main.h | |
parent | fb1981654129e9c71af4c0f2782c5ffde8cbf37f (diff) | |
download | linux-bdf4c66faf5fa6fd5ffb0b59c39c7629103d6479.tar.xz |
nfp: bpf: update fixup function for BPF-to-BPF calls support
Relocation for targets of BPF-to-BPF calls are required at the end of
translation. Update the nfp_fixup_branches() function in that regard.
When checking that the last instruction of each bloc is a branch, we
must account for the length of the instructions required to pop the
return address from the stack.
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
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>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/bpf/main.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/bpf/main.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.h b/drivers/net/ethernet/netronome/nfp/bpf/main.h index d9695bc316dd..1cef5136c198 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.h +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.h @@ -283,6 +283,7 @@ struct nfp_bpf_reg_state { * @xadd_maybe_16bit: 16bit immediate is possible * @jmp_dst: destination info for jump instructions * @jump_neg_op: jump instruction has inverted immediate, use ADD instead of SUB + * @num_insns_after_br: number of insns following a branch jump, used for fixup * @func_id: function id for call instructions * @arg1: arg1 for call instructions * @arg2: arg2 for call instructions @@ -319,6 +320,7 @@ struct nfp_insn_meta { struct { struct nfp_insn_meta *jmp_dst; bool jump_neg_op; + u32 num_insns_after_br; /* only for BPF-to-BPF calls */ }; /* function calls */ struct { |