Skip to content

Commit

Permalink
sparc: bpf_jit: add support for BPF_LD(X) | BPF_LEN instructions
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Alexei Starovoitov authored and davem330 committed Sep 26, 2014
1 parent 0a29b3d commit cec0831
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/sparc/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cec0831

Please sign in to comment.