[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1403516340-22997-7-git-send-email-markos.chandras@imgtec.com>
Date: Mon, 23 Jun 2014 10:38:49 +0100
From: Markos Chandras <markos.chandras@...tec.com>
To: <linux-mips@...ux-mips.org>
CC: Markos Chandras <markos.chandras@...tec.com>,
"David S. Miller" <davem@...emloft.net>,
Daniel Borkmann <dborkman@...hat.com>,
"Alexei Starovoitov" <ast@...mgrid.com>, <netdev@...r.kernel.org>
Subject: [PATCH 06/17] MIPS: bpf: Use 'andi' instead of 'and' for the VLAN cases
The VLAN_VID_MASK and VLAN_TAG_PRESENT are immediates, so using
'and' which expects 3 registers will produce wrong results. Fix
this by using the 'andi' instruction.
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Daniel Borkmann <dborkman@...hat.com>
Cc: Alexei Starovoitov <ast@...mgrid.com>
Cc: netdev@...r.kernel.org
Signed-off-by: Markos Chandras <markos.chandras@...tec.com>
---
arch/mips/net/bpf_jit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 95728ea6cb74..fe5041bdc6fb 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -1317,9 +1317,9 @@ jmp_cmp:
off = offsetof(struct sk_buff, vlan_tci);
emit_half_load(r_s0, r_skb, off, ctx);
if (code == (BPF_ANC | SKF_AD_VLAN_TAG))
- emit_and(r_A, r_s0, VLAN_VID_MASK, ctx);
+ emit_andi(r_A, r_s0, VLAN_VID_MASK, ctx);
else
- emit_and(r_A, r_s0, VLAN_TAG_PRESENT, ctx);
+ emit_andi(r_A, r_s0, VLAN_TAG_PRESENT, ctx);
break;
case BPF_ANC | SKF_AD_PKTTYPE:
off = pkt_type_offset();
--
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists