summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2014-09-23 23:36:11 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-26 22:52:09 +0200
commitcec08315190a4461a369d47041a510d104a5d2a2 (patch)
treea117d1ff3c707fe9d1d6477bb0459951ac38d487
parentnet: bcmgenet: Fix compile warning (diff)
downloadlinux-cec08315190a4461a369d47041a510d104a5d2a2.tar.xz
linux-cec08315190a4461a369d47041a510d104a5d2a2.zip
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 <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc/net/bpf_jit_comp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index c1c60c32f6dd..f33e7c7a3bf7 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -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;