Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340652
b: refs/heads/master
c: 54e7e2d
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Nov 6, 2012
1 parent d139d83 commit 56513c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d64ec841517a25f6d468bde9f67e5b4cffdc67c7
refs/heads/master: 54e7e2df3e2f854ae33015cec25da5190e6a18ac
19 changes: 19 additions & 0 deletions trunk/arch/sparc/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <linux/netdevice.h>
#include <linux/filter.h>
#include <linux/cache.h>
#include <linux/if_vlan.h>

#include <asm/cacheflush.h>
#include <asm/ptrace.h>
Expand Down Expand Up @@ -312,6 +313,12 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \
#define emit_addi(R1, IMM, R3) \
*prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3))

#define emit_and(R1, R2, R3) \
*prog++ = (AND | RS1(R1) | RS2(R2) | RD(R3))

#define emit_andi(R1, IMM, R3) \
*prog++ = (AND | IMMED | RS1(R1) | S13(IMM) | RD(R3))

#define emit_alloc_stack(SZ) \
*prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP))

Expand Down Expand Up @@ -415,6 +422,8 @@ void bpf_jit_compile(struct sk_filter *fp)
case BPF_S_ANC_IFINDEX:
case BPF_S_ANC_MARK:
case BPF_S_ANC_RXHASH:
case BPF_S_ANC_VLAN_TAG:
case BPF_S_ANC_VLAN_TAG_PRESENT:
case BPF_S_ANC_CPU:
case BPF_S_ANC_QUEUE:
case BPF_S_LD_W_ABS:
Expand Down Expand Up @@ -600,6 +609,16 @@ void bpf_jit_compile(struct sk_filter *fp)
case BPF_S_ANC_RXHASH:
emit_skb_load32(rxhash, r_A);
break;
case BPF_S_ANC_VLAN_TAG:
case BPF_S_ANC_VLAN_TAG_PRESENT:
emit_skb_load16(vlan_tci, r_A);
if (filter[i].code == BPF_S_ANC_VLAN_TAG) {
emit_andi(r_A, VLAN_VID_MASK, r_A);
} else {
emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
emit_and(r_A, r_TMP, r_A);
}
break;

case BPF_S_LD_IMM:
emit_loadimm(K, r_A);
Expand Down

0 comments on commit 56513c9

Please sign in to comment.