File tree Expand file tree Collapse file tree 7 files changed +11
-113
lines changed
tools/testing/selftests/tc-testing Expand file tree Collapse file tree 7 files changed +11
-113
lines changed Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: GPL-2.0
2
- include ../../../scripts/Makefile.include
3
2
4
- top_srcdir = $(abspath ../../../..)
5
- APIDIR := $(top_scrdir ) /include/uapi
6
- TEST_GEN_FILES = action.o
3
+ TEST_PROGS += ./tdc.sh
4
+ TEST_FILES := action-ebpf tdc*.py Tdc*.py plugins plugin-lib tc-tests scripts
7
5
8
6
include ../lib.mk
9
-
10
- PROBE := $(shell $(LLC ) -march=bpf -mcpu=probe -filetype=null /dev/null 2>&1)
11
-
12
- ifeq ($(PROBE ) ,)
13
- CPU ?= probe
14
- else
15
- CPU ?= generic
16
- endif
17
-
18
- CLANG_SYS_INCLUDES := $(shell $(CLANG ) -v -E - </dev/null 2>&1 \
19
- | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.* \) |-idirafter \1|p }')
20
-
21
- CLANG_FLAGS = -I. -I$(APIDIR ) \
22
- $(CLANG_SYS_INCLUDES ) \
23
- -Wno-compare-distinct-pointer-types
24
-
25
- $(OUTPUT ) /% .o : % .c
26
- $(CLANG ) $(CLANG_FLAGS ) \
27
- -O2 --target=bpf -emit-llvm -c $< -o - | \
28
- $(LLC ) -march=bpf -mcpu=$(CPU ) $(LLC_FLAGS ) -filetype=obj -o $@
29
-
30
- TEST_PROGS += ./tdc.sh
31
- TEST_FILES := tdc*.py Tdc*.py plugins plugin-lib tc-tests scripts
Original file line number Diff line number Diff line change @@ -195,8 +195,6 @@ directory:
195
195
and the other is a test whether the command leaked memory or not.
196
196
(This one is a preliminary version, it may not work quite right yet,
197
197
but the overall template is there and it should only need tweaks.)
198
- - buildebpfPlugin.py:
199
- builds all programs in $EBPFDIR.
200
198
201
199
202
200
ACKNOWLEDGEMENTS
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 54
54
" actions" ,
55
55
" bpf"
56
56
],
57
- "plugins" : {
58
- "requires" : " buildebpfPlugin"
59
- },
60
57
"setup" : [
61
58
[
62
59
" $TC action flush action bpf" ,
65
62
255
66
63
]
67
64
],
68
- "cmdUnderTest" : " $TC action add action bpf object-file $EBPFDIR/action.o section action-ok index 667" ,
65
+ "cmdUnderTest" : " $TC action add action bpf object-file $EBPFDIR/action-ebpf section action-ok index 667" ,
69
66
"expExitCode" : " 0" ,
70
67
"verifyCmd" : " $TC action get action bpf index 667" ,
71
- "matchPattern" : " action order [0-9]*: bpf action.o :\\ [action-ok\\ ] id [0-9].* tag [0-9a-f]{16}( jited)? default-action pipe.*index 667 ref" ,
68
+ "matchPattern" : " action order [0-9]*: bpf action-ebpf :\\ [action-ok\\ ] id [0-9].* tag [0-9a-f]{16}( jited)? default-action pipe.*index 667 ref" ,
72
69
"matchCount" : " 1" ,
73
70
"teardown" : [
74
71
" $TC action flush action bpf"
81
78
" actions" ,
82
79
" bpf"
83
80
],
84
- "plugins" : {
85
- "requires" : " buildebpfPlugin"
86
- },
87
81
"setup" : [
88
82
[
89
83
" $TC action flush action bpf" ,
92
86
255
93
87
]
94
88
],
95
- "cmdUnderTest" : " $TC action add action bpf object-file $EBPFDIR/action.o section action-ko index 667" ,
89
+ "cmdUnderTest" : " $TC action add action bpf object-file $EBPFDIR/action-ebpf section action-ko index 667" ,
96
90
"expExitCode" : " 255" ,
97
91
"verifyCmd" : " $TC action get action bpf index 667" ,
98
- "matchPattern" : " action order [0-9]*: bpf action.o :\\ [action-ko\\ ] id [0-9].*index 667 ref" ,
92
+ "matchPattern" : " action order [0-9]*: bpf action-ebpf :\\ [action-ko\\ ] id [0-9].*index 667 ref" ,
99
93
"matchCount" : " 0" ,
100
94
"teardown" : [
101
95
[
Original file line number Diff line number Diff line change 52
52
],
53
53
"plugins" : {
54
54
"requires" : [
55
- " buildebpfPlugin" ,
56
55
" nsPlugin"
57
56
]
58
57
},
59
58
"setup" : [
60
59
" $TC qdisc add dev $DEV1 ingress"
61
60
],
62
- "cmdUnderTest" : " $TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf object-file $EBPFDIR/action.o section action-ok" ,
61
+ "cmdUnderTest" : " $TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf object-file $EBPFDIR/action-ebpf section action-ok" ,
63
62
"expExitCode" : " 0" ,
64
63
"verifyCmd" : " $TC filter get dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf" ,
65
- "matchPattern" : " filter parent ffff: protocol ip pref 100 bpf chain [0-9]+ handle 0x1 action.o :\\ [action-ok\\ ].*tag [0-9a-f]{16}( jited)?" ,
64
+ "matchPattern" : " filter parent ffff: protocol ip pref 100 bpf chain [0-9]+ handle 0x1 action-ebpf :\\ [action-ok\\ ].*tag [0-9a-f]{16}( jited)?" ,
66
65
"matchCount" : " 1" ,
67
66
"teardown" : [
68
67
" $TC qdisc del dev $DEV1 ingress"
77
76
],
78
77
"plugins" : {
79
78
"requires" : [
80
- " buildebpfPlugin" ,
81
79
" nsPlugin"
82
80
]
83
81
},
84
82
"setup" : [
85
83
" $TC qdisc add dev $DEV1 ingress"
86
84
],
87
- "cmdUnderTest" : " $TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf object-file $EBPFDIR/action.o section action-ko" ,
85
+ "cmdUnderTest" : " $TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf object-file $EBPFDIR/action-ebpf section action-ko" ,
88
86
"expExitCode" : " 1" ,
89
87
"verifyCmd" : " $TC filter get dev $DEV1 parent ffff: handle 1 protocol ip prio 100 bpf" ,
90
- "matchPattern" : " filter parent ffff: protocol ip pref 100 bpf chain [0-9]+ handle 0x1 action.o :\\ [action-ko\\ ].*tag [0-9a-f]{16}( jited)?" ,
88
+ "matchPattern" : " filter parent ffff: protocol ip pref 100 bpf chain [0-9]+ handle 0x1 action-ebpf :\\ [action-ko\\ ].*tag [0-9a-f]{16}( jited)?" ,
91
89
"matchCount" : " 0" ,
92
90
"teardown" : [
93
91
" $TC qdisc del dev $DEV1 ingress"
Original file line number Diff line number Diff line change @@ -64,5 +64,5 @@ try_modprobe sch_hfsc
64
64
try_modprobe sch_hhf
65
65
try_modprobe sch_htb
66
66
try_modprobe sch_teql
67
- ./tdc.py -J` nproc` -c actions --nobuildebpf
67
+ ./tdc.py -J` nproc` -c actions
68
68
./tdc.py -J` nproc` -c qdisc
You can’t perform that action at this time.
0 commit comments