Skip to contentSkip to conversation

test_bpf: add 173 new testcases for eBPF

PATCH In review Alexei Starovoitov 2 participants 3 messages May 12, 2015 – May 13, 2015

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 test_bpf: add 173 new testcases for eBPF

From: Michael Holzheu <[email protected]>

add an exhaustive set of eBPF tests bringing total to:
test_bpf: Summary: 233 PASSED, 0 FAILED, [0/226 JIT'ed]

---
V1->V2: removed double 'From', added 'Ack'

these tests found div64 bug in interpreter (already fixed) and another cpu_to_be16 bug in x64 JIT (fix is being worked on).

 include/linux/filter.h |   10 +
 lib/test_bpf.c         | 2192 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 2202 insertions(+)
include/linux/filter.h +10 -0
index 3c03a6085b82..ce1d72d34382 100644
@@ -207,6 +207,16 @@ struct bpf_prog_aux;
 		.off   = OFF,					\
 		.imm   = 0 })
 
+/* Atomic memory add, *(uint *)(dst_reg + off16) += src_reg */
+
+#define BPF_STX_XADD(SIZE, DST, SRC, OFF)			\
+	((struct bpf_insn) {					\
+		.code  = BPF_STX | BPF_SIZE(SIZE) | BPF_XADD,	\
+		.dst_reg = DST,					\
+		.src_reg = SRC,					\
+		.off   = OFF,					\
+		.imm   = 0 })
+
 /* Memory store, *(uint *) (dst_reg + off16) = imm32 */
 
 #define BPF_ST_MEM(SIZE, DST, OFF, IMM)				\
lib/test_bpf.c +2192 -0

2,198 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

From: Alexei Starovoitov <[email protected]>
Date: Tue, 12 May 2015 08:38:16 -0700

Quoted 5 lines

From: Michael Holzheu <[email protected]>

add an exhaustive set of eBPF tests bringing total to:
test_bpf: Summary: 233 PASSED, 0 FAILED, [0/226 JIT'ed]

Quoted 8 lines

---
V1->V2: removed double 'From', added 'Ack'

these tests found div64 bug in interpreter (already fixed) and another cpu_to_be16 bug in x64 JIT (fix is being worked on).

Sorry, I applied V1 of this, and in fact I removed the double From:
when I applied it.

I hope this is ok.

#2 lore raw
Quoted 14 lines · David Miller

From: Alexei Starovoitov <[email protected]>
Date: Tue, 12 May 2015 08:38:16 -0700

Quoted 11 lines

From: Michael Holzheu <[email protected]>

add an exhaustive set of eBPF tests bringing total to:
test_bpf: Summary: 233 PASSED, 0 FAILED, [0/226 JIT'ed]

---
V1->V2: removed double 'From', added 'Ack'

Quoted 7 lines
Quoted 2 lines

these tests found div64 bug in interpreter (already fixed) and another cpu_to_be16 bug in x64 JIT (fix is being worked on).

Sorry, I applied V1 of this, and in fact I removed the double From:
when I applied it.

I hope this is ok.

yes. thanks a lot!