summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
blob: 0599635c4bc650d58a600d9409cbdd120c72bd8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
[
    {
        "id": "ba39",
        "name": "Add taprio Qdisc to multi-queue device (8 queues)",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
        ],
        "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 clockid CLOCK_TAI",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "qdisc taprio 1: root refcnt [0-9]+ tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2",
        "matchCount": "1",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "9462",
        "name": "Add taprio Qdisc with multiple sched-entry",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
        ],
        "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 sched-entry S 03 300000 sched-entry S 04 400000 flags 0x1 clockid CLOCK_TAI",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "index [0-9]+ cmd S gatemask 0x[0-9]+ interval [0-9]+00000",
        "matchCount": "3",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "8d92",
        "name": "Add taprio Qdisc with txtime-delay",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
        ],
        "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 txtime-delay 500000 clockid CLOCK_TAI",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "clockid TAI flags 0x1 txtime delay 500000",
        "matchCount": "1",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "d092",
        "name": "Delete taprio Qdisc with valid handle",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 clockid CLOCK_TAI"
        ],
        "cmdUnderTest": "$TC qdisc del dev $ETH root handle 1:",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "qdisc taprio 1: root refcnt",
        "matchCount": "0",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "8471",
        "name": "Show taprio class",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
        ],
        "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 clockid CLOCK_TAI",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $ETH",
        "matchPattern": "class taprio 1:[0-9]+ root",
        "matchCount": "8",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "0a85",
        "name": "Add taprio Qdisc to single-queue device",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1\" > /sys/bus/netdevsim/new_device"
        ],
        "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 clockid CLOCK_TAI",
        "expExitCode": "2",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "qdisc taprio 1: root refcnt",
        "matchCount": "0",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "3e1e",
        "name": "Add taprio Qdisc with an invalid cycle-time",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc add dev $ETH root handle 1: taprio num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@0 1@0 base-time 1000000000 sched-entry S 01 300000 flags 0x1 clockid CLOCK_TAI cycle-time 4294967296 || /bin/true",
            "$IP link set dev $ETH up",
            "$IP addr add 10.10.10.10/24 dev $ETH"
        ],
        "cmdUnderTest": "/bin/true",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $ETH",
        "matchPattern": "qdisc taprio 1: root refcnt",
        "matchCount": "0",
        "teardown": [
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "39b4",
        "name": "Reject grafting taprio as child qdisc of software taprio",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 clockid CLOCK_TAI",
            "./taprio_wait_for_admin.sh $TC $ETH"
        ],
        "cmdUnderTest": "$TC qdisc replace dev $ETH parent 8001:7 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 200 sched-entry S ff 20000000 clockid CLOCK_TAI",
        "expExitCode": "2",
        "verifyCmd": "bash -c \"./taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
        "matchPattern": "0",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $ETH root",
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "e8a1",
        "name": "Reject grafting taprio as child qdisc of offloaded taprio",
        "category": [
            "qdisc",
            "taprio"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 flags 0x2",
            "./taprio_wait_for_admin.sh $TC $ETH"
        ],
        "cmdUnderTest": "$TC qdisc replace dev $ETH parent 8001:7 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 200 sched-entry S ff 20000000 flags 0x2",
        "expExitCode": "2",
        "verifyCmd": "bash -c \"./taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
        "matchPattern": "0",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $ETH root",
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "a7bf",
        "name": "Graft cbs as child of software taprio",
        "category": [
            "qdisc",
            "taprio",
            "cbs"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 clockid CLOCK_TAI"
        ],
        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
        "expExitCode": "0",
        "verifyCmd": "$TC -d qdisc show dev $ETH",
        "matchPattern": "qdisc cbs 8002: parent 8001:8 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $ETH root",
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    },
    {
        "id": "6a83",
        "name": "Graft cbs as child of offloaded taprio",
        "category": [
            "qdisc",
            "taprio",
            "cbs"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
            "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 flags 0x2"
        ],
        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
        "expExitCode": "0",
        "verifyCmd": "$TC -d qdisc show dev $ETH",
        "matchPattern": "qdisc cbs 8002: parent 8001:8 refcnt 2 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $ETH root",
            "echo \"1\" > /sys/bus/netdevsim/del_device"
        ]
    }
]