linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/4] lib/test_bpf: Fix JMP_JSET tests
@ 2016-04-05 10:02 Naveen N. Rao
  2016-04-05 10:02 ` [PATCH net 2/4] lib/test_bpf: Add tests for unsigned BPF_JGT Naveen N. Rao
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Naveen N. Rao @ 2016-04-05 10:02 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev, netdev
  Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
	Ananth N Mavinakayanahalli, Michael Ellerman, Paul Mackerras

JMP_JSET tests incorrectly used BPF_JNE. Fix the same.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 lib/test_bpf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 27a7a26..e76fa4d 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -4303,7 +4303,7 @@ static struct bpf_test tests[] = {
 		.u.insns_int = {
 			BPF_ALU32_IMM(BPF_MOV, R0, 0),
 			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JNE, R1, 2, 1),
+			BPF_JMP_IMM(BPF_JSET, R1, 2, 1),
 			BPF_EXIT_INSN(),
 			BPF_ALU32_IMM(BPF_MOV, R0, 1),
 			BPF_EXIT_INSN(),
@@ -4317,7 +4317,7 @@ static struct bpf_test tests[] = {
 		.u.insns_int = {
 			BPF_ALU32_IMM(BPF_MOV, R0, 0),
 			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JNE, R1, 0xffffffff, 1),
+			BPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1),
 			BPF_EXIT_INSN(),
 			BPF_ALU32_IMM(BPF_MOV, R0, 1),
 			BPF_EXIT_INSN(),
@@ -4474,7 +4474,7 @@ static struct bpf_test tests[] = {
 			BPF_ALU32_IMM(BPF_MOV, R0, 0),
 			BPF_LD_IMM64(R1, 3),
 			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JNE, R1, R2, 1),
+			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
 			BPF_EXIT_INSN(),
 			BPF_ALU32_IMM(BPF_MOV, R0, 1),
 			BPF_EXIT_INSN(),
@@ -4489,7 +4489,7 @@ static struct bpf_test tests[] = {
 			BPF_ALU32_IMM(BPF_MOV, R0, 0),
 			BPF_LD_IMM64(R1, 3),
 			BPF_LD_IMM64(R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JNE, R1, R2, 1),
+			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
 			BPF_EXIT_INSN(),
 			BPF_ALU32_IMM(BPF_MOV, R0, 1),
 			BPF_EXIT_INSN(),
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-04-06 20:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 10:02 [PATCH net 1/4] lib/test_bpf: Fix JMP_JSET tests Naveen N. Rao
2016-04-05 10:02 ` [PATCH net 2/4] lib/test_bpf: Add tests for unsigned BPF_JGT Naveen N. Rao
2016-04-05 16:20   ` Alexei Starovoitov
2016-04-05 16:50     ` Naveen N. Rao
2016-04-05 19:34   ` Daniel Borkmann
2016-04-06 20:48   ` David Miller
2016-04-05 10:02 ` [PATCH net 3/4] lib/test_bpf: Add test to check for result of 32-bit add that overflows Naveen N. Rao
2016-04-05 16:21   ` Alexei Starovoitov
2016-04-05 19:36   ` Daniel Borkmann
2016-04-06 20:48   ` David Miller
2016-04-05 10:02 ` [PATCH net 4/4] lib/test_bpf: Add additional BPF_ADD tests Naveen N. Rao
2016-04-05 16:28   ` Alexei Starovoitov
2016-04-05 16:51     ` Naveen N. Rao
2016-04-05 19:48   ` Daniel Borkmann
2016-04-06 20:48   ` David Miller
2016-04-05 15:57 ` [PATCH net 1/4] lib/test_bpf: Fix JMP_JSET tests Alexei Starovoitov
2016-04-05 19:32 ` Daniel Borkmann
2016-04-06 20:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).