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