summaryrefslogtreecommitdiffstats
path: root/arch/sparc/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2014-09-16 21:35:35 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-19 21:34:40 +0200
commit709f6c58d4dcd2b300c914ec17b297acae4cb998 (patch)
treee5396d29661ade147a75db7acf39f68f1e2cb25c /arch/sparc/net/bpf_jit_comp.c
parentnet: fec: fix build error at m68k platform (diff)
downloadlinux-709f6c58d4dcd2b300c914ec17b297acae4cb998.tar.xz
linux-709f6c58d4dcd2b300c914ec17b297acae4cb998.zip
sparc: bpf_jit: add SKF_AD_PKTTYPE support to JIT
commit 233577a22089 ("net: filter: constify detection of pkt_type_offset") allows us to implement simple PKTTYPE support in sparc JIT Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/net/bpf_jit_comp.c')
-rw-r--r--arch/sparc/net/bpf_jit_comp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index b2ad9dc5425e..2dde48bdcc42 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -579,16 +579,11 @@ void bpf_jit_compile(struct bpf_prog *fp)
case BPF_ANC | SKF_AD_PROTOCOL:
emit_skb_load16(protocol, r_A);
break;
-#if 0
- /* GCC won't let us take the address of
- * a bit field even though we very much
- * know what we are doing here.
- */
case BPF_ANC | SKF_AD_PKTTYPE:
- __emit_skb_load8(pkt_type, r_A);
+ __emit_skb_load8(__pkt_type_offset, r_A);
+ emit_andi(r_A, PKT_TYPE_MAX, r_A);
emit_alu_K(SRL, 5);
break;
-#endif
case BPF_ANC | SKF_AD_IFINDEX:
emit_skb_loadptr(dev, r_A);
emit_cmpi(r_A, 0);