sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions
Subsystems (5)
PATCH 1/1 sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions
BPF_LD | BPF_W | BPF_LEN instruction is occasionally used by tcpdump and present in 11 tests in lib/test_bpf.c
Teach sparc JIT compiler to emit it.
Signed-off-by Alexei Starovoitov <[email protected]>
---
coupled with pending net fix test_bpf still comes out clean on sparc64. compile tested only on sparc32
Though both patches touch the same file, there should be no conflicts between net and net-next.
arch/sparc/net/bpf_jit_comp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/sparc/net/bpf_jit_comp.c +6 -1
@@ -624,7 +624,12 @@ void bpf_jit_compile(struct bpf_prog *fp)emit_and (r_A, r_TMP, r_A); }break ; - +case BPF_LD |BPF_W |BPF_LEN : +emit_skb_load32 (len, r_A); +break ; +case BPF_LDX |BPF_W |BPF_LEN : +emit_skb_load32 (len, r_X); +break ;case BPF_LD |BPF_IMM :emit_loadimm (K , r_A);break ;
Signature · 1 line
1.7.9.5
From: Alexei Starovoitov <[email protected]>
Date: Tue, 23 Sep 2014 14:36:11 -0700
Quoted 5 lines
BPF_LD|BPF_W|BPF_LENinstruction is occasionally used by tcpdump and present in 11 tests inlib/test_bpf.c
Teach sparc JIT compiler to emit it.Signed-off-by Alexei Starovoitov <[email protected]>
Applied, thanks Alexei.