xref: /linux/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json (revision 6d9b262afe0ec1d6e0ef99321ca9d6b921310471)
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": "3e1e",
137        "name": "Add taprio Qdisc with an invalid cycle-time",
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            "$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",
148            "$IP link set dev $ETH up",
149            "$IP addr add 10.10.10.10/24 dev $ETH"
150        ],
151        "cmdUnderTest": "/bin/true",
152        "expExitCode": "0",
153        "verifyCmd": "$TC qdisc show dev $ETH",
154        "matchPattern": "qdisc taprio 1: root refcnt",
155        "matchCount": "0",
156        "teardown": [
157            "echo \"1\" > /sys/bus/netdevsim/del_device"
158        ]
159    },
160    {
161        "id": "39b4",
162        "name": "Reject grafting taprio as child qdisc of software taprio",
163        "category": [
164            "qdisc",
165            "taprio"
166        ],
167        "plugins": {
168            "requires": "nsPlugin"
169        },
170        "dependsOn": "echo '' | jq",
171        "setup": [
172            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
173            "$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",
174            "./scripts/taprio_wait_for_admin.sh $TC $ETH"
175        ],
176        "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",
177        "expExitCode": "2",
178        "verifyCmd": "bash -c \"./scripts/taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
179        "matchPattern": "0",
180        "matchCount": "1",
181        "teardown": [
182            "$TC qdisc del dev $ETH root",
183            "echo \"1\" > /sys/bus/netdevsim/del_device"
184        ]
185    },
186    {
187        "id": "e8a1",
188        "name": "Reject grafting taprio as child qdisc of offloaded taprio",
189        "category": [
190            "qdisc",
191            "taprio"
192        ],
193        "plugins": {
194            "requires": "nsPlugin"
195        },
196        "dependsOn": "echo '' | jq",
197        "setup": [
198            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
199            "$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",
200            "./scripts/taprio_wait_for_admin.sh $TC $ETH"
201        ],
202        "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",
203        "expExitCode": "2",
204        "verifyCmd": "bash -c \"./scripts/taprio_wait_for_admin.sh $TC $ETH && $TC -j qdisc show dev $ETH root | jq '.[].options.base_time'\"",
205        "matchPattern": "0",
206        "matchCount": "1",
207        "teardown": [
208            "$TC qdisc del dev $ETH root",
209            "echo \"1\" > /sys/bus/netdevsim/del_device"
210        ]
211    },
212    {
213        "id": "a7bf",
214        "name": "Graft cbs as child of software taprio",
215        "category": [
216            "qdisc",
217            "taprio",
218            "cbs"
219        ],
220        "plugins": {
221            "requires": "nsPlugin"
222        },
223        "setup": [
224            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
225            "$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"
226        ],
227        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
228        "expExitCode": "0",
229        "verifyCmd": "$TC -d qdisc show dev $ETH",
230        "matchPattern": "qdisc cbs 8002: parent 8001:8 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
231        "matchCount": "1",
232        "teardown": [
233            "$TC qdisc del dev $ETH root",
234            "echo \"1\" > /sys/bus/netdevsim/del_device"
235        ]
236    },
237    {
238        "id": "6a83",
239        "name": "Graft cbs as child of offloaded taprio",
240        "category": [
241            "qdisc",
242            "taprio",
243            "cbs"
244        ],
245        "plugins": {
246            "requires": "nsPlugin"
247        },
248        "setup": [
249            "echo \"1 1 8\" > /sys/bus/netdevsim/new_device",
250            "$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"
251        ],
252        "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470",
253        "expExitCode": "0",
254        "verifyCmd": "$TC -d qdisc show dev $ETH",
255        "matchPattern": "qdisc cbs 8002: parent 8001:8 refcnt 2 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0",
256        "matchCount": "1",
257        "teardown": [
258            "$TC qdisc del dev $ETH root",
259            "echo \"1\" > /sys/bus/netdevsim/del_device"
260        ]
261    }
262]
263