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        "setup": [
215            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
216            "$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",
217            "./taprio_wait_for_admin.sh $TC $ETH"
218        ],
219        "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",
220        "expExitCode": "2",
221        "verifyCmd": "bash -c \"./taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
222        "matchPattern": "0",
223        "matchCount": "1",
224        "teardown": [
225            "$TC qdisc del dev $ETH root",
226            "echo \"1\" > /sys/bus/netdevsim/del_device"
227        ]
228    },
229    {
230        "id": "e8a1",
231        "name": "Reject grafting taprio as child qdisc of offloaded taprio",
232        "category": [
233            "qdisc",
234            "taprio"
235        ],
236        "plugins": {
237            "requires": "nsPlugin"
238        },
239        "setup": [
240            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
241            "$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",
242            "./taprio_wait_for_admin.sh $TC $ETH"
243        ],
244        "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",
245        "expExitCode": "2",
246        "verifyCmd": "bash -c \"./taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
247        "matchPattern": "0",
248        "matchCount": "1",
249        "teardown": [
250            "$TC qdisc del dev $ETH root",
251            "echo \"1\" > /sys/bus/netdevsim/del_device"
252        ]
253    },
254    {
255        "id": "a7bf",
256        "name": "Graft cbs as child of software taprio",
257        "category": [
258            "qdisc",
259            "taprio",
260            "cbs"
261        ],
262        "plugins": {
263            "requires": "nsPlugin"
264        },
265        "setup": [
266            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
267            "$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"
268        ],
269        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
270        "expExitCode": "0",
271        "verifyCmd": "$TC -d qdisc show dev $ETH",
272        "matchPattern": "qdisc cbs 8002: parent 8001:8 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
273        "matchCount": "1",
274        "teardown": [
275            "$TC qdisc del dev $ETH root",
276            "echo \"1\" > /sys/bus/netdevsim/del_device"
277        ]
278    },
279    {
280        "id": "6a83",
281        "name": "Graft cbs as child of offloaded taprio",
282        "category": [
283            "qdisc",
284            "taprio",
285            "cbs"
286        ],
287        "plugins": {
288            "requires": "nsPlugin"
289        },
290        "setup": [
291            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
292            "$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"
293        ],
294        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
295        "expExitCode": "0",
296        "verifyCmd": "$TC -d qdisc show dev $ETH",
297        "matchPattern": "qdisc cbs 8002: parent 8001:8 refcnt 2 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
298        "matchCount": "1",
299        "teardown": [
300            "$TC qdisc del dev $ETH root",
301            "echo \"1\" > /sys/bus/netdevsim/del_device"
302        ]
303    }
304]
305