diff --git a/docs/netlink/gotc-status.md b/docs/netlink/gotc-status.md index 2c397b55f..822fe7474 100644 --- a/docs/netlink/gotc-status.md +++ b/docs/netlink/gotc-status.md @@ -1,6 +1,6 @@ # gotc (tc qdisc, class, filter, flower, chain and actions show): implementation status -**Last updated:** 2026-11-25 +**Last updated:** 2026-11-26 **Summary:** - The design and task plan are in [gotc.md](gotc.md); this document tracks progress @@ -176,6 +176,24 @@ a trigger could run during the dump and lose events. The recorded corpus is clean, and a corpus test now guards it. - `monitor file` reads records as they arrive, rather than at EOF. A read error returns -1, as tc's fread does, so it no longer ends a `-force` batch (V028). +- **Increment 15 (classful and scheduling qdisc kinds).** The plan: `qdisc show` and `class show` of drr, qfq, + hfsc, ets, mqprio, taprio, multiq, cbs and etf, the nine of the 22 refused kinds that schedule or hold classes. + Findings continue at Q37 and K24 in [upstream/iproute2-tc-sched.md](upstream/iproute2-tc-sched.md). The AQM and + leaf kinds (red, gred, choke, sfb, codel, pie, fq_pie, hhf, cake, cake_mq, dualpi2, plug, skbprio) are + increment 16. +- **15C (captures): done.** The `tcsched` space has 87 rows over twelve fixtures, every positive plain and `-j`. + mqprio, taprio and multiq run on an eight-queue dummy, and mqprio's rows show the root only, because its children + are the guest's default qdisc. Two batches on one boot agree on stdout, stderr and rc for all 87 rows. A batch that + repeated `root` hit tcqdisc's sticky root, so its last line is now a plain show (V029). +- **15P (parsers): done.** `pkg/xtcpnl/xtcpnl_tc_sched.go` decodes the nine kinds' options and xstats as their C + printers read them. `ParseTcCopt` is new: hfsc's and ets's class options differ from their qdisc's. Every tcsched, + tdc and earlier message of the nine kinds decodes (V030). +- **15R (printers): done.** gotc prints the nine kinds; all 87 tcsched rows replay byte for byte, and the tdc + readbacks of these kinds render, apart from 4 that also hold plug (V031). +- **15B (write-up): done.** `upstream/iproute2-tc-sched.md`: Q37–Q63 confirmed (none dropped), two new leads (Q64, + Q65), K24–K30 confirmed and corrected, K31 new; all present at HEAD. Not submitted to netdev (DOC008). +- **15L (live diff): done.** 83 of 87 tcsched rows identical live; the other four are the planned write refusals. + Live tc matched the corpus on all 87 (V032). **Increment 15 is complete.** ## Ledger @@ -217,6 +235,11 @@ | DOC007 | 14B | **Write-up:** `docs/netlink/upstream/iproute2-tc-monitor.md` (status header, reachability, contents, 16 summary rows, seven sections, K19–K23). Not submitted to netdev. **Leads:** read at v7.2.0 (`tc_monitor.c`, `tc.c`, the qdisc, class, filter and action printers, `libnetlink.c`, `ll_map.c`, `utils.c`) and against the tcmonitor corpus. **Confirmed in the corpus:** MO1 (ng-002), MO2 and MO3 (ec-018), MO4 (ec-010, ec-016), MO5 (ng-001; ec-012 fits), MO6 (ec-001), MO7 (ec-003), MO9 (ec-005, which also shows AC4 live and the two spaces of `Flushed table gact`), MO10 (ec-011), MO11 (ec-020), MO12 (ec-013's two RTM_GETLINK gets, one per unknown ifindex; none in ec-020, whose `qdisc show` had dumped the links), MO13 (ng-006, ng-007), MO14 (ng-003, ng-004). **Latent, unit rows:** MO8, MO15. **Corrected:** MO5's sweep said 4096 ops; tc's 16384-byte request bound stops it at 2041, so the rows use 2040 and 2038. **New:** MO16 (C16/C8): in a `-force` batch, `monitor file` on a missing file calls `exit(-1)` and ends the batch, while a truncated file returns -1, prints `Command failed` and goes on. Two new `TestGotcMonitorUnit` rows pin both (31 table rows now). gotc already reproduced it. **Kernel (v7.4-rc4):** K19 (qdisc_notify flags 0 or REPLACE, sch_api.c:1109-1116), K20 (DEL and NEW in one skb, :1104-1117), K21 (only filter events grow past NLMSG_GOODSIZE, cls_api.c:2138-2160), K22 (filter and action add events copy the request's flags and portid, cls_api.c:2147-2148, act_api.c:2151), K23 (`mall_change`'s `*arg = head`, cls_matchall.c:233, since fd62d9f5c575). **HEAD** (GitHub mirror `5d13122576d6`, `gh api .../commits?path=...&since=2026-08-17`): no commit touches `tc_monitor.c`, `tc.c`, the four printers or `ll_map.c`; `utils.c`'s three don't touch `print_timestamp` or `do_batch`. In `libnetlink.c`, `rtnl_from_file` is unchanged, and `rtnl_listen` (`9bfcf2480387`, `c6d58ffbb7f7`) keeps the 16384-byte buffer and `Truncated message`; only its bad-length text becomes `!!!Remnant of size N`. Every finding is present at HEAD. **Bug classes:** none new (MO15 and MO16 are C16). **Gates:** `go test ./internal/gotc/`. | | V027 | 14L | **Live diff** on the workbench (kernel 7.3.1, tc 7.2.0): `gotc` from `nix build .#gotc` at `4bfc37bb9` (`/nix/store/9dk3iipdfv1g42i7vfsrjkraw7rq20sz-gotc-0.2.1`) beside `tc` (`/nix/store/x1pwsbz5cm23hk58b7fcpn3hhg9j7gwh-iproute2-7.2.0`), with `GOTC_CONF_USR_DIR` set to tc's `share/iproute2`. The guest script is generated from `nix/microvms/workbench/tcmonitor.rows.jsonl`: the rows' modules are loaded once, then each row runs its pre steps in a fresh named namespace, in its own directory. **Live rows (13):** `tc ` and `gotc ` start together in the namespace; the script waits until `/proc/net/netlink` shows two NETLINK_ROUTE sockets with Groups bit 0x8, waits 0.5 s more so both link dumps are done, runs the row's trigger once, waits up to 10 s for the row's until-ERE in both outputs (ng-001: for both to exit), then sends SIGTERM to both. **Offline and refusal rows (14):** tc, then gotc, with stdin from /dev/null. **Result:** 27 of 27 identical on stdout, stderr and exit status once both stamp forms are masked. The live rows end 143 for both (SIGTERM; the capture helper reports 0); ng-001 is `Truncated message`, rc 2, for both (MO5); the refusals are 255 for both. **tc against the corpus:** the same as the capture except ec-003, where the kernel gave the changed filter's new gact index 3 rather than 1, and the offline rows, whose records' ifindexes name d0 and d1 here, where the capture namespace had nlmon0. gotc followed tc in both: MO11's batch still drops the other device's qdisc events and prints d0's without `dev`. **Pre-checks:** the workbench was down, so it was booted with `nix run .#nlcap-ws -- up` (63G available on the host); port 12061 was free; no other VM process; the fresh guest had no namespaces and no core files. **Cleanup:** the run added act_gact, act_mirred, cls_basic, cls_bpf, cls_fw, cls_matchall, sch_htb and sch_ingress, all removed with `modprobe -r`, leaving lsmod equal to the baseline. No namespaces, no core files, no monitor processes, `/tmp/t14l` removed. Only this session's ssh was connected, so the VM was powered off again with `down`, as found. | | V028 | 14V | **Review fixes (PR 348, two P2 findings at `0a1a7cf6`).** **1. Capture readiness race:** `xtcp2-nl-tcmon` counted the monitor ready once its socket showed Groups bit 0x8, but tc_monitor.c runs ll_init_map's link dump on that socket after the bind, and rtnl_dump_filter drops what is not the dump's. So a trigger run during the dump lost its first events, and the capture still passed if a later event matched the until-ERE. Ready now also needs the socket's Dump column 0 and Rmem 0, plus a monitor thread blocked in recvmsg(2) (`/proc//task/*/syscall`, 47 on x86_64, 212 on aarch64). tc makes no recvmsg before its dump request, and its dump reads only while a part is queued or running, so the three together mean rtnl_listen. A monitor that subscribes but never gets there is `the monitor never finished its link dump`, rc 1. The hermetic check gains `NLCAP_PROC` and `NLCAP_RECVMSG_NR`, and its fake drops events raised while it "dumps", as tc does. 4 new rows (14 now): positive, a slow dump is waited out and the event after it is seen; negative, a dump that never ends; boundary, a queued reply (Rmem 320); corner, blocked in a syscall other than recvmsg. Mutant (ready on Groups alone, the old helper) fails all 4. **Corpus:** none of the 13 live rows has a tc message before its dump's NLMSG_DONE, so the recorded captures did not hit the race and are kept. `TestGotcMonitorCorpus` now checks that for each live row (`checkTriggerAfterDump`); widening its window by one message makes it fail. V027's 14L diff waited a fixed 0.5 s instead and was not re-run. Its 27/27 match holds unless both tools lost the same event. **2. File reading:** `nlmon.ReadFile` read the whole file with `os.ReadFile` before walking it, so records from a pipe or a growing file were held back until EOF. Its read errors were also `ErrOpen`, which gotc maps to exit(-1); that ended a `-force` batch and printed `Cannot fopen: Is a directory` for a directory. tc's fopen succeeds on a directory, its fread fails, and rtnl_from_file prints `rtnl_from_file: fread: Is a directory` and returns -1. Now `ReadFile` opens the file, and the new `FromFile(io.Reader, fn)` replaces `WalkFile`. It is rtnl_from_file's loop: a header, then a padded body, into one reused 16384-byte buffer, each record handed on as read. A read failure is the new `ErrRead`, perror's text; EOF inside a record is `ErrFileTruncated`; ftell offsets are kept for malformed lengths. goip's `monitorReadFile` already sends every non-open error to ErrMonitorFile. **Checked against tc 7.2.0** on the host: `tc monitor file /` prints `rtnl_from_file: fread: Is a directory`, rc 255. Under `-force -batch` it prints that plus `Command failed -:1`, then the same for line 2, rc 1. gotc now matches both. **Tests:** `TestFromFile` (11 rows: adds a 16384-byte record, EIO between records after the one before, EIO inside a body as fread's error rather than truncated, and an error with no errno); `TestFromFileStreams` (a pipe whose writer sends record 2 only after fn has seen record 1; a reader that waits for EOF deadlocks); the `TestReadFile` directory row is now `ErrRead`; `TestGotcMonitorUnit` gains `monitor file /` (rc 255) and the `-force` batch going past it (rc 1), 33 rows. Mutant (read everything, then walk) fails `TestFromFile` and `TestFromFileStreams`. **Bench:** `BenchmarkFromFile` (was `BenchmarkWalkFile`), 1000 records: 28 ns/msg, 1 alloc (the buffer) per file. It was 13.5 ns/msg and 0 allocs over a slice that was already in memory; the copy is the cost of streaming. `TestAllocs` budget for the file row: 1. | +| V029 | 15C | **Captures** `tcsched`: `tools/nlcapgen/matrix_tcsched.go` (+ `TestTcSchedSpace`), rows in `nix/microvms/workbench/tcsched.rows.jsonl`, corpus in `pkg/xtcpnl/testdata/7_3_1/ws/tcsched/` (87 rows, 1.8M). Modules: sch_cbs, sch_drr, sch_etf, sch_ets, sch_hfsc, sch_mqprio, sch_multiq, sch_prio, sch_qfq, sch_taprio. **Fixtures:** `schdrr` (a class of quantum 1514, one at the default), `schqfq` (weights 1 and 30, maxpkt 1514 and 9000), `schhfsc` (default 10; sc+ul parent, rt≠ls child with m1/d/m2, rt=ls child), `schhfsc0` (no default), `schets` (bands 3 strict 1 quanta 1500 3000, a 3-entry priomap), `schets0` (strict 3), `schtsn` (a 2-band prio holding cbs and etf with skip_sock_check), and on `d1` with 8 tx queues `schmultiq`, `schmqprio` (num_tc 2, hw 0), `schtaprio` (flags 0x1, txtime-delay 200000, past base-time), `schtaprio2` (a past oper schedule with a far-future admin one replaced over it), `schtaprio3` (a future admin schedule only). **Commands:** `qdisc show` and `class show` per fixture, with `-s`, `-d`, `-o`, `-g`, `handle` and `classid` forms, and two batches (`qdisc-then-class`, `root-then-all`). **Negatives:** mqprio not at the root, cbs offload and etf offload (EOPNOTSUPP, named ENOTSUP in the rows, rc 2), taprio with no clockid (EINVAL, rc 2), `class show dev nosuch` (rc 1). The etf negative is an `add` on a drr class: a `replace` of an existing etf fails first with "Change operation not supported by specified qdisc." (EINVAL), because etf has no `.change`. Each fixture was tried first in an unprivileged netns on the host (tc 7.2.0, kernel 7.3.3). **Determinism:** two batches on one boot, 87/87 OK each, with stdout, stderr and rc identical for every row; all 87 pcaps differ, 4001 bytes in total, none in size. The pair was re-run after the negatives were corrected. A first pair of batches failed 2 of 87: the `root-then-all` batch repeated `root`, which tc rejects as "parent is already specified" (tcqdisc's sticky-root). Its last line is now `qdisc show dev d1`. **Confirmed live:** Q37/Q38 (drr quantum and deficit in text, absent in `-j`), Q40 (`refcnt 2 default 0x10`), Q42 (the blank `-s` line after `period 0 level N`), Q43 (rt=ls prints as `sc`), Q45 (trailing spaces), Q46 (a strict ets class prints no quantum), Q48–Q52 (mqprio's hard newlines, `mode:dcb`/`shaper:dcb` in software mode, 16 `fp` entries, `queues:(0:3) (4:7)`), Q55–Q58 (`txtime delay 200000`, `max-sdu`, the unlabelled admin schedule, the blank line), Q60 (`bands 8/8`), Q61/Q63 (cbs `"offload":0`, etf `skip_sock_check on` with no trailing space), K28 (an admin-only taprio has no max-sdu or fp). `-j -g class show` prints `[]` and then the text graph, to be checked against Q36 in 15B. | +| V030 | 15P | **Decoders** (`pkg/xtcpnl/xtcpnl_tc_sched.go`, cited to `include/uapi/linux/pkt_sched.h` at v7.4-rc4 and the `tc/q_*.c` printers at v7.2.0): the `TCA_{DRR,QFQ,HFSC,ETS,MQPRIO,TAPRIO,CBS,ETF}_*` constants with the mqprio and taprio tc-entry, sched-entry and offload-stats enums; structs `TcMultiqQopt` (4 bytes), `TcHfscQopt` (2), `TcServiceCurve` (12), `TcHfscStats` (24), `TcDrrStats` (4), `TcQfqStats` (8), `TcMqprioQopt` (82), `TcCbsQopt` (20), `TcEtfQopt` (12), each with its `Decode*`; nine `TcKind*` constants. `TcQopt.Sched` holds the results. `ParseTcQopt` covers the qdisc options; the new `ParseTcCopt` covers class options, because hfsc's (service curves) and ets's (`QUANTA_BAND`) differ from the qdisc's, and it hands every other kind to `ParseTcQopt`. `ParseTcXstats` decodes drr's and hfsc's class xstats and taprio's offload-stats nest; qfq, ets, mqprio, multiq, cbs and etf have no print_xstats, so `Has` is false for them. **Kept as C reads them:** taprio's `TXTIME_DELAY` read as s32 (Q55); ets's quanta and priomap walks, which at each offset take the first band attribute from there to the end and step by `rta_len` (+3 for the priomap); mqprio needs `RTA_ALIGN(sizeof)` = 84 bytes, so an 82-byte header alone is "options size error"; mqprio's mode and shaper are read only when attributes follow the header, and its rate lists are read with `parse_rtattr` (no flag masked), since the kernel sends them with `nla_nest_start_noflag`; tc-entry walks skip an entry with no index or an index of 16 or more, but a present index, `MAX_SDU` or `FP` shorter than a u32 is `ErrTcShort` (tc reads past it and gotc refuses it), checked before its slot or highest-index marker is set (PR 351 review); a truncated hfsc curve is skipped, as tc warns and goes on; multiq shorter than its struct prints nothing, so it is not an error. **Changed from C:** mqprio's rate lists stop at 16 entries, where tc writes past `min_rate64[16]` (Q53); an ets list longer than 16 is `ErrTcSchedList`. The small entry nests are parsed into a stack table (`parseSmallLoose`), so 16 tc entries cost no allocation. **Tests:** `TestParseTcSched`, 41 rows: 15 positive (drr, qfq, hfsc qdisc and the three curve shapes, ets qdisc and classes, cbs, etf, multiq, mqprio and both taprio schedules from the tcsched captures, checked against their `ip.out`; a crafted hfsc class with rt, ls and ul); 13 negative (mqprio of sizeof but short of `RTA_ALIGN`; taprio without PRIOMAP; a 2-byte entry index; an entry whose second attribute overruns keeps the first, as C does; cbs without PARMS; a short etf PARMS; ets without PRIOMAP; an ets class read as a qdisc; quanta holding a priomap band; a foreign member in a rate list; `red`, an increment-16 kind, is `ErrTcKindUnknown`; a 2-byte tc-entry index; a truncated FP after a valid entry for the same class); 8 boundary (ets with nbands == nstrict has no QUANTA, K25; 16 and 17 min rates, the 17th dropped; tc-entry index 15 kept and 16 skipped; a 3-byte multiq; mqprio FP, taprio FP and taprio MAX_SDU payloads of 0 to 3 bytes are `ErrTcShort`, 4 bytes decode); 5 corner (a tc entry without an index is still skipped; drr and qfq qdiscs carry no `TCA_OPTIONS`, K29; `TXTIME_DELAY` 0x80000000 is -2147483648; a 4-byte priomap band misaligns the +3 step; a truncated hfsc curve). `TestParseTcSchedXstats`, 6 rows (drr deficit, hfsc level, taprio offload stats, short drr, hfsc at exactly sizeof, and qfq's `{30 9000}` xstats, which the kernel sends and tc never prints, Q39/K24). `TestWsTcKinds` adds the nine kinds and sends classes through `ParseTcCopt`. It decoded drr 32, qfq 29, hfsc 86, ets 68, mqprio 45, taprio 78, multiq 28, cbs 20 and etf 12 messages, with no error. `FuzzParseTcQopt` also runs `ParseTcCopt`: 45 s (2.35M execs) and 30 s runs, both clean. **Allocations** (`TestParseTcSchedAllocs`, measured then pinned): the hfsc qdisc and multiq 0; cbs, etf and the drr qdisc 1 (the table); mqprio with 16 tc entries 1; taprio with oper and admin schedules of 2 entries each 6 (2 tables, plus 2 appends per list). Moving the entry tables onto the stack took mqprio from 17 allocations to 1 and from 1920 to 705 ns. **Benchmarks** (`BenchmarkParseTcSched`, 200k iterations, 24 threads): drr 204 ns/48 B/1 alloc, hfsc 172/0/0, ets 456/176/1, mqprio 16 entries 705/144/1, taprio 470/344/2, cbs 185/48/1, etf 192/48/1, multiq 138/0/0; drr xstats 35 ns and hfsc xstats 39 ns, both 0 allocs. Most of a fixed struct's time is the zeroing and copying of `TcQopt`, which grew by `TcSched`. **Gates:** `go test ./pkg/xtcpnl/ ./internal/gotc/ ./tools/nlcapgen/ ./internal/nlmon/`; `CGO_ENABLED=0 go build ./...`; golangci-lint (comprehensive) on `pkg/xtcpnl`, 0 issues; netlink-audit and kernel-citation-audit, no findings; gofmt -s. Coverage of `pkg/xtcpnl` is 92.8%. | +| V031 | 15R | **Printers** (`internal/gotc`), each following its C printer at v7.2.0 line by line. `q_sched.go`: drr (the quantum and deficit through print_size(PRINT_FP), so text only, Q37/Q38), qfq (no print_xstats, so its class xstats never print, Q39), multiq (`bands %u/%u` in text, two numbers in JSON, Q60), cbs (five print_ints, offload a number, Q61), etf (delta through print_uint's `%d`, signed in text and unsigned in JSON, Q62; offload `on`/`off`, Q61; `skip_sock_check` with no trailing space, Q63). `q_hfsc.go`: the qdisc's ` default %#llx ` with its leading space and the JSON string, nothing at 0 (Q40); xstats with work and rtwork only when nonzero (Q41) and the text-only `_SL_` (Q42); class curves, rt and ls merged into `sc` when their bytes match (Q43), d through tc_core_ktime2time, `sprint_time` in text and the number in JSON (Q44), and tc's "HFSC: truncated ... option" warning for a short curve. `q_ets.go`: the quanta and priomap walks as C does them, arrays closed with a text `" "` (Q45); a missing band prints tc's message and returns with the JSON array open (Q47); a strict class prints no quantum (Q46). `q_mqprio.go`: the hard `\n ` indents (Q48); mode and shaper print `dcb` when absent, nothing when present at their default, and only when attributes follow the header (Q49); `fp:` up to the highest class set, with a print_nl that, with the caller's, leaves a blank line (Q50); queues `(off:off+count-1)` in int arithmetic printed `%u`, `[[off,last]]` in JSON (Q51); text `map ` against JSON `map` (Q52); rate lists stop at 16 where tc writes past its array (Q53). `q_taprio.go`: map and queues; clockid, flags and `txtime delay` (an s32 into a `__u32`, signed in text and unsigned in JSON, Q55); the oper schedule, then the admin one with no text label, as a JSON `admin` object (Q57); print_sched_list with its JSON-only `schedule` array and a print_nl per entry; s64 times through print_lluint (Q59); `max-sdu` with a hyphen (Q56) and `fp`, each with its blank line (Q58); offload-stats xstats. **dump_tc_entries** is one function for both kinds. **Refused** (`tc reads it unchecked`): an attribute shorter than the read tc makes (`kindNeed`: drr, qfq, ets, mqprio mode/shaper/rates/entries, taprio fields; Q54), a taprio PRIOMAP short of `tc_mqprio_qopt` (Q54), and an mqprio or taprio num_tc over 16. As with the action refusals, the stdout already printed stays. **Plumbing:** the print hooks still return nothing, as tc ignores their returns. A hook records a refusal with `refuseKind`, and `printQdisc`/`printClass` take it after each hook; the `-g` graph keeps it in `r.cf.err`. `rtaWalk` is the silent RTA_OK loop. `qdiscUtils` gains the nine kinds (htb's pattern for drr, qfq, hfsc and ets, which set printCopt). **print_size_table** (`qdisc.go`, `tc_stab.c`): two tdc taprio readbacks under `-d` carry `TCA_STAB`, which gotc refused before; it is now ported (BASE MIN-copied into a zeroed `tc_sizespec`, each nonzero field, `" overhead 24 "`). **Lint:** goconst flagged a third `"unknown"`, so the three sites now use `wordUnknown`. **Tests:** `TestGotcSched` (`sched_test.go`), 33 rows. 16 positive: drr text and `-j`, qfq `-s`, hfsc default text and JSON, sc, rt/ls/ul JSON, ets qdisc and classes, mqprio text and JSON (mode channel), taprio text and JSON with an admin schedule, multiq, cbs/etf text and JSON. 6 negative: Q47 in text and `-j`; a 1-byte mqprio mode; a 20-byte taprio PRIOMAP; `red` refused by name; mqprio options of sizeof but short of `RTA_ALIGN`, giving "options size error". 4 boundary: queue count 0 is `(0:4294967295)`; 17 min rates; num_tc 17; tc-entry index 16 is tc's "Unexpected tc entry index 16". 7 corner: `-o` mqprio; `TXTIME_DELAY` 0x80000000 in text and JSON; base-time -1; hfsc `-s` with and without work; `-g` over hfsc; `-d` with a size table. `corpus_test.go`: `corpusRows["tcsched"] = 87`, joined to the replay loop, its four writes (ng-001 to ng-004) refused: **87/87 byte for byte**, 810 corpus rows in all. `readback_test.go`: the nine kinds leave `readbackSkips`; `readbackRendered` goes from 1025 to **1114** (+89); plug goes from 7 to 11 (4 readbacks that also hold a sched kind). **Mutants** (each `systemd-run --user --scope -p MemoryMax=6G go test -timeout=180s`, in a scratch worktree): 10/10 killed (drr quantum in JSON; hfsc default without its space; rt/ls never merged; ets arrays without the trailing space; mqprio fp cut to num_tc; mqprio without `mode:dcb`; TXTIME_DELAY as u32; `max_sdu`; cbs offload as a string; qfq printing xstats). Nine were killed by a corpus row, one (TXTIME_DELAY) by `TestGotcSched`. Coverage of `internal/gotc` is 85.1%. **Gates:** `go test ./internal/gotc/ ./pkg/xtcpnl/ ./tools/nlcapgen/ ./internal/wsreplay/`; `CGO_ENABLED=0 go build ./...`; golangci-lint (comprehensive) on `internal/gotc`, 0 issues; gofmt -s. | +| DOC008 | 15B | **Write-up:** `docs/netlink/upstream/iproute2-tc-sched.md`: status header, reachability, contents, 29 summary rows, seven sections, and K24–K31. Not submitted to netdev. **Leads:** each was read at v7.2.0 (`q_{drr,qfq,hfsc,ets,mqprio,taprio,multiq,cbs,etf}.c`) against the tcsched corpus, and the kernel side at v7.4-rc4. **At HEAD** (GitHub mirror, `5d13122576d6`, 2026-11-26): none of the nine printers, `tc_qdisc.c`, `tc_class.c`, `tc_util.c` or `tc_stab.c` has a commit since v7.2.0, so all are present. **Confirmed in the corpus:** Q37, Q38, Q39, Q40, Q42, Q43, Q44, Q45, Q46, Q48, Q49, Q50, Q51 (the JSON shape), Q52, Q55, Q56, Q57, Q58, Q60, Q61 and Q63. **Latent, with unit rows:** Q41, Q47, Q51 (count 0; the kernel rejects it, sch_mqprio_lib.c:29), Q53, Q54, Q59, Q62 (the kernel rejects a negative delta, sch_etf.c:67), Q64 and Q65. **Dropped:** none. **New leads:** **Q64**: the ets list walks print the first band from each offset to the end but step by the attribute at the offset, +3 for the priomap, so a foreign attribute repeats a band and a non-canonical length misaligns the walk; this is the same hand-rolled walk as tunnel_key's geneve (AC46). **Q65**: an explicit `mode dcb` (or `shaper dcb`), which the kernel echoes only when it was given (sch_mqprio.c:602), prints nothing, while an absent one prints `mode:dcb`; it needs `hw 1` (sch_mqprio.c:263). **Kernel notes:** K24 (qfq's `tc_qfq_stats`, sch_qfq.c:663-677). K25 (ets: NSTRICT only when nonzero, QUANTA only when `nbands > nstrict`, an empty class nest for a strict band, sch_ets.c:313-319, 764, 767). K26 (16 TC entries whatever num_tc, sch_mqprio.c:531, sch_taprio.c:2319). K27, corrected from the plan: tc never sends bands, as multiq takes no options; `multiq_tune` writes `real_num_tx_queues` into the request's own attribute (sch_multiq.c:186). K28, refined: the tc entries and the oper schedule are dumped only `if (oper)` (sch_taprio.c:2446, 2449); in software mode oper is set at the first cycle start (:220), under txtime-assist at change time (:1989); the xstats need `ndo_setup_tc` (:2371). K29 (drr and qfq have no qdisc `.dump`). K30, corrected from the plan: TCA_OPTIONS is noflag for every one of these kinds, ets included. The flagged nests are ets's QUANTA/PRIOMAP and the mqprio/taprio TC_ENTRYs; mqprio's rate nests are noflag. tc's printers depend on exactly that: TC_ENTRY is matched by its raw type with the flag, and the rates are parsed without masking it, while tc's own parser sends the rates flagged. **K31 (new):** `qdisc_change` returns EINVAL ("Change operation not supported by specified qdisc", sch_api.c:1456-1460) for a kind with no `.change`, so any `tc qdisc replace` over an etf fails before its options are read; this is why 15C's etf negative grafts a new etf. **Re-confirmed:** Q22 (`-j -g` prints `[]`, then text, pw-011) and Q36 (`-g` over hfsc's nested tree, ec-011 and pw-011). **Unit rows added** to `TestGotcSched` for Q65 and Q62 (35 rows). **Bug classes:** none edited. One candidate is noted for the user: a hand-rolled TLV walk that reads with `parse_rtattr` from an offset but steps by another stride (Q64, AC46). | +| V032 | 15L | **Live diff** on the workbench (kernel 7.3.1, tc 7.2.0): `gotc` from `nix build "git+file://…?rev=f64f6d074#gotc"` (`/nix/store/lcm6hr7nykwldhlkrhkb3186q2klxsv8-gotc-0.2.1`) beside `tc` (`/nix/store/x1pwsbz5cm23hk58b7fcpn3hhg9j7gwh-iproute2-7.2.0`), with `GOTC_CONF_USR_DIR` set to tc's `share/iproute2`. The guest script is generated from `nix/microvms/workbench/tcsched.rows.jsonl` by 13L's generator, without its two `-netns` reads. The row's ten modules are loaded once, then each row runs its pre steps in a fresh named namespace, in its own directory (so the batch rows' `b.txt` is there), then tc and gotc in turn. **Result:** 87 rows, **83 identical** on stdout, stderr and exit code, the `-s`, `-d`, `-o`, `-g`, `-j -g` and batch rows included. **The other four** are the planned write refusals: ng-001 (mqprio under drr; tc `RTNETLINK answers: Operation not supported`, rc 2), ng-002 (taprio with no clockid; `Error: Specifying a 'clockid' is mandatory.`, rc 2), ng-003 (cbs offload; `Error: Specified device does not support cbs offload.`, rc 2) and ng-004 (etf offload; `Error: Specified device does not support ETF offload.`, rc 2). gotc gives `not implemented: tc qdisc add`/`replace`, rc 255, for each. **tc against the corpus:** stdout, stderr and rc match `ws/tcsched` on all 87 rows, so nothing has drifted since the capture (the taprio base-times are fixed, and no row sends packets). **VM:** pre-checked (`free -g`, port 12061 free, no other workbench process), booted for this run. The modules this run loaded (the ten, plus `sch_mqprio_lib`) were removed with `modprobe -r`, leaving lsmod equal to the pre-run list; no namespace or extra link is left, there are no core files, `/tmp/t15l` is removed, and the VM is powered off again, as it was before. | ## Findings (9B write-up: [upstream/iproute2-tc-qdisc-class.md](upstream/iproute2-tc-qdisc-class.md)) diff --git a/docs/netlink/upstream/iproute2-tc-sched.md b/docs/netlink/upstream/iproute2-tc-sched.md new file mode 100644 index 000000000..27b4fc782 --- /dev/null +++ b/docs/netlink/upstream/iproute2-tc-sched.md @@ -0,0 +1,228 @@ +# iproute2 classful and scheduling qdisc printers: text-only fields, keys that differ by kind, hard newlines, and reads past fixed arrays + +**Status (2026-11-26, increment 15):** + +- **Not submitted to netdev.** These are drafts for the user's review, recorded here only, like the other write-ups in + this directory. No patch, no PR, no sign-off. +- **Scope:** the printers of drr, qfq, hfsc, ets, mqprio, taprio, multiq, cbs and etf (`tc/q_*.c`), as `tc qdisc show` + and `tc class show` call them. The lead numbers continue + [iproute2-tc-qdisc-class.md](iproute2-tc-qdisc-class.md)'s sequence, and the kernel notes continue + [iproute2-tc-monitor.md](iproute2-tc-monitor.md)'s (K19–K23). +- **Source:** + - Line numbers are iproute2 **v7.2.0** (`tc/q_{drr,qfq,hfsc,ets,mqprio,taprio,multiq,cbs,etf}.c`, `tc/tc_stab.c`). + That is the version the corpus was captured with. Kernel lines are linux **v7.4-rc4** (`net/sched/sch_*.c`, + `include/uapi/linux/pkt_sched.h`). + - **"At HEAD"** means the GitHub mirror's `main` on 2026-11-26 (`5d13122576d6`), checked with + `gh api repos/iproute2/iproute2/commits?path=...`. None of the nine `q_*.c` files, `tc_qdisc.c`, `tc_class.c`, + `tc_util.c` or `tc_stab.c` has a commit since v7.2.0. The `lib/` commits since then (`ce764a619c7a` printf formats, + `c4c9a7fa10c5` pretty arrays, the libnetlink receive-loop and padding fixes) do not touch these paths, so every + finding below is present at HEAD. +- **How they were found:** in increment 15 ([gotc-status.md](../gotc-status.md), V029–V032). + - The plan's bug-class sweep ([bug-classes.md](bug-classes.md)) listed leads Q37–Q63 and kernel notes K24–K30. + - Writing the decoders and printers (15P/15R, V030/V031) added Q64, Q65 and K31. + - `gotc` replays all 87 capture rows and 89 more tdc readbacks of these kinds byte for byte. So every captured finding + below is reproduced by an independent implementation, not just read from the source. +- **Corpus:** `pkg/xtcpnl/testdata/7_3_1/ws/tcsched/` (87 rows), kernel 7.3.1, tc 7.2.0. "ec-N" and "pw-N" below are + its rows. +- **Reachability:** + - **In the corpus:** Q37–Q40, Q42–Q46, Q48–Q52, Q55–Q58, Q60, Q61 and Q63. + - **Latent, with unit rows** in `pkg/xtcpnl/xtcpnl_tc_sched_test.go` and `internal/gotc/sched_test.go`: Q41, Q47, + Q53, Q54, Q59, Q62, Q64 and Q65. The kernel never sends what reaches them, or sends it only on hardware with + offload; a crafted or future message does. + - **Kernel notes:** K24–K31. + - **Dropped:** none. + - **Re-confirmed from increment 9:** Q22 (`-j -g class show` prints `[]` and then the graph as text, tcsched/pw-011) + and Q36 (`-g` over hfsc's nested tree prints the freed nodes' trailing indent lines, ec-011 and pw-011, the same on + both batches). + +## Contents + +- [Summary](#summary) +- [Q37, Q38, Q60. Text-only fields](#q37-q38-q60-text-only-fields) +- [Q40, Q44, Q51, Q52, Q55, Q56, Q61. JSON keys and types that differ](#q40-q44-q51-q52-q55-q56-q61-json-keys-and-types-that-differ) +- [Q40, Q42, Q45, Q48, Q50, Q57, Q58, Q63. Spaces and line breaks](#q40-q42-q45-q48-q50-q57-q58-q63-spaces-and-line-breaks) +- [Q39, Q41, Q43, Q46, Q49, Q65. Output that depends on what the kernel sends](#q39-q41-q43-q46-q49-q65-output-that-depends-on-what-the-kernel-sends) +- [Q51, Q55, Q59, Q62. Signedness](#q51-q55-q59-q62-signedness) +- [Q47, Q53, Q54, Q64. Reads past attributes and arrays, and invalid JSON](#q47-q53-q54-q64-reads-past-attributes-and-arrays-and-invalid-json) +- [K24–K31. Kernel notes](#k24k31-kernel-notes) + +## Summary + +| ID | File:line (v7.2.0) | Class | Finding | Pinned by | At HEAD | gotc | +|---|---|---|---|---|---|---| +| Q37 | q_drr.c:88 | C5 | drr's `quantum` goes through `print_size(PRINT_FP)`, so it is missing from JSON | pw-001 vs ec-002 | present | reproduces | +| Q38 | q_drr.c:103 | C5 | drr's xstats ` deficit %s ` is text only | ec-003 vs pw-003 | present | reproduces | +| Q39 | q_qfq.c:106-111 | C15 | qfq has no `print_xstats`, so the `tc_qfq_stats` the kernel sends as class xstats never print (K24) | ec-007, pw-007 | present | reproduces | +| Q40 | q_hfsc.c:110-112 | C10/C7 | ` default %#llx ` has a leading space, giving `refcnt 2 default 0x10`; JSON `"default":"0x10"` is a string; the key is left out at 0 | ec-008, pw-008, ec-013 | present | reproduces | +| Q41 | q_hfsc.c:129-134 | C7 | `work` and `rtwork` print only when nonzero, so the key set depends on traffic | TestGotcSched | present | reproduces | +| Q42 | q_hfsc.c:136 | C10 | a text-only `_SL_`, then `print_class`'s own newline: a blank line after each `-s` class | ec-010 | present | reproduces | +| Q43 | q_hfsc.c:260-262 | C7 | byte-identical rt and ls print as one `sc` key; otherwise `rt` and `ls` | ec-009, pw-009 | present | reproduces | +| Q44 | q_hfsc.c:223-224 | C10 | `d` is `sprint_time` in text (`10ms`) and the bare number in JSON (`"d":10000`) | ec-009 vs pw-009 | present | reproduces | +| Q45 | q_ets.c:245, 274 | C10 | the quanta and priomap arrays end in a text `" "`: `quanta 1500 3000 priomap 2 1 0 … 2 ` | ec-015 | present | reproduces | +| Q46 | q_ets.c:322-326 | C15 | a strict band's class prints no quantum, because the kernel sends an empty nest (K25) | ec-016, pw-016 | present | reproduces | +| Q47 | q_ets.c:236-238, 265-267 | C6 | a list missing a band returns -1 after `open_json_array`, leaving `-j` invalid | TestGotcSched | present | reproduces the bytes | +| Q48 | q_mqprio.c:304, 341, 361-372 | C10 | hard `"\n "` indents, so `-o qdisc show` is not one line | ec-030 | present | reproduces | +| Q49 | q_mqprio.c:356-373 | C15 | with attributes after the header, which the kernel always sends (K26), software mode prints `mode:dcb` and `shaper:dcb` | ec-028, pw-028 | present | reproduces | +| Q50 | q_mqprio.c:302-313 | C15/C10 | `fp:` prints 16 entries whatever num_tc is; its `print_nl` plus the caller's leaves a blank line | ec-028 | present | reproduces | +| Q51 | q_mqprio.c:341-347 | C10/C2 | JSON `queues` is `[[offset,last]]`, text `(offset:last)`; a count of 0 is `offset-1` printed `%u`, `(0:4294967295)` | pw-028; TestGotcSched | present | reproduces | +| Q52 | q_mqprio.c:337 | C7 | the text label `"map "` keeps its space; JSON `"map"` | ec-028 vs pw-028 | present | reproduces | +| Q53 | q_mqprio.c:376-405 | C4/C11 | the MIN/MAX_RATE64 loops write each member into a 16-entry stack array with no bound | TestParseTcSched, TestGotcSched | present | stops at 16 | +| Q54 | q_mqprio.c:358, 367; q_taprio.c:570, 582 | C3/C4 | mode and shaper are `*(__u16 *)RTA_DATA` with no length check; taprio's PRIOMAP is cast with none; num_tc indexes the queue arrays unchecked | TestGotcSched | present | refuses | +| Q55 | q_taprio.c:607-612 | C1/C2/C7 | TXTIME_DELAY, a u32 on the wire, is read as s32 into a `__u32` and printed with print_uint's `%d`; text says `txtime delay`, JSON `txtime_delay`, the keyword is `txtime-delay` | ec-033, pw-033; TestGotcSched | present | reproduces | +| Q56 | q_taprio.c:534 | C7 | the JSON key `"max-sdu"` has a hyphen where every other key uses `_` | pw-033 | present | reproduces | +| Q57 | q_taprio.c:616-627 | C10 | the admin schedule has no text label, so oper and admin look the same in text | ec-038 | present | reproduces | +| Q58 | q_taprio.c:539, 552 | C10 | `max-sdu` and `fp` each end in `print_nl`, so with the caller's newline taprio's text ends in a blank line | ec-033 | present | reproduces | +| Q59 | q_taprio.c:449-467 | C2 | the s64 times go through `print_lluint`: `%lld` in text, unsigned in JSON | TestGotcSched | present | reproduces | +| Q60 | q_multiq.c:62-66 | C5/C7 | `bands 8/8` is one text string; JSON has `bands` and `max_bands` | ec-026, pw-026 | present | reproduces | +| Q61 | q_cbs.c:127 vs q_etf.c:131 | C7 | cbs `offload` is a JSON number; etf's is `"on"`/`"off"` | pw-021 | present | reproduces | +| Q62 | q_etf.c:130 | C2 | the s32 `delta` goes through `print_uint` with `%d`: signed in text, unsigned in JSON | TestGotcSched | present | reproduces | +| Q63 | q_etf.c:135, 25 | C10 | `skip_sock_check %s` has no trailing space, unlike its neighbours; the usage leaves out `skip_sock_check` | ec-021 | present | reproduces | +| Q64 | q_ets.c:229-234, 258-263 | C3/C4 | **new.** The ets list walks print the first band attribute from each offset on, but step by the attribute at the offset (+3 for the priomap): a foreign attribute repeats the next band, and a band of non-canonical length misaligns the walk | TestParseTcSched | present | reproduces | +| Q65 | q_mqprio.c:356-373 | C7 | **new.** `mode:dcb` prints only when TCA_MQPRIO_MODE is absent; an explicit `mode dcb`, which the kernel echoes (sch_mqprio.c:602), prints nothing. The same for the shaper | TestGotcSched | present | reproduces | + +## Q37, Q38, Q60. Text-only fields + +- **Q37:** `drr_print_opt` prints the class quantum with `print_size(PRINT_FP, NULL, "quantum %s ", …)` (q_drr.c:88). Text + has `quantum 1514b`; `-j class show` has no quantum at all (pw-001, ec-002). qfq's weight and maxpkt, one file over, + use `PRINT_ANY`. +- **Q38:** `drr_print_xstats` is `print_size(PRINT_FP, NULL, " deficit %s ", …)` (q_drr.c:103): `-s` text shows + ` deficit 0b ` and `-j -s` drops it (ec-003, pw-003). +- **Q60:** `multiq_print_opt` formats `"%u/%u"` into a buffer and prints it `PRINT_FP` (q_multiq.c:62-64), then + `bands` and `max_bands` as JSON-only numbers. Not a loss, but the text and JSON shapes differ. +- **gotc:** prints each as tc does (`printDrrOpt`, `printDrrXstats`, `printMultiqOpt`). + +## Q40, Q44, Q51, Q52, Q55, Q56, Q61. JSON keys and types that differ + +- **Q40:** hfsc's default class is `print_0xhex` (q_hfsc.c:111): the JSON value is the string `"0x10"`, where htb's + default (also `print_0xhex`) matches, but every other numeric option is a number. At 0 the key is left out. +- **Q44:** `hfsc_print_sc` prints `d` as `sprint_time` in text and `print_uint(PRINT_JSON, "d", …)` of the same + microseconds in JSON (q_hfsc.c:223-224): `d 10ms` against `"d":10000`. +- **Q51:** mqprio's queues are `(0:3) (4:7)` in text and `[[0,3],[4,7]]` in JSON (q_mqprio.c:341-347), a nested array + where taprio's are `[{"offset":0,"count":4}]` objects (q_taprio.c:581-587). The two print the same struct. +- **Q52:** the map's array name is `is_json_context() ? "map" : "map "` (q_mqprio.c:337); taprio's is `"map"` and its + text puts the space in each value instead. +- **Q55:** the key is `txtime_delay`, the text `txtime delay` and the keyword `txtime-delay` (q_taprio.c:611): three + spellings for one field. +- **Q56:** `open_json_array(PRINT_ANY, "max-sdu")` (q_taprio.c:534): the one hyphenated JSON key in tc's qdisc output. +- **Q61:** cbs's offload is `print_int` (q_cbs.c:127) and etf's is a string `"on"`/`"off"` (q_etf.c:131), for the same + idea one kind apart. +- **gotc:** reproduces each key and type (pw-008, pw-009, pw-028, pw-033, pw-021 all replay). + +## Q40, Q42, Q45, Q48, Q50, Q57, Q58, Q63. Spaces and line breaks + +- **Q40:** the format `" default %#llx "` starts with a space after the header's own trailing one: + `qdisc hfsc 1: root refcnt 2 default 0x10 ` (ec-008). +- **Q42:** `hfsc_print_xstats` ends with `print_string(PRINT_FP, NULL, "%s", _SL_)` (q_hfsc.c:136), and `print_class` + adds its own `\n`: every `-s` hfsc class is followed by a blank line (ec-010). +- **Q45:** both ets arrays close with `close_json_array(PRINT_ANY, " ")` (q_ets.c:245, 274), each value printed `" %u"`: + `quanta 1500 3000 priomap 2 1 0 2 … 2 ` (ec-015). +- **Q48:** mqprio's `queues:`, `mode:`, `shaper:` and `fp:` labels start with a hard `"\n "` + (q_mqprio.c:304, 341, 361-372). Under `-o` only the final `print_nl` becomes `\`, so the "one line" spans five + (ec-030). +- **Q50, Q58:** `dump_tc_entries` ends each array with `print_nl()` (q_mqprio.c:313; q_taprio.c:539, 552), and the + caller prints another, so mqprio's and taprio's text end in a blank line, and under `-o` in `\\` (ec-028, ec-033, + ec-030). +- **Q57:** `taprio_print_opt` prints the admin schedule through the same `print_schedule` as the oper one, inside a + JSON-only `admin` object (q_taprio.c:616-627). Text gets two `base-time` blocks with nothing to tell them apart + (ec-038). +- **Q63:** `"skip_sock_check %s"` is the one etf field without a trailing space (q_etf.c:135); and `explain()` + (q_etf.c:25) does not mention `skip_sock_check`, which the parser accepts (q_etf.c:85). +- **gotc:** reproduces each byte (the rows above replay; ec-030 ends in `\\` with no newline, as tc's does). + +## Q39, Q41, Q43, Q46, Q49, Q65. Output that depends on what the kernel sends + +- **Q39:** sch_qfq.c sends `struct tc_qfq_stats {weight, lmax}` as class xstats (K24), and `qfq_qdisc_util` has no + `print_xstats` (q_qfq.c:106-111). The pcaps of ec-007 carry `{1, 1514}` and `{30, 9000}`; tc prints neither. +- **Q41:** `work` and `rtwork` print only when nonzero (q_hfsc.c:129-134), so a JSON consumer sees the keys appear once + the class has sent traffic. The corpus sends none; a TestGotcSched row has work 1500. +- **Q43:** rt and ls print as one `sc` when `memcmp` says their 12 bytes match (q_hfsc.c:260-262). A class given + `sc` and one given equal `rt` and `ls` print the same; JSON has `sc` or `rt`+`ls` by value, not by how it was set + (ec-009: 1:20 is `sc`, 1:10 is `rt` and `ls`). +- **Q46:** a strict ets band's class carries an empty TCA_OPTIONS (K25), so `ets_print_copt` prints nothing for it and + the JSON object has no `quantum` key (ec-016, pw-016). +- **Q49:** `mode:dcb` and `shaper:dcb` print when their attributes are absent, but only inside `if (len > 0)`, which is + whether any attribute follows the header (q_mqprio.c:350-373). Since the kernel always sends the 16 TC entries (K26), + that is always true now; before them a software mqprio printed neither. Software mode has no DCB at all, but + prints `mode:dcb` (ec-028). +- **Q65 (new):** when TCA_MQPRIO_MODE is present, tc prints `mode:channel` for CHANNEL and nothing for anything else + (q_mqprio.c:356-363). The kernel sends MODE only when the user gave one (`TC_MQPRIO_F_MODE`, sch_mqprio.c:602). So + `mode dcb` given explicitly prints no mode, while leaving it out prints `mode:dcb`. The same holds for the shaper. + Attributes need `hw 1` (sch_mqprio.c:263), so only offload hardware reaches this; TestGotcSched pins it. +- **gotc:** reproduces each. + +## Q51, Q55, Q59, Q62. Signedness + +- **Q51:** `qopt->offset[i] + qopt->count[i] - 1` is int arithmetic on two u16s, printed through `print_uint` + (q_mqprio.c:345). A queue of count 0 at offset 0 is `(0:4294967295)`. The kernel rejects count 0 ("No queues for + TC %d", sch_mqprio_lib.c:29), so it is crafted-only. +- **Q55:** `__u32 txtime_delay = rta_getattr_s32(…)`, then `print_uint(…, " txtime delay %d", txtime_delay)` + (q_taprio.c:610-611). The kernel's policy is NLA_U32 (sch_taprio.c:1046). A value of 0x80000000 is + `txtime delay -2147483648` in text and `2147483648` in JSON. +- **Q59:** base-time, cycle-time and the extension are s64s printed with `print_lluint` and `%lld` + (q_taprio.c:449-467): signed in text, unsigned in JSON. A negative base-time is accepted by the kernel's + NLA_S64 policy. +- **Q62:** etf's `delta` is an s32 printed with `print_uint(…, "delta %d ", …)` (q_etf.c:130). The kernel rejects a + negative delta (sch_etf.c:67), so it is crafted-only. +- **gotc:** reproduces each; the unit rows check text and JSON. + +## Q47, Q53, Q54, Q64. Reads past attributes and arrays, and invalid JSON + +- **Q47:** `ets_print_opt_quanta` and `_priomap` print "No ETS band quantum" / "No ETS priomap band" and `return -1` + after `open_json_array` (q_ets.c:236-238, 265-267). `print_qdisc` ignores the return and closes the options object, + so `-j` gets `"quanta":[1500}}]`. gotc writes the same bytes. +- **Q53:** each MIN_RATE64/MAX_RATE64 member is written with `*(min++) = rta_getattr_u64(r)` into + `__u64 min_rate64[TC_QOPT_MAX_QUEUE]` (q_mqprio.c:376-405), with no bound, so a 17th member writes past the stack + array. Each member's u64 is also read without a length check. The kernel sends at most num_tc members. gotc stops at + 16, which is what tc would have to do. +- **Q54:** `__u16 *mode = RTA_DATA(tb[TCA_MQPRIO_MODE])` and the shaper (q_mqprio.c:358, 367) are read with no + `RTA_PAYLOAD` check, and taprio's `qopt = RTA_DATA(tb[TCA_TAPRIO_ATTR_PRIOMAP])` (q_taprio.c:570) with none. Both + printers loop `i < qopt->num_tc` over the 16-entry offset and count arrays (q_mqprio.c:342; q_taprio.c:582), and + mqprio's rate loops index `min_rate64[i]` the same way (q_mqprio.c:387, 404). A num_tc over 16 reads past them. The + kernel caps num_tc at TC_QOPT_MAX_QUEUE. gotc refuses each ("tc reads it unchecked"). +- **Q64 (new):** `ets_print_opt_quanta` sets `attr = RTA_DATA(opt) + offset`, then `parse_rtattr(tb, …, attr, + len - offset)` over everything from there to the end, and prints the first QUANTA_BAND that table holds. It then + steps by `RTA_LENGTH(RTA_PAYLOAD(attr))`, the length of the attribute *at* the offset (q_ets.c:229-234). The + priomap loop adds a fixed `+ 3 /* padding */` (q_ets.c:258-263), which is right only for a 5-byte u8 attribute. + - A foreign attribute between two bands prints the next band twice. + - A band of any length other than the canonical one (8 bytes for a u32, 5 for a u8) puts the next offset mid-attribute. + For the priomap, a 4-byte value gives 8+3 = 11, and the walk fails at the misaligned header with "No ETS priomap band". + - Each step's `parse_rtattr` prints a "!!!Deficit" line for anything left malformed past the offset. + - The kernel sends canonical attributes, so this is latent. A TestParseTcSched corner row pins the misaligned step; + gotc walks the same way. + +## K24–K31. Kernel notes + +- **K24:** `qfq_dump_class_stats` fills a `struct tc_qfq_stats {weight, lmax}` and sends it with + `gnet_stats_copy_app` (sch_qfq.c:663-677). The values duplicate the class's TCA_QFQ_WEIGHT and LMAX, and no tc prints + them (Q39). +- **K25:** ets sends NSTRICT only when it is nonzero (sch_ets.c:764) and the QUANTA nest only when + `nbands > nstrict` (sch_ets.c:767). A strict band's class gets an empty TCA_OPTIONS nest (sch_ets.c:313-319). So + all-strict ets has no `quanta` (ec-019) and a strict class no `quantum` (Q46). +- **K26:** mqprio dumps a TCA_MQPRIO_TC_ENTRY for every one of the 16 classes (sch_mqprio.c:531-541), and taprio a + TCA_TAPRIO_ATTR_TC_ENTRY for each of TC_MAX_QUEUE (sch_taprio.c:2319). The entries do not depend on num_tc, hence + 16 `fp` (and `max-sdu`) values for 2 classes (Q50). +- **K27:** multiq takes no options (tc sends a zeroed `tc_multiq_qopt`, q_multiq.c:34-47). `multiq_tune` writes + `qopt->bands = qdisc_dev(sch)->real_num_tx_queues` into the request's own attribute, `nla_data(opt)` + (sch_multiq.c:186), before using it. The dump's `bands 8/8` is the device's queue count (ec-026). +- **K28:** taprio dumps the tc entries and the oper schedule only `if (oper)` (sch_taprio.c:2446, 2449). + - In software mode the oper schedule is assigned by `switch_schedules` (sch_taprio.c:220) when the first cycle + starts. With a base-time in the past that is at once (ec-033, ec-038). With one in the far future it never is, + and the dump has the admin schedule alone, with no `max-sdu` or `fp` (ec-039). + - Under txtime-assist the oper is set at change time (sch_taprio.c:1989). + - The xstats come only from a device with `ndo_setup_tc` (sch_taprio.c:2371), so a dummy has none. +- **K29:** drr's and qfq's `Qdisc_ops` have no `.dump` (sch_drr.c, sch_qfq.c `*_qdisc_ops`), so a qdisc dump carries + no TCA_OPTIONS. tc then prints `"options":{}` (pw-002, pw-005). +- **K30:** NLA_F_NESTED is set unevenly, and tc's printers depend on the current choice: + - TCA_OPTIONS is `nla_nest_start_noflag` in every one of these kinds (sch_drr.c:250, sch_qfq.c:641, + sch_hfsc.c:1342, sch_cbs.c:472, sch_etf.c:467, sch_ets.c:313 and 755, sch_taprio.c), and a raw struct for the hfsc + qdisc and mqprio (sch_hfsc.c:1550, sch_mqprio.c:599). + - ets's QUANTA and PRIOMAP nests (sch_ets.c:768, 781) and the mqprio and taprio TC_ENTRY nests + (sch_mqprio.c:532, sch_taprio.c:2320) are flagged. mqprio's rate nests are not (sch_mqprio.c:492, 506). + - tc's printers match TC_ENTRY by its raw type *with* the flag (q_mqprio.c:296, q_taprio.c:527), so an unflagged + entry would be skipped silently. They parse the rates with `parse_rtattr`, flags not masked, so a flagged rate nest + would be dropped. tc's own parser sends the rate nests flagged (q_mqprio.c:232, 245). +- **K31 (new):** `qdisc_change` refuses any TCA_OPTIONS for a kind with no `.change`, with "Change operation not + supported by specified qdisc" and **EINVAL**, not EOPNOTSUPP (sch_api.c:1456-1460). etf has no `.change` + (sch_etf.c `etf_qdisc_ops`), so `tc qdisc replace … etf …` over an existing etf fails before any option is looked + at. Even `offload`, whose refusal on a new etf is EOPNOTSUPP ("Specified device does not support ETF offload"), + gets EINVAL here. Seen in the first 15C batches; the committed negative (ng-004) grafts a new etf instead. diff --git a/internal/gotc/action.go b/internal/gotc/action.go index 20389ed66..60da180be 100644 --- a/internal/gotc/action.go +++ b/internal/gotc/action.go @@ -390,7 +390,7 @@ func (r *runner) rtrealmN2A(id int32) string { } t := &r.realms if !t.inited && t.names[0] == "" { - t.names[0] = "unknown" + t.names[0] = wordUnknown } if t.names[id] == "" && !t.inited { t.inited = true diff --git a/internal/gotc/class.go b/internal/gotc/class.go index e90bf60f8..87b8c3f54 100644 --- a/internal/gotc/class.go +++ b/internal/gotc/class.go @@ -232,6 +232,9 @@ func (r *runner) printClassBody(m Msg, ti *xtcpnl.TcInfo, q *qdiscUtil) error { if hasAttr(ti.Attrs, xtcpnl.TcaOptions) { if q.printCopt != nil { q.printCopt(r, q, ti.Options, true) + if err := r.takeKindErr(); err != nil { + return err + } } else { r.errf("[cannot parse class parameters]") } @@ -253,6 +256,9 @@ func (r *runner) printClassBody(m Msg, ti *xtcpnl.TcInfo, q *qdiscUtil) error { } if hasX && q.printXstats != nil { q.printXstats(r, xs) + if err := r.takeKindErr(); err != nil { + return err + } o.fp("\n") } o.closeObject() @@ -347,6 +353,9 @@ func (r *runner) graphNodeShow(buf *strings.Builder, cls *graphNode) { } if q != nil && q.printCopt != nil { q.printCopt(r, q, tb.Bytes(xtcpnl.TcaOptions), tb.Has(xtcpnl.TcaOptions)) + if err := r.takeKindErr(); err != nil && r.cf.err == nil { + r.cf.err = err + } } if q != nil && r.stats > 0 { r.graphStats(buf, cls, q, id, tb) diff --git a/internal/gotc/corpus_test.go b/internal/gotc/corpus_test.go index 668cf8b28..bf320be8a 100644 --- a/internal/gotc/corpus_test.go +++ b/internal/gotc/corpus_test.go @@ -15,6 +15,7 @@ import ( // corpusRows is how many rows each space holds (V002). var corpusRows = map[string]int{ "tcqdisc": 142, "tcclass": 82, "tcfilter": 159, "tcflower": 97, "tcaction": 138, "tcaction2": 105, + "tcsched": 87, } // corpusKnown are the rows gotc cannot match byte for byte, each with the @@ -39,6 +40,7 @@ var corpusRefused = map[string]string{ var corpusWrites = map[string]bool{ "tcqdisc/ng-018": true, "tcclass/ng-011": true, "tcfilter/ng-024": true, "tcflower/ng-009": true, "tcaction/ng-006": true, "tcaction2/ng-007": true, + "tcsched/ng-001": true, "tcsched/ng-002": true, "tcsched/ng-003": true, "tcsched/ng-004": true, } // pschedRow is the one row that reads the workbench's /proc/net/psched @@ -187,7 +189,7 @@ func TestGotcCorpus(t *testing.T) { if err != nil { t.Fatal(err) } - for _, sp := range []string{"tcclass", "tcfilter", "tcflower", "tcaction", "tcaction2"} { + for _, sp := range []string{"tcclass", "tcfilter", "tcflower", "tcaction", "tcaction2", "tcsched"} { more, err := filepath.Glob("../../pkg/xtcpnl/testdata/*/ws/" + sp) if err != nil { t.Fatal(err) diff --git a/internal/gotc/gotc.go b/internal/gotc/gotc.go index 213e95bd9..00fc42db9 100644 --- a/internal/gotc/gotc.go +++ b/internal/gotc/gotc.go @@ -78,6 +78,8 @@ type runner struct { cf classFilter // tc_class.c's statics, kept across batch lines (Q30) ff filterFilter // tc_filter.c's statics, kept across batch lines (Q29f) + kindErr error // a qdisc_util printer's refusal; see refuseKind + timestamp int // timestamp: -timestamp and -tshort each add one tshort int // timestamp_short: -tshort now func() time.Time // the monitor's clock (GOTC_NOW for a replay) diff --git a/internal/gotc/q_ets.go b/internal/gotc/q_ets.go new file mode 100644 index 000000000..f53a54dc0 --- /dev/null +++ b/internal/gotc/q_ets.go @@ -0,0 +1,94 @@ +package gotc + +import ( + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_ets.c (iproute2 v7.2.0). + +// printEtsOpt is ets_print_opt: NBANDS and PRIOMAP required ("Incomplete +// ETS options"), NSTRICT only when the kernel sends it, QUANTA only when +// some band is not strict (K25). A failed list leaves its JSON array open, +// as tc's `return -1` does (Q47). +func printEtsOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaEtsMaxKnown) + if !tb.Has(xtcpnl.TcaEtsNbands) || !tb.Has(xtcpnl.TcaEtsPriomap) { + r.errf("Incomplete ETS options\n") + return + } + o := r.o + if !r.kindNeed(xtcpnl.TcKindEts, "nbands", tb.Bytes(xtcpnl.TcaEtsNbands), 1) { + return + } + nb, _ := tb.U8(xtcpnl.TcaEtsNbands) + o.uint(printAny, "bands", "bands "+u32s(uint32(nb))+" ", uint32(nb)) + if tb.Has(xtcpnl.TcaEtsNstrict) { + if !r.kindNeed(xtcpnl.TcKindEts, "nstrict", tb.Bytes(xtcpnl.TcaEtsNstrict), 1) { + return + } + ns, _ := tb.U8(xtcpnl.TcaEtsNstrict) + o.uint(printAny, "strict", "strict "+u32s(uint32(ns))+" ", uint32(ns)) + } + if tb.Has(xtcpnl.TcaEtsQuanta) { + if !r.etsList(tb.Bytes(xtcpnl.TcaEtsQuanta), "quanta", xtcpnl.TcaEtsQuantaBand, 4, 0, "No ETS band quantum") { + return + } + } + r.etsList(tb.Bytes(xtcpnl.TcaEtsPriomap), "priomap", xtcpnl.TcaEtsPriomapBand, 1, 3, "No ETS priomap band") +} + +// etsList is ets_print_opt_quanta and ets_print_opt_priomap: at each +// offset, parse_rtattr from there to the end, the first band attribute +// printed as " %u", and the offset stepped by the rta_len there plus pad; +// the array closes with a text " " (Q45). No band attribute at an offset +// is tc's message and `return -1`, the array left open; ok is false then +// or after a refusal. +func (r *runner) etsList(b []byte, name string, band uint16, width, pad int, missing string) bool { + o := r.o + o.openArray(printAny, name) + for off := 0; off < len(b); { + tb := r.attrTable(b[off:], xtcpnl.TcaEtsMaxKnown, 0) + // The step reads the rta_len at the offset; with fewer than two + // bytes left that is past the list, but the missing band below + // returns before the offset is used again. + step := int(attrLenAt(b, off)) + pad + if !tb.Has(band) { + r.errf("%s\n", missing) + return false + } + if !r.kindNeed(xtcpnl.TcKindEts, name, tb.Bytes(band), width) { + return false + } + var v uint32 + if width == 4 { + v, _ = tb.U32(band) + } else { + u, _ := tb.U8(band) + v = uint32(u) + } + o.uint(printAny, "", " "+u32s(v), v) + off += step + } + o.closeArray(printAny, " ") + return true +} + +// printEtsCopt is ets_print_copt: a class's quantum, absent for a strict +// band, whose nest the kernel sends empty (Q46, K25). +func printEtsCopt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaEtsMaxKnown) + if !tb.Has(xtcpnl.TcaEtsQuantaBand) { + return + } + if !r.kindNeed(xtcpnl.TcKindEts, "quantum", tb.Bytes(xtcpnl.TcaEtsQuantaBand), 4) { + return + } + v, _ := tb.U32(xtcpnl.TcaEtsQuantaBand) + r.o.uint(printAny, "quantum", "quantum "+u32s(v)+" ", v) +} diff --git a/internal/gotc/q_hfsc.go b/internal/gotc/q_hfsc.go new file mode 100644 index 000000000..47524806f --- /dev/null +++ b/internal/gotc/q_hfsc.go @@ -0,0 +1,104 @@ +package gotc + +import ( + "bytes" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_hfsc.c (iproute2 v7.2.0). + +// printHfscOpt is hfsc_print_opt: the default class through print_0xhex +// with a leading space, so text has two spaces after `refcnt N`, JSON a +// string, and nothing at 0 (Q40). Nothing for a short struct. +func printHfscOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + q, err := xtcpnl.DecodeTcHfscQopt(opt) + if err != nil { + return + } + if q.Defcls != 0 { + d := uint64(q.Defcls) + r.o.hex0x(printAny, "default", " default "+cHashX(d)+" ", d) + } +} + +// printHfscXstats is hfsc_print_xstats: work and rtwork only when nonzero +// (Q41), then a text-only _SL_ that, with print_class's own newline, leaves +// a blank line (Q42). Nothing for a short payload. +func printHfscXstats(r *runner, xs []byte) { + st, err := xtcpnl.DecodeTcHfscStats(xs) + if err != nil { + return + } + o := r.o + o.uint(printAny, "period", " period "+u32s(st.Period)+" ", st.Period) + if st.Work != 0 { + o.u64(printAny, "work", "work "+u64s(st.Work)+" bytes ", st.Work) + } + if st.Rtwork != 0 { + o.u64(printAny, "rtwork", "rtwork "+u64s(st.Rtwork)+" bytes ", st.Rtwork) + } + o.uint(printAny, "level", " level "+u32s(st.Level)+" ", st.Level) + o.fp(o.sl) +} + +// hfscCurve is one class curve as hfsc_print_class_opt takes it: the +// payload when it holds a whole struct, nil otherwise. +func (r *runner) hfscCurve(tb xtcpnl.AttrTable, t uint16, name string) []byte { + if !tb.Has(t) { + return nil + } + b := tb.Bytes(t) + if len(b) < xtcpnl.TcServiceCurveSizeCst { + r.errf("HFSC: truncated %s option\n", name) + return nil + } + return b[:xtcpnl.TcServiceCurveSizeCst] +} + +// printHfscClassOpt is hfsc_print_class_opt: rt and ls are one `sc` when +// their bytes match (Q43), and ul follows. A truncated curve is warned +// about and skipped. +func printHfscClassOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaHfscMaxKnown) + rsc := r.hfscCurve(tb, xtcpnl.TcaHfscRsc, "realtime") + fsc := r.hfscCurve(tb, xtcpnl.TcaHfscFsc, "linkshare") + usc := r.hfscCurve(tb, xtcpnl.TcaHfscUsc, "upperlimit") + if rsc != nil && fsc != nil && bytes.Equal(rsc, fsc) { + r.hfscSc("sc", rsc) + } else { + if rsc != nil { + r.hfscSc("rt", rsc) + } + if fsc != nil { + r.hfscSc("ls", fsc) + } + } + if usc != nil { + r.hfscSc("ul", usc) + } +} + +// hfscSc is hfsc_print_sc: d through tc_core_ktime2time, sprint_time in +// text and the number in JSON (Q44). +func (r *runner) hfscSc(name string, b []byte) { + sc, err := xtcpnl.DecodeTcServiceCurve(b) + if err != nil { + return + } + d := cDoubleToU32(float64(sc.D) / r.core.clockFactor) + o := r.o + o.openObject(name) + o.fp(name + " ") + o.rate(r.iec > 0, printAny, "m1", "m1 ", " ", uint64(sc.M1)) + o.fp("d " + sprintTime(d) + " ") + o.uint(printJSON, "d", "", d) + o.rate(r.iec > 0, printAny, "m2", "m2 ", " ", uint64(sc.M2)) + o.closeObject() +} diff --git a/internal/gotc/q_mqprio.go b/internal/gotc/q_mqprio.go new file mode 100644 index 000000000..7a9fc659b --- /dev/null +++ b/internal/gotc/q_mqprio.go @@ -0,0 +1,216 @@ +package gotc + +import ( + "encoding/binary" + "strconv" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// tc/q_mqprio.c (iproute2 v7.2.0). + +// mqprioIndent is the hard newline and indent mqprio's text uses, so -o +// leaves its lines broken (Q48). +const mqprioIndent = "\n " + +// mqprioAligned is RTA_ALIGN(sizeof(struct tc_mqprio_qopt)). +const mqprioAligned = (xtcpnl.TcMqprioQoptSizeCst + 3) &^ 3 + +// printMqprioOpt is mqprio_print_opt. The map's text label keeps its space +// (Q52); a queue is `(offset:offset+count-1)`, an int printed as unsigned +// (Q51); mode and shaper print "dcb" when absent and nothing when present +// at their default, and only when attributes follow the header, which the +// kernel always sends (Q49, K26). A num_tc past TC_QOPT_MAX_QUEUE reads past +// the struct, and is refused. +func printMqprioOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + n := len(opt) - mqprioAligned + if n < 0 { + r.errf("options size error\n") + return + } + q, err := xtcpnl.DecodeTcMqprioQopt(opt) + if err != nil { + return + } + if q.NumTc > xtcpnl.TcQoptMaxQueueCst { + r.refuseKind(actUnchecked(xtcpnl.TcKindMqprio, "num_tc "+strconv.Itoa(int(q.NumTc)))) + return + } + o := r.o + json := o.isJSON() + nt := uint32(q.NumTc) + o.uint(printAny, "tc", "tc "+u32s(nt)+" ", nt) + o.openArray(printAny, pick(json, "map", "map ")) + for _, m := range q.PrioTcMap { + o.uint(printAny, "", u32s(uint32(m))+" ", uint32(m)) + } + o.closeArray(printAny, "") + o.openArray(printAny, pick(json, "queues", mqprioIndent+"queues:")) + for i := range int(q.NumTc) { + o.openArray(printJSON, "") + off := uint32(q.Offset[i]) + last := cint.Bits(int32(q.Offset[i]) + int32(q.Count[i]) - 1) // int arithmetic, then %u + o.uint(printAny, "", "("+u32s(off)+":", off) + o.uint(printAny, "", u32s(last)+") ", last) + o.closeArray(printJSON, "") + } + o.closeArray(printAny, "") + if n == 0 { + return + } + tail := opt[mqprioAligned:] + tb := r.attrTable(tail, xtcpnl.TcaMqprioMaxKnown, 0) + if !r.mqprioMode(tb, xtcpnl.TcaMqprioMode, "mode", xtcpnl.TcMqprioModeChannel, "channel") || + !r.mqprioMode(tb, xtcpnl.TcaMqprioShaper, "shaper", xtcpnl.TcMqprioShaperBwRate, "bw_rlimit") { + return + } + for _, rl := range []struct { + t uint16 + key, label string + }{ + {xtcpnl.TcaMqprioMinRate64, "min_rate", "\tmin_rate:"}, + {xtcpnl.TcaMqprioMaxRate64, "max_rate", "\tmax_rate:"}, + } { + if !tb.Has(rl.t) { + continue + } + if !r.mqprioRates(tb.Bytes(rl.t), rl.t, rl.key, pick(json, rl.key, rl.label), int(q.NumTc)) { + return + } + } + r.tcEntries(tail, xtcpnl.TcaMqprioTcEntry, xtcpnl.TcaMqprioTcEntryMaxKnown, 0, xtcpnl.TcaMqprioTcEntryFp, + xtcpnl.TcKindMqprio, pick(json, "fp", mqprioIndent+"fp:"), "") +} + +// pick is C's `cond ? a : b`. +func pick(cond bool, a, b string) string { + if cond { + return a + } + return b +} + +// mqprioMode prints mqprio's mode or shaper: "dcb" when absent, the name +// when the u16 (read unchecked, Q54) is the one value tc names, nothing +// otherwise. +func (r *runner) mqprioMode(tb xtcpnl.AttrTable, t uint16, key string, named uint16, name string) bool { + if !tb.Has(t) { + r.o.str(printAny, colorNone, key, mqprioIndent+key+":dcb", "dcb") + return true + } + if !r.kindNeed(xtcpnl.TcKindMqprio, key, tb.Bytes(t), 2) { + return false + } + if v, _ := tb.U16(t); v == named { + r.o.str(printAny, colorNone, key, mqprioIndent+key+":"+name, name) + } + return true +} + +// mqprioRates is a MIN_RATE64 or MAX_RATE64 list: each member must have +// the list's type (tc returns -1 otherwise, before printing) and holds a +// u64 into a 16-entry array; then num_tc rates are printed. tc writes past +// the array from the 17th member (Q53); gotc stops at 16. A short member +// is refused. +func (r *runner) mqprioRates(b []byte, t uint16, key, label string, numTc int) bool { + var rates [xtcpnl.TcQoptMaxQueueCst]uint64 + n, ok, foreign := 0, true, false + rtaWalk(b, func(raw uint16, v []byte) { + switch { + case !ok || foreign: + case raw != t: + foreign = true + case !r.kindNeed(xtcpnl.TcKindMqprio, key, v, 8): + ok = false + case n < len(rates): + rates[n] = binary.LittleEndian.Uint64(v) + n++ + } + }) + if !ok || foreign { + return false + } + o := r.o + o.openArray(printAny, label) + for i := range numTc { + o.rate(r.iec > 0, printAny, "", "", " ", rates[i]) + } + o.closeArray(printAny, "") + return true +} + +// tcEntries is dump_tc_entries (q_mqprio.c and q_taprio.c): an RTA_OK walk +// for the raw type entry|NLA_F_NESTED, each parsed nested; no index or one +// of 16 or more is tc's message and the entry skipped. Then max-sdu (sdu +// nonzero: taprio) and fp, each up to the highest class set, with a +// print_nl after each that, with the caller's newline, leaves a blank line +// (Q50, Q58). The kernel sends all 16 entries (K26). +func (r *runner) tcEntries(opt []byte, entry, maxType, sdu, fp uint16, kind, fpLabel, sduLabel string) { + var maxSdu, fps [xtcpnl.TcQoptMaxQueueCst]uint32 + maxTcSdu, maxTcFp := -1, -1 + ok := true + rtaWalk(opt, func(raw uint16, v []byte) { + if !ok || raw != entry|unix.NLA_F_NESTED { + return + } + tb := r.nested(v, maxType) + if !tb.Has(1) { // TCA_*_TC_ENTRY_INDEX + r.errf("Missing tc entry index\n") + return + } + if ok = r.kindNeed(kind, "tc entry index", tb.Bytes(1), 4); !ok { + return + } + tc, _ := tb.U32(1) + if tc >= xtcpnl.TcQoptMaxQueueCst { + r.errf("Unexpected tc entry index %d\n", cint.Int(tc)) + return + } + if sdu != 0 && tb.Has(sdu) { + if ok = r.kindNeed(kind, "max-sdu", tb.Bytes(sdu), 4); !ok { + return + } + maxSdu[tc], _ = tb.U32(sdu) + maxTcSdu = max(maxTcSdu, int(tc)) + } + if tb.Has(fp) { + if ok = r.kindNeed(kind, "fp", tb.Bytes(fp), 4); !ok { + return + } + fps[tc], _ = tb.U32(fp) + maxTcFp = max(maxTcFp, int(tc)) + } + }) + if !ok { + return + } + o := r.o + if maxTcSdu >= 0 { + o.openArray(printAny, sduLabel) + for tc := 0; tc <= maxTcSdu; tc++ { + o.uint(printAny, "", " "+u32s(maxSdu[tc]), maxSdu[tc]) + } + o.closeArray(printAny, "") + o.nl() + } + if maxTcFp >= 0 { + o.openArray(printAny, fpLabel) + for tc := 0; tc <= maxTcFp; tc++ { + s := "?" + switch fps[tc] { + case xtcpnl.TcFpPreemptible: + s = "P" + case xtcpnl.TcFpExpress: + s = "E" + } + o.str(printAny, colorNone, "", " "+s, s) + } + o.closeArray(printAny, "") + o.nl() + } +} diff --git a/internal/gotc/q_sched.go b/internal/gotc/q_sched.go new file mode 100644 index 000000000..a2acd5478 --- /dev/null +++ b/internal/gotc/q_sched.go @@ -0,0 +1,137 @@ +package gotc + +import ( + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_drr.c, tc/q_qfq.c, tc/q_multiq.c, tc/q_cbs.c and tc/q_etf.c +// (iproute2 v7.2.0). + +// printDrrOpt is drr_print_opt, the qdisc's and the class's: the quantum +// through print_size(PRINT_FP), so text only (Q37). A drr qdisc has no +// options at all (sch_drr.c has no .dump, K29). +func printDrrOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaDrrMaxKnown) + if !tb.Has(xtcpnl.TcaDrrQuantum) { + return + } + if !r.kindNeed(xtcpnl.TcKindDrr, "quantum", tb.Bytes(xtcpnl.TcaDrrQuantum), 4) { + return + } + v, _ := tb.U32(xtcpnl.TcaDrrQuantum) + r.o.size(printFP, "", "quantum ", " ", uint64(v)) +} + +// printDrrXstats is drr_print_xstats: the deficit, text only (Q38); +// nothing for a short payload. +func printDrrXstats(r *runner, xs []byte) { + st, err := xtcpnl.DecodeTcDrrStats(xs) + if err != nil { + return + } + r.o.size(printFP, "", " deficit ", " ", uint64(st.Deficit)) +} + +// printQfqOpt is qfq_print_opt, the qdisc's (no options, K29) and the +// class's. qfq has no print_xstats, so the tc_qfq_stats the kernel sends +// are never printed (Q39, K24). +func printQfqOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaQfqMaxKnown) + for _, f := range []struct { + t uint16 + key, txt string + }{{xtcpnl.TcaQfqWeight, "weight", "weight "}, {xtcpnl.TcaQfqLmax, "maxpkt", "maxpkt "}} { + if !tb.Has(f.t) { + continue + } + if !r.kindNeed(xtcpnl.TcKindQfq, f.key, tb.Bytes(f.t), 4) { + return + } + v, _ := tb.U32(f.t) + r.o.uint(printAny, f.key, f.txt+u32s(v)+" ", v) + } +} + +// printMultiqOpt is multiq_print_opt: "bands %u/%u" in text, two numbers +// in JSON; nothing for a short struct. The kernel sets bands to the +// device's queue count, whatever was asked (K27). +func printMultiqOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + q, err := xtcpnl.DecodeTcMultiqQopt(opt) + if err != nil { + return + } + b, m := uint32(q.Bands), uint32(q.MaxBands) + r.o.fp("bands " + u32s(b) + "/" + u32s(m) + " ") + r.o.uint(printJSON, "bands", "", b) + r.o.uint(printJSON, "max_bands", "", m) +} + +// printCbsOpt is cbs_print_opt: TCA_CBS_PARMS required and full, each +// field through print_int, offload a number (Q61). +func printCbsOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaCbsMaxKnown) + if !tb.Has(xtcpnl.TcaCbsParms) { + return + } + q, err := xtcpnl.DecodeTcCbsQopt(tb.Bytes(xtcpnl.TcaCbsParms)) + if err != nil { + return + } + o := r.o + for _, f := range []struct { + key string + v int32 + }{ + {"hicredit", q.Hicredit}, {"locredit", q.Locredit}, {"sendslope", q.Sendslope}, + {"idleslope", q.Idleslope}, {"offload", int32(q.Offload)}, + } { + o.int(printAny, f.key, f.key+" "+i32s(f.v)+" ", f.v) + } +} + +// printEtfOpt is etf_print_opt: TCA_ETF_PARMS required and full. delta, an +// s32, goes through print_uint with "%d": signed in text, unsigned in +// JSON (Q62); offload is "on"/"off" (Q61); skip_sock_check has no +// trailing space (Q63). +func printEtfOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaEtfMaxKnown) + if !tb.Has(xtcpnl.TcaEtfParms) { + return + } + q, err := xtcpnl.DecodeTcEtfQopt(tb.Bytes(xtcpnl.TcaEtfParms)) + if err != nil { + return + } + o := r.o + c := getClockName(q.Clockid) + o.str(printAny, colorNone, "clockid", "clockid "+c+" ", c) + o.emit(printAny, colorNone, "delta", u32s(cint.Bits(q.Delta)), "delta "+i32s(q.Delta)+" ") + onOff := func(f uint32) string { + if q.Flags&f != 0 { + return "on" + } + return "off" + } + v := onOff(xtcpnl.TcEtfOffloadOn) + o.str(printAny, colorNone, "offload", "offload "+v+" ", v) + v = onOff(xtcpnl.TcEtfDeadlineModeOn) + o.str(printAny, colorNone, "deadline_mode", "deadline_mode "+v+" ", v) + v = onOff(xtcpnl.TcEtfSkipSockCheckOn) + o.str(printAny, colorNone, "skip_sock_check", "skip_sock_check "+v, v) +} diff --git a/internal/gotc/q_taprio.go b/internal/gotc/q_taprio.go new file mode 100644 index 000000000..f9616bbd8 --- /dev/null +++ b/internal/gotc/q_taprio.go @@ -0,0 +1,219 @@ +package gotc + +import ( + "strconv" + + "github.com/randomizedcoder/xtcp2/pkg/cint" + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" +) + +// tc/q_taprio.c (iproute2 v7.2.0). + +// taprioCmd is entry_cmd_to_str over TC_TAPRIO_CMD_*. +func taprioCmd(cmd uint8) string { + switch cmd { + case 0: + return "S" // SET_GATES + case 1: + return "H" // SET_AND_HOLD + case 2: + return "R" // SET_AND_RELEASE + } + return "Invalid" +} + +// printTaprioOpt is taprio_print_opt. PRIOMAP is required; it is cast to +// struct tc_mqprio_qopt unchecked (Q54) and its num_tc indexes the queue +// arrays unchecked, so a short struct or a num_tc past 16 is refused. +// TXTIME_DELAY is read as s32 into a __u32 and printed with print_uint's +// "%d": signed in text, unsigned in JSON (Q55). The admin schedule has no +// text label (Q57). The JSON key "max-sdu" has a hyphen (Q56). +func printTaprioOpt(r *runner, _ *qdiscUtil, opt []byte, has bool) { + if !has { + return + } + tb := r.nested(opt, xtcpnl.TcaTaprioAttrMaxKnown) + if !tb.Has(xtcpnl.TcaTaprioAttrPriomap) { + return + } + pm := tb.Bytes(xtcpnl.TcaTaprioAttrPriomap) + if len(pm) < xtcpnl.TcMqprioQoptSizeCst { + r.refuseKind(actShort(xtcpnl.TcKindTaprio, len(pm))) + return + } + q, err := xtcpnl.DecodeTcMqprioQopt(pm) + if err != nil { + return + } + if q.NumTc > xtcpnl.TcQoptMaxQueueCst { + r.refuseKind(actUnchecked(xtcpnl.TcKindTaprio, "num_tc "+strconv.Itoa(int(q.NumTc)))) + return + } + o := r.o + nt := uint32(q.NumTc) + o.uint(printAny, "tc", "tc "+u32s(nt)+" ", nt) + o.openArray(printAny, "map") + for _, m := range q.PrioTcMap { + o.uint(printAny, "", " "+u32s(uint32(m)), uint32(m)) + } + o.closeArray(printAny, "") + o.nl() + o.openArray(printAny, "queues") + for i := range int(q.NumTc) { + o.openObject("") + off, cnt := uint32(q.Offset[i]), uint32(q.Count[i]) + o.uint(printAny, "offset", " offset "+u32s(off), off) + o.uint(printAny, "count", " count "+u32s(cnt), cnt) + o.closeObject() + } + o.closeArray(printAny, "") + o.nl() + if !r.taprioTop(tb) || !r.taprioSchedule(tb) { + return + } + if tb.Has(xtcpnl.TcaTaprioAttrAdminSched) { + at := r.nested(tb.Bytes(xtcpnl.TcaTaprioAttrAdminSched), xtcpnl.TcaTaprioAttrMaxKnown) + o.openObject("admin") + ok := r.taprioSchedule(at) + o.closeObject() + if !ok { + return + } + } + r.tcEntries(opt, xtcpnl.TcaTaprioAttrTcEntry, xtcpnl.TcaTaprioTcEntryMaxKnown, xtcpnl.TcaTaprioTcEntryMaxSdu, + xtcpnl.TcaTaprioTcEntryFp, xtcpnl.TcKindTaprio, "fp", "max-sdu") +} + +// taprioTop is taprio_print_opt's clockid, flags and txtime delay, each +// read unchecked. +func (r *runner) taprioTop(tb xtcpnl.AttrTable) bool { + o := r.o + k := xtcpnl.TcKindTaprio + if b := tb.Bytes(xtcpnl.TcaTaprioAttrSchedClockid); tb.Has(xtcpnl.TcaTaprioAttrSchedClockid) { + if !r.kindNeed(k, "clockid", b, 4) { + return false + } + v, _ := tb.U32(xtcpnl.TcaTaprioAttrSchedClockid) + c := getClockName(cint.Int(v)) + o.str(printAny, colorNone, "clockid", "clockid "+c, c) + } + if b := tb.Bytes(xtcpnl.TcaTaprioAttrFlags); tb.Has(xtcpnl.TcaTaprioAttrFlags) { + if !r.kindNeed(k, "flags", b, 4) { + return false + } + v, _ := tb.U32(xtcpnl.TcaTaprioAttrFlags) + o.hex0x(printAny, "flags", " flags "+cHashX(uint64(v)), uint64(v)) + } + if b := tb.Bytes(xtcpnl.TcaTaprioAttrTxtimeDelay); tb.Has(xtcpnl.TcaTaprioAttrTxtimeDelay) { + if !r.kindNeed(k, "txtime delay", b, 4) { + return false + } + v, _ := tb.U32(xtcpnl.TcaTaprioAttrTxtimeDelay) + o.emit(printAny, colorNone, "txtime_delay", u32s(v), " txtime delay "+i32s(cint.Int(v))) + } + return true +} + +// taprioS64 prints an s64 schedule time through print_lluint with "%lld": +// signed in text, unsigned in JSON (Q59). +func (r *runner) taprioS64(tb xtcpnl.AttrTable, t uint16, key, label string) bool { + if !tb.Has(t) { + return true + } + if !r.kindNeed(xtcpnl.TcKindTaprio, key, tb.Bytes(t), 8) { + return false + } + v, _ := tb.U64(t) + r.o.emit(printAny, colorNone, key, u64s(v), label+strconv.FormatInt(cint.LongLong(v), 10)) + return true +} + +// taprioSchedule is print_schedule: base-time, cycle-time and its +// extension, then the entry list. +func (r *runner) taprioSchedule(tb xtcpnl.AttrTable) bool { + if !r.taprioS64(tb, xtcpnl.TcaTaprioAttrSchedBaseTime, "base_time", "\tbase-time ") || + !r.taprioS64(tb, xtcpnl.TcaTaprioAttrSchedCycleTime, "cycle_time", " cycle-time ") || + !r.taprioS64(tb, xtcpnl.TcaTaprioAttrSchedCycleTimeExtension, "cycle_time_extension", " cycle-time-extension ") { + return false + } + if !tb.Has(xtcpnl.TcaTaprioAttrSchedEntryList) { + return true + } + return r.taprioSchedList(tb.Bytes(xtcpnl.TcaTaprioAttrSchedEntryList)) +} + +// taprioSchedList is print_sched_list: a JSON-only "schedule" array, a +// newline, then each entry (of any type) parsed nested, its fields printed +// when present, each line ended by print_nl. +func (r *runner) taprioSchedList(list []byte) bool { + o := r.o + k := xtcpnl.TcKindTaprio + o.openArray(printJSON, "schedule") + o.nl() + ok := true + rtaWalk(list, func(_ uint16, v []byte) { + if !ok { + return + } + tb := r.nested(v, xtcpnl.TcaTaprioSchedEntryMaxKnown) + o.openObject("") + if b := tb.Bytes(xtcpnl.TcaTaprioSchedEntryIndex); tb.Has(xtcpnl.TcaTaprioSchedEntryIndex) { + if ok = r.kindNeed(k, "entry index", b, 4); !ok { + return + } + i, _ := tb.U32(xtcpnl.TcaTaprioSchedEntryIndex) + o.uint(printAny, "index", "\tindex "+u32s(i), i) + } + if b := tb.Bytes(xtcpnl.TcaTaprioSchedEntryCmd); tb.Has(xtcpnl.TcaTaprioSchedEntryCmd) { + if ok = r.kindNeed(k, "entry cmd", b, 1); !ok { + return + } + c, _ := tb.U8(xtcpnl.TcaTaprioSchedEntryCmd) + s := taprioCmd(c) + o.str(printAny, colorNone, "cmd", " cmd "+s, s) + } + if b := tb.Bytes(xtcpnl.TcaTaprioSchedEntryGateMask); tb.Has(xtcpnl.TcaTaprioSchedEntryGateMask) { + if ok = r.kindNeed(k, "entry gatemask", b, 4); !ok { + return + } + g, _ := tb.U32(xtcpnl.TcaTaprioSchedEntryGateMask) + o.hex0x(printAny, "gatemask", " gatemask "+cHashX(uint64(g)), uint64(g)) + } + if b := tb.Bytes(xtcpnl.TcaTaprioSchedEntryInterval); tb.Has(xtcpnl.TcaTaprioSchedEntryInterval) { + if ok = r.kindNeed(k, "entry interval", b, 4); !ok { + return + } + iv, _ := tb.U32(xtcpnl.TcaTaprioSchedEntryInterval) + o.uint(printAny, "interval", " interval "+u32s(iv), iv) + } + o.closeObject() + o.nl() + }) + if ok { + o.closeArray(printAny, "") + } + return ok +} + +// printTaprioXstats is taprio_print_xstats: the offload stats nest, each +// counter a u64 read unchecked. Software taprio on a dummy sends none +// (K28). +func printTaprioXstats(r *runner, xs []byte) { + tb := r.nested(xs, xtcpnl.TcaTaprioOffloadStatsMaxKnown) + for _, f := range []struct { + t uint16 + key, txt string + }{ + {xtcpnl.TcaTaprioOffloadStatsWindowDrops, "window_drops", " window_drops "}, + {xtcpnl.TcaTaprioOffloadStatsTxOverruns, "tx_overruns", " tx_overruns "}, + } { + if !tb.Has(f.t) { + continue + } + if !r.kindNeed(xtcpnl.TcKindTaprio, f.key, tb.Bytes(f.t), 8) { + return + } + v, _ := tb.U64(f.t) + r.o.u64(printAny, f.key, f.txt+u64s(v), v) + } +} diff --git a/internal/gotc/qdisc.go b/internal/gotc/qdisc.go index 0679bcc9f..c31ad8e85 100644 --- a/internal/gotc/qdisc.go +++ b/internal/gotc/qdisc.go @@ -338,6 +338,9 @@ func (r *runner) printQdiscBody(m Msg, ti *xtcpnl.TcInfo, q *qdiscUtil) error { o.openObject("options") if hasAttr(ti.Attrs, xtcpnl.TcaOptions) { q.printQopt(r, q, ti.Options, true) + if err := r.takeKindErr(); err != nil { + return err + } } o.closeObject() o.nl() @@ -359,6 +362,9 @@ func (r *runner) printQdiscBody(m Msg, ti *xtcpnl.TcInfo, q *qdiscUtil) error { } if hasX && q.printXstats != nil { q.printXstats(r, xs) + if err := r.takeKindErr(); err != nil { + return err + } o.nl() } } @@ -379,8 +385,41 @@ func (r *runner) extMsg(ti *xtcpnl.TcInfo) { r.o.nl() } -// printSizeTable is print_size_table; the slice's fixtures carry no -// TCA_STAB, so gotc refuses one rather than guess its layout. -func (r *runner) printSizeTable([]byte) error { - return fmt.Errorf("%w: TCA_STAB (stab) under -d", errNotImplemented) +// printSizeTable is tc_stab.c print_size_table: TCA_STAB_BASE MIN-copied +// into a zeroed struct tc_sizespec, then each nonzero field. The table +// itself (TCA_STAB_DATA) is not printed. +func (r *runner) printSizeTable(stab []byte) error { + tb := r.nested(stab, xtcpnl.TcaStabMaxKnown) + if !tb.Has(xtcpnl.TcaStabBase) { + return nil + } + var buf [xtcpnl.TcSizespecSizeCst]byte + copy(buf[:], tb.Bytes(xtcpnl.TcaStabBase)) + s, err := xtcpnl.DecodeTcSizespec(buf[:]) + if err != nil { + return err + } + o := r.o + o.openObject("stab") + o.fp(" ") + if s.Linklayer != 0 { + ll := wordUnknown // sprint_linklayer of an unsigned int + if s.Linklayer <= 2 { + ll = sprintLinklayer(uint8(s.Linklayer)) + } + o.str(printAny, colorNone, "linklayer", "linklayer "+ll+" ", ll) + } + if s.Overhead != 0 { + o.int(printAny, "overhead", "overhead "+i32s(s.Overhead)+" ", s.Overhead) + } + for _, f := range []struct { + key string + v uint32 + }{{"mpu", s.Mpu}, {"mtu", s.Mtu}, {"tsize", s.Tsize}} { + if f.v != 0 { + o.uint(printAny, f.key, f.key+" "+u32s(f.v)+" ", f.v) + } + } + o.closeObject() + return nil } diff --git a/internal/gotc/qkind.go b/internal/gotc/qkind.go index d1959de2a..02a0a43a2 100644 --- a/internal/gotc/qkind.go +++ b/internal/gotc/qkind.go @@ -48,6 +48,55 @@ var qdiscUtils = map[string]*qdiscUtil{ xtcpnl.TcKindNetem: {id: xtcpnl.TcKindNetem, printQopt: printNetemOpt, printXstats: printNetemXstats}, xtcpnl.TcKindIngress: {id: xtcpnl.TcKindIngress, printQopt: printIngressOpt}, xtcpnl.TcKindClsact: {id: xtcpnl.TcKindClsact, printQopt: func(*runner, *qdiscUtil, []byte, bool) {}}, + xtcpnl.TcKindDrr: {id: xtcpnl.TcKindDrr, printQopt: printDrrOpt, printCopt: printDrrOpt, printXstats: printDrrXstats}, + xtcpnl.TcKindQfq: {id: xtcpnl.TcKindQfq, printQopt: printQfqOpt, printCopt: printQfqOpt}, + xtcpnl.TcKindHfsc: {id: xtcpnl.TcKindHfsc, printQopt: printHfscOpt, printCopt: printHfscClassOpt, printXstats: printHfscXstats}, + xtcpnl.TcKindEts: {id: xtcpnl.TcKindEts, printQopt: printEtsOpt, printCopt: printEtsCopt}, + xtcpnl.TcKindMqprio: {id: xtcpnl.TcKindMqprio, printQopt: printMqprioOpt}, + xtcpnl.TcKindTaprio: {id: xtcpnl.TcKindTaprio, printQopt: printTaprioOpt, printXstats: printTaprioXstats}, + xtcpnl.TcKindMultiq: {id: xtcpnl.TcKindMultiq, printQopt: printMultiqOpt}, + xtcpnl.TcKindCbs: {id: xtcpnl.TcKindCbs, printQopt: printCbsOpt}, + xtcpnl.TcKindEtf: {id: xtcpnl.TcKindEtf, printQopt: printEtfOpt}, +} + +// refuseKind records a qdisc_util printer's refusal of what tc would read +// unchecked. The print hooks return nothing, as print_qdisc and print_class +// ignore tc's returns, so their callers take the refusal after each hook. +func (r *runner) refuseKind(err error) { + if r.kindErr == nil { + r.kindErr = err + } +} + +// takeKindErr is the refusal a hook recorded, cleared. +func (r *runner) takeKindErr() error { + err := r.kindErr + r.kindErr = nil + return err +} + +// kindNeed refuses an attribute tc reads n bytes of without testing its +// length; ok is false after a refusal. +func (r *runner) kindNeed(kind, what string, b []byte, n int) bool { + if err := attrNeed(kind, what, b, n); err != nil { + r.refuseKind(err) + return false + } + return true +} + +// rtaWalk is the RTA_OK/RTA_NEXT loop over data: fn sees each attribute's +// raw type, flags included, and payload, and a malformed attribute ends the +// walk silently. +func rtaWalk(data []byte, fn func(raw uint16, val []byte)) { + for n := 0; len(data)-n >= xtcpnl.RTAttrSizeCst; { + l := int(attrLenAt(data, n)) + if l < xtcpnl.RTAttrSizeCst || l > len(data)-n { + return + } + fn(uint16(data[n+2])|uint16(data[n+3])<<8, data[n+xtcpnl.RTAttrSizeCst:n+l]) + n += (l + 3) &^ 3 + } } // qdiscKind is get_qdisc_kind: a printed kind's util, print_noqopt's for a diff --git a/internal/gotc/readback_test.go b/internal/gotc/readback_test.go index 082d773e5..7923acba4 100644 --- a/internal/gotc/readback_test.go +++ b/internal/gotc/readback_test.go @@ -23,17 +23,18 @@ const tdcGlob = "../../pkg/xtcpnl/testdata/*/ws/tdc" // readbackSkips pins how many readbacks each out-of-slice kind takes away, // so a decoder that starts (or stops) refusing one shows. var readbackSkips = map[string]int{ - "cake": 19, "cake_mq": 22, "cbs": 10, "choke": 7, "codel": 13, "drr": 13, "dualpi2": 14, "etf": 4, - "ets": 33, "fq_pie": 2, "gred": 6, "hfsc": 10, "hhf": 14, "mqprio": 2, "multiq": 3, "pie": 1, - "plug": 7, "qfq": 10, "red": 10, "sfb": 13, "skbprio": 4, "taprio": 8, + "cake": 19, "cake_mq": 22, "choke": 7, "codel": 13, "dualpi2": 14, "fq_pie": 2, "gred": 6, + "hhf": 14, "pie": 1, "plug": 11, "red": 10, "sfb": 13, "skbprio": 4, } // readbackRendered pins how many readbacks render exactly: 216 qdisc and // class shows, 273 filter and chain shows and gets, and 398 `tc actions` // lists and gets (increment 12's 887), then increment 13's 138: 5 bpf // filter shows and 133 readbacks holding pedit, tunnel_key, ife, ct, gate -// or bpf, in filters and in `tc actions`. None is eBPF. -const readbackRendered = 1025 +// or bpf, in filters and in `tc actions`. None is eBPF. Increment 15's +// nine kinds add 89 (two of them taprio under -d with a size table); 4 +// more readbacks of those kinds also hold plug, and are now plug's. +const readbackRendered = 1114 // kindRefused is a refusal by name: a qdisc kind is its bare name, the // filter path's are prefixed (filter:, action:, ematch:). diff --git a/internal/gotc/sched_test.go b/internal/gotc/sched_test.go new file mode 100644 index 000000000..c48965365 --- /dev/null +++ b/internal/gotc/sched_test.go @@ -0,0 +1,284 @@ +package gotc + +import ( + "bytes" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/pkg/xtcpnl" + "golang.org/x/sys/unix" +) + +// The increment-15 kinds (drr, qfq, hfsc, ets, mqprio, taprio, multiq, cbs, +// etf) against scripted replies: one row per lead the tcsched corpus pins, +// so a mutant that breaks one fails here by name, and the crafted paths +// the kernel never sends (short attributes, num_tc past 16, 17 rates). +// +// go test ./internal/gotc/ -run TestGotcSched + +// nestOpts is a TCA_OPTIONS nest; rawOpts a TCA_OPTIONS of raw bytes. +func nestOpts(kids ...[]byte) []byte { return attr(xtcpnl.TcaOptions|unix.NLA_F_NESTED, cat(kids...)) } +func rawOpts(b []byte) []byte { return attr(xtcpnl.TcaOptions, b) } + +// schedQ is a qdisc 1: at the root of d0 with refcnt 2. +func schedQ(k string, a ...[]byte) Msg { + return qmsg(tcBody(2, 0x10000, tcHRoot, 2, append([][]byte{kind(k)}, a...)...)) +} + +// schedC is class 1:minor of kind k under parent. +func schedC(k string, minor, parent uint32, a ...[]byte) Msg { + return cmsg(tcBody(2, 0x10000|minor, parent, 0, append([][]byte{kind(k)}, a...)...)) +} + +func showD0(m ...Msg) []Reply { + return []Reply{rep(linkMsg(2, "d0")), rep(append(m, done())...)} +} + +// mqprioQopt is a struct tc_mqprio_qopt: num_tc, map {0 0 1 1}, and +// counts and offsets for the first two classes. +func mqprioQopt(numTc uint8, c0, o0, c1, o1 uint16) []byte { + b := make([]byte, xtcpnl.TcMqprioQoptSizeCst) + b[0] = numTc + b[3], b[4] = 1, 1 + copy(b[18:], le16(c0)) + copy(b[20:], le16(c1)) + copy(b[50:], le16(o0)) + copy(b[52:], le16(o1)) + return b +} + +// mqprioTail is the header padded to RTA_ALIGN, then attrs. +func mqprioTail(hdr []byte, attrs ...[]byte) []byte { return cat(hdr, []byte{0, 0}, cat(attrs...)) } + +// tcEntry is a TCA_*_TC_ENTRY nest: index, then the extra attributes. +func tcEntry(entry uint16, index uint32, extra ...[]byte) []byte { + return attr(entry|unix.NLA_F_NESTED, cat(attr(1, le32(index)), cat(extra...))) +} + +// mqprioEntries is the 16 entries the kernel always sends, fp express. +func mqprioEntries() []byte { + var b []byte + for i := range uint32(16) { + b = cat(b, tcEntry(xtcpnl.TcaMqprioTcEntry, i, attr(xtcpnl.TcaMqprioTcEntryFp, le32(xtcpnl.TcFpExpress)))) + } + return b +} + +func mqprioRates(t uint16, n int) []byte { + var kids []byte + for i := range n { + kids = cat(kids, attr(t, le64(uint64(125000*(i+1))))) + } + return attr(t, kids) // nla_nest_start_noflag +} + +// sc is a struct tc_service_curve. +func sc(m1, d, m2 uint32) []byte { return cat(le32(m1), le32(d), le32(m2)) } + +// taprioOpts is a taprio TCA_OPTIONS: the priomap (num_tc 2, 4@0 4@4) and +// the given attributes, then 2 tc entries with max-sdu and fp. +func taprioOpts(numTc uint8, a ...[]byte) []byte { + ents := cat( + tcEntry(xtcpnl.TcaTaprioAttrTcEntry, 0, attr(xtcpnl.TcaTaprioTcEntryMaxSdu, le32(0)), attr(xtcpnl.TcaTaprioTcEntryFp, le32(1))), + tcEntry(xtcpnl.TcaTaprioAttrTcEntry, 1, attr(xtcpnl.TcaTaprioTcEntryMaxSdu, le32(1500)), attr(xtcpnl.TcaTaprioTcEntryFp, le32(2)))) + return nestOpts(attr(xtcpnl.TcaTaprioAttrPriomap, mqprioQopt(numTc, 4, 0, 4, 4)), cat(a...), ents) +} + +// taprioEntry is one schedule entry. +func taprioEntry(index uint32, cmd uint8, gate, interval uint32) []byte { + return attr(1|unix.NLA_F_NESTED, cat(attr(xtcpnl.TcaTaprioSchedEntryIndex, le32(index)), + attr(xtcpnl.TcaTaprioSchedEntryCmd, []byte{cmd}), attr(xtcpnl.TcaTaprioSchedEntryGateMask, le32(gate)), + attr(xtcpnl.TcaTaprioSchedEntryInterval, le32(interval)))) +} + +func taprioSched(base, cycle int64, ents ...[]byte) []byte { + return cat(attr(xtcpnl.TcaTaprioAttrSchedBaseTime, le64(uint64(base))), + attr(xtcpnl.TcaTaprioAttrSchedCycleTime, le64(uint64(cycle))), + attr(xtcpnl.TcaTaprioAttrSchedCycleTimeExtension, le64(0)), + attr(xtcpnl.TcaTaprioAttrSchedEntryList|unix.NLA_F_NESTED, cat(ents...))) +} + +func etsOpts(quanta ...[]byte) []byte { + pm := make([][]byte, 16) + for i := range pm { + pm[i] = attr(xtcpnl.TcaEtsPriomapBand, []byte{2}) + } + pm[1] = attr(xtcpnl.TcaEtsPriomapBand, []byte{1}) + pm[2] = attr(xtcpnl.TcaEtsPriomapBand, []byte{0}) + return nestOpts(attr(xtcpnl.TcaEtsNbands, []byte{3}), attr(xtcpnl.TcaEtsNstrict, []byte{1}), + attr(xtcpnl.TcaEtsQuanta|unix.NLA_F_NESTED, cat(quanta...)), + attr(xtcpnl.TcaEtsPriomap|unix.NLA_F_NESTED, cat(pm...))) +} + +func band(q uint32) []byte { return attr(xtcpnl.TcaEtsQuantaBand, le32(q)) } + +func hfscStats(work, rtwork uint64, period, level uint32) []byte { + return stats2(basic(0, 0), attr(xtcpnl.TcaStatsApp, cat(le64(work), le64(rtwork), le32(period), le32(level)))) +} + +const fp16E = " E E E E E E E E E E E E E E E E" + +func TestGotcSched(t *testing.T) { + drrClass := schedC("drr", 1, tcHRoot, nestOpts(attr(xtcpnl.TcaDrrQuantum, le32(1514))), + stats2(basic(0, 0), attr(xtcpnl.TcaStatsApp, le32(0)))) + hfscQ := schedQ("hfsc", rawOpts(le16(0x10))) + mqprio := schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), mqprioEntries()))) + taprio := schedQ("taprio", taprioOpts(2, attr(xtcpnl.TcaTaprioAttrSchedClockid, le32(11)), + attr(xtcpnl.TcaTaprioAttrFlags, le32(1)), attr(xtcpnl.TcaTaprioAttrTxtimeDelay, le32(200000)), + taprioSched(1000000000, 500000, taprioEntry(0, 0, 1, 300000), taprioEntry(1, 1, 2, 200000)), + attr(xtcpnl.TcaTaprioAttrAdminSched|unix.NLA_F_NESTED, taprioSched(4000000000000000000, 100000, taprioEntry(0, 2, 3, 100000))))) + taprioText := "qdisc taprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0\n" + + "queues offset 0 count 4 offset 4 count 4\n" + tsn := []Msg{ + schedQ("cbs", nestOpts(attr(xtcpnl.TcaCbsParms, cat([]byte{0, 0, 0, 0}, le32(30), le32(0xfffffa42), le32(20000), le32(0xfff10be0))))), + schedQ("etf", nestOpts(attr(xtcpnl.TcaEtfParms, cat(le32(300000), le32(11), le32(xtcpnl.TcEtfSkipSockCheckOn))))), + } + tests := []struct { + description string + args []string + replies []Reply + expected result + }{ + // Positive. + {"positive: drr class quantum and deficit in text (Q37, Q38)", []string{"-s", "class", "show", "dev", "d0"}, + showD0(drrClass), result{stdout: "class drr 1:1 root quantum 1514b \n Sent 0 bytes 0 pkt\n deficit 0b \n"}}, + {"positive: drr quantum and deficit absent in -j (Q37, Q38)", []string{"-j", "-s", "class", "show", "dev", "d0"}, + showD0(drrClass), result{stdout: `[{"class":"drr","handle":"1:1","root":true,"stats":{"bytes":0,"packets":0}}]` + "\n"}}, + {"positive: qfq class, its xstats unprinted (Q39)", []string{"-s", "class", "show", "dev", "d0"}, + showD0(schedC("qfq", 1, tcHRoot, nestOpts(attr(xtcpnl.TcaQfqWeight, le32(1)), attr(xtcpnl.TcaQfqLmax, le32(1514))), + stats2(basic(0, 0), attr(xtcpnl.TcaStatsApp, cat(le32(1), le32(1514)))))), + result{stdout: "class qfq 1:1 root weight 1 maxpkt 1514 \n Sent 0 bytes 0 pkt\n"}}, + {"positive: hfsc default 10, two spaces (Q40)", []string{"qdisc", "show", "dev", "d0"}, + showD0(hfscQ), result{stdout: "qdisc hfsc 1: root refcnt 2 default 0x10 \n"}}, + {"positive: hfsc default as a JSON string (Q40)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(hfscQ), result{stdout: `[{"kind":"hfsc","handle":"1:","root":true,"refcnt":2,"options":{"default":"0x10"}}]` + "\n"}}, + {"positive: hfsc rt equal to ls is one sc (Q43)", []string{"class", "show", "dev", "d0"}, + showD0(schedC("hfsc", 0x20, 0x10001, nestOpts(attr(xtcpnl.TcaHfscRsc, sc(0, 0, 125000)), attr(xtcpnl.TcaHfscFsc, sc(0, 0, 125000))))), + result{stdout: "class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 1Mbit \n"}}, + {"positive: hfsc rt, ls and ul, d in us in JSON (Q44)", []string{"-j", "class", "show", "dev", "d0"}, + showD0(schedC("hfsc", 0x10, 0x10001, nestOpts(attr(xtcpnl.TcaHfscRsc, sc(250000, 10000, 125000)), + attr(xtcpnl.TcaHfscFsc, sc(0, 0, 375000)), attr(xtcpnl.TcaHfscUsc, sc(0, 0, 500000))))), + result{stdout: `[{"class":"hfsc","handle":"1:10","parent":"1:1","rt":{"m1":250000,"d":10000,"m2":125000},` + + `"ls":{"m1":0,"d":0,"m2":375000},"ul":{"m1":0,"d":0,"m2":500000}}]` + "\n"}}, + {"positive: ets bands 3 strict 1, arrays ending in a space (Q45)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("ets", etsOpts(band(1500), band(3000)))), + result{stdout: "qdisc ets 1: root refcnt 2 bands 3 strict 1 quanta 1500 3000 priomap 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 2 \n"}}, + {"positive: ets classes, the strict one without a quantum (Q46)", []string{"-j", "class", "show", "dev", "d0"}, + showD0(schedC("ets", 1, tcHRoot, nestOpts()), schedC("ets", 2, tcHRoot, nestOpts(band(1500)))), + result{stdout: `[{"class":"ets","handle":"1:1","root":true},{"class":"ets","handle":"1:2","root":true,"quantum":1500}]` + "\n"}}, + {"positive: mqprio hw 0: dcb mode and shaper, 16 fp, a blank line (Q49, Q50)", []string{"qdisc", "show", "dev", "d0"}, + showD0(mqprio), result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n" + + " queues:(0:3) (4:7) \n mode:dcb\n shaper:dcb\n fp:" + fp16E + "\n\n"}}, + {"positive: mqprio JSON queues as pairs, map without its space (Q51, Q52)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), attr(xtcpnl.TcaMqprioMode, le16(1)))))), + result{stdout: `[{"kind":"mqprio","handle":"1:","root":true,"refcnt":2,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],` + + `"queues":[[0,3],[4,7]],"mode":"channel","shaper":"dcb"}}]` + "\n"}}, + {"positive: taprio oper and an unlabelled admin schedule (Q55, Q57, Q58)", []string{"qdisc", "show", "dev", "d0"}, + showD0(taprio), result{stdout: taprioText + "clockid TAI flags 0x1 txtime delay 200000" + + "\tbase-time 1000000000 cycle-time 500000 cycle-time-extension 0\n" + + "\tindex 0 cmd S gatemask 0x1 interval 300000\n\tindex 1 cmd H gatemask 0x2 interval 200000\n" + + "\tbase-time 4000000000000000000 cycle-time 100000 cycle-time-extension 0\n" + + "\tindex 0 cmd R gatemask 0x3 interval 100000\nmax-sdu 0 1500\nfp E P\n\n"}}, + {"positive: taprio JSON max-sdu with a hyphen, admin as an object (Q56)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(taprio), result{stdout: `[{"kind":"taprio","handle":"1:","root":true,"refcnt":2,"options":{"tc":2,` + + `"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],` + + `"clockid":"TAI","flags":"0x1","txtime_delay":200000,"base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,` + + `"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"H","gatemask":"0x2","interval":200000}],` + + `"admin":{"base_time":4000000000000000000,"cycle_time":100000,"cycle_time_extension":0,` + + `"schedule":[{"index":0,"cmd":"R","gatemask":"0x3","interval":100000}]},"max-sdu":[0,1500],"fp":["E","P"]}}]` + "\n"}}, + {"positive: multiq bands 8/8 (Q60)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("multiq", rawOpts(cat(le16(8), le16(8))))), result{stdout: "qdisc multiq 1: root refcnt 2 bands 8/8 \n"}}, + {"positive: cbs and etf text (Q63)", []string{"qdisc", "show", "dev", "d0"}, showD0(tsn...), + result{stdout: "qdisc cbs 1: root refcnt 2 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0 \n" + + "qdisc etf 1: root refcnt 2 clockid TAI delta 300000 offload off deadline_mode off skip_sock_check on\n"}}, + {"positive: cbs offload a number, etf's a string (Q61)", []string{"-j", "qdisc", "show", "dev", "d0"}, showD0(tsn...), + result{stdout: `[{"kind":"cbs","handle":"1:","root":true,"refcnt":2,"options":{"hicredit":30,"locredit":-1470,"sendslope":-980000,` + + `"idleslope":20000,"offload":0}},{"kind":"etf","handle":"1:","root":true,"refcnt":2,"options":{"clockid":"TAI","delta":300000,` + + `"offload":"off","deadline_mode":"off","skip_sock_check":"on"}}]` + "\n"}}, + // Negative. + {"negative: an ets quanta list short of a band stops, its array open (Q47)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("ets", etsOpts(band(1500), attr(xtcpnl.TcaEtsPriomapBand, []byte{1})))), + result{stdout: "qdisc ets 1: root refcnt 2 bands 3 strict 1 quanta 1500\n", stderr: "No ETS band quantum\n"}}, + {"negative: an ets quanta list short of a band leaves -j's array open (Q47)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("ets", etsOpts(band(1500), attr(xtcpnl.TcaEtsPriomapBand, []byte{1})))), + result{stdout: `[{"kind":"ets","handle":"1:","root":true,"refcnt":2,"options":{"bands":3,"strict":1,"quanta":[1500}}]` + "\n", + stderr: "No ETS band quantum\n"}}, + {"negative: a 1-byte mqprio mode is refused (Q54)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), attr(xtcpnl.TcaMqprioMode, []byte{1}))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n queues:(0:3) (4:7) ", + stderr: "gotc: not implemented: mqprio mode of 1 bytes (tc reads it unchecked)\n", rc: 255}}, + {"negative: a short taprio PRIOMAP is refused (Q54)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("taprio", nestOpts(attr(xtcpnl.TcaTaprioAttrPriomap, make([]byte, 20))))), + result{stdout: "qdisc taprio 1: root refcnt 2 ", + stderr: "gotc: not implemented: taprio parameters of 20 bytes (tc reads it unchecked)\n", rc: 255}}, + {"negative: red, an increment-16 kind, is refused by name", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("red")), result{stderr: "gotc: not implemented: qdisc kind \"red\"\n", rc: 255}}, + {"negative: mqprio options short of RTA_ALIGN(sizeof)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioQopt(2, 4, 0, 4, 4)))), + result{stdout: "qdisc mqprio 1: root refcnt 2 \n", stderr: "options size error\n"}}, + // Boundary. + {"boundary: an mqprio queue of count 0 ends at 4294967295 (Q51)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(1, 0, 0, 0, 0))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 tc 1 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n queues:(0:4294967295) \n"}}, + {"boundary: 17 mqprio min rates stop at 16, num_tc printed (Q53)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), attr(xtcpnl.TcaMqprioShaper, le16(1)), + mqprioRates(xtcpnl.TcaMqprioMinRate64, 17))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n queues:(0:3) (4:7) \n" + + " mode:dcb\n shaper:bw_rlimit\tmin_rate:1Mbit 2Mbit \n"}}, + {"boundary: an mqprio num_tc of 17 is refused", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(17, 4, 0, 4, 4))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 ", + stderr: "gotc: not implemented: mqprio num_tc 17 (tc reads it unchecked)\n", rc: 255}}, + {"boundary: a tc entry index of 16 is tc's message, skipped", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), + tcEntry(xtcpnl.TcaMqprioTcEntry, 16, attr(xtcpnl.TcaMqprioTcEntryFp, le32(2))))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n queues:(0:3) (4:7) \n" + + " mode:dcb\n shaper:dcb\n", stderr: "Unexpected tc entry index 16\n"}}, + // Corner. + {"corner: mqprio's hard newlines survive -o (Q48)", []string{"-o", "qdisc", "show", "dev", "d0"}, + showD0(mqprio), result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n" + + " queues:(0:3) (4:7) \n mode:dcb\n shaper:dcb\n fp:" + fp16E + "\\\\"}}, // print_nl twice: _SL_ is "\\" + {"corner: taprio TXTIME_DELAY 0x80000000 is signed in text (Q55)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("taprio", taprioOpts(2, attr(xtcpnl.TcaTaprioAttrTxtimeDelay, le32(0x80000000))))), + result{stdout: taprioText + " txtime delay -2147483648max-sdu 0 1500\nfp E P\n\n"}}, + {"corner: taprio TXTIME_DELAY 0x80000000 is unsigned in JSON (Q55)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("taprio", taprioOpts(2, attr(xtcpnl.TcaTaprioAttrTxtimeDelay, le32(0x80000000))))), + result{stdout: `[{"kind":"taprio","handle":"1:","root":true,"refcnt":2,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],` + + `"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"txtime_delay":2147483648,"max-sdu":[0,1500],"fp":["E","P"]}}]` + "\n"}}, + {"corner: a negative base-time, signed in text, unsigned in JSON (Q59)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("taprio", taprioOpts(2, attr(xtcpnl.TcaTaprioAttrSchedBaseTime, le64(0xffffffffffffffff))))), + result{stdout: `[{"kind":"taprio","handle":"1:","root":true,"refcnt":2,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],` + + `"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"base_time":18446744073709551615,"max-sdu":[0,1500],"fp":["E","P"]}}]` + "\n"}}, + {"corner: an explicit mqprio mode dcb prints nothing, an absent one mode:dcb (Q65)", []string{"qdisc", "show", "dev", "d0"}, + showD0(schedQ("mqprio", rawOpts(mqprioTail(mqprioQopt(2, 4, 0, 4, 4), attr(xtcpnl.TcaMqprioMode, le16(xtcpnl.TcMqprioModeDcb)))))), + result{stdout: "qdisc mqprio 1: root refcnt 2 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 \n queues:(0:3) (4:7) " + + "\n shaper:dcb\n"}}, + {"corner: a negative etf delta, signed in text, unsigned in JSON (Q62)", []string{"-j", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("etf", nestOpts(attr(xtcpnl.TcaEtfParms, cat(le32(0xffffffff), le32(11), le32(0)))))), + result{stdout: `[{"kind":"etf","handle":"1:","root":true,"refcnt":2,"options":{"clockid":"TAI","delta":4294967295,` + + `"offload":"off","deadline_mode":"off","skip_sock_check":"off"}}]` + "\n"}}, + {"corner: hfsc -s: work only when nonzero, then a blank line (Q41, Q42)", []string{"-s", "class", "show", "dev", "d0"}, + showD0(schedC("hfsc", 1, tcHRoot, hfscStats(0, 0, 0, 2)), schedC("hfsc", 2, tcHRoot, hfscStats(1500, 0, 3, 0))), + result{stdout: "class hfsc 1:1 root \n Sent 0 bytes 0 pkt\n period 0 level 2 \n\n" + + "class hfsc 1:2 root \n Sent 0 bytes 0 pkt\n period 3 work 1500 bytes level 0 \n\n"}}, + {"corner: -g class show prints hfsc's curves", []string{"-g", "class", "show", "dev", "d0"}, + showD0(schedC("hfsc", 0x10, tcHRoot, nestOpts(attr(xtcpnl.TcaHfscRsc, sc(0, 0, 125000))))), + result{stdout: "+---(1:10) hfsc rt m1 0bit d 0us m2 1Mbit \n\n"}}, + {"corner: -d prints taprio's size table overhead", []string{"-d", "qdisc", "show", "dev", "d0"}, + showD0(schedQ("multiq", rawOpts(cat(le16(8), le16(8))), + attr(xtcpnl.TcaStab|unix.NLA_F_NESTED, attr(xtcpnl.TcaStabBase, cat([]byte{0, 0, 0, 0}, le32(24), le32(0), le32(0), le32(0), le32(0)))))), + result{stdout: "qdisc multiq 1: root refcnt 2 bands 8/8 \n overhead 24 \n"}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + src := &fakeSource{replies: tc.replies} + var out, errb bytes.Buffer + cfg := config{src: src, stdin: strings.NewReader(""), sys: emptySys(t)} + rc := run(cfg, tc.args, &out, &errb) + got := result{stdout: out.String(), stderr: errb.String(), rc: rc, pending: len(src.replies)} + if got != tc.expected { + t.Errorf("tc %q\n got %#v\n want %#v", tc.args, got, tc.expected) + } + }) + } +} diff --git a/internal/gotc/util.go b/internal/gotc/util.go index 35d0a4526..4d6aff444 100644 --- a/internal/gotc/util.go +++ b/internal/gotc/util.go @@ -132,7 +132,7 @@ func sprintLinklayer(ll uint8) string { case 2: return "atm" } - return "unknown" + return wordUnknown } // xmitsize is tc_calc_xmitsize: ((double)rate * tc_core_tick2time(ticks)) diff --git a/nix/microvms/workbench/tcsched.rows.jsonl b/nix/microvms/workbench/tcsched.rows.jsonl new file mode 100644 index 000000000..aa1c3a4bf --- /dev/null +++ b/nix/microvms/workbench/tcsched.rows.jsonl @@ -0,0 +1,90 @@ +# Generated by `nlcapgen matrix -family tcsched -seed 1 -random 0`. +# Do not edit; regenerate. tools/nlcapgen/matrix.go explains the strategies. +# 87 rows. +{"id":"tcsched/ec-001","desc":"corner: opt=plain cmd=schdrr:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-002","desc":"positive: opt=json cmd=schdrr:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"1","words":"class show dev d0"}} +{"id":"tcsched/ec-003","desc":"positive: opt=plain cmd=schdrr:-s_class_show_dev_d0","cmd":"tc -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"0","words":"-s class show dev d0"}} +{"id":"tcsched/ec-004","desc":"corner: opt=plain cmd=schdrr:-g_class_show_dev_d0","cmd":"tc -g class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"0","words":"-g class show dev d0"}} +{"id":"tcsched/ec-005","desc":"corner: opt=plain cmd=schqfq:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-006","desc":"positive: opt=plain cmd=schqfq:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"0","words":"class show dev d0"}} +{"id":"tcsched/ec-007","desc":"corner: opt=plain cmd=schqfq:-s_class_show_dev_d0","cmd":"tc -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"0","words":"-s class show dev d0"}} +{"id":"tcsched/ec-008","desc":"positive: opt=plain cmd=schhfsc:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-009","desc":"positive: opt=plain cmd=schhfsc:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"0","words":"class show dev d0"}} +{"id":"tcsched/ec-010","desc":"corner: opt=plain cmd=schhfsc:-s_class_show_dev_d0","cmd":"tc -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"0","words":"-s class show dev d0"}} +{"id":"tcsched/ec-011","desc":"corner: opt=plain cmd=schhfsc:-g_class_show_dev_d0","cmd":"tc -g class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"0","words":"-g class show dev d0"}} +{"id":"tcsched/ec-012","desc":"positive: opt=plain cmd=schhfsc:class_show_dev_d0_classid_1:10","cmd":"tc class show dev d0 classid 1:10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"0","words":"class show dev d0 classid 1:10"}} +{"id":"tcsched/ec-013","desc":"boundary: opt=plain cmd=schhfsc0:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 2: hfsc"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc0","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-014","desc":"boundary: opt=plain cmd=schhfsc0:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 2: hfsc"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc0","json":"0","words":"class show dev d0"}} +{"id":"tcsched/ec-015","desc":"positive: opt=plain cmd=schets:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-016","desc":"positive: opt=plain cmd=schets:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"0","words":"class show dev d0"}} +{"id":"tcsched/ec-017","desc":"positive: opt=plain cmd=schets:-s_class_show_dev_d0","cmd":"tc -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"0","words":"-s class show dev d0"}} +{"id":"tcsched/ec-018","desc":"corner: opt=plain cmd=schets:-o_qdisc_show_dev_d0","cmd":"tc -o qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"0","words":"-o qdisc show dev d0"}} +{"id":"tcsched/ec-019","desc":"boundary: opt=plain cmd=schets0:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets strict 3"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets0","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-020","desc":"boundary: opt=plain cmd=schets0:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets strict 3"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets0","json":"0","words":"class show dev d0"}} +{"id":"tcsched/ec-021","desc":"positive: opt=plain cmd=schtsn:qdisc_show_dev_d0","cmd":"tc qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"0","words":"qdisc show dev d0"}} +{"id":"tcsched/ec-022","desc":"positive: opt=plain cmd=schtsn:-s_qdisc_show_dev_d0","cmd":"tc -s qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"0","words":"-s qdisc show dev d0"}} +{"id":"tcsched/ec-023","desc":"corner: opt=plain cmd=schtsn:qdisc_show_dev_d0_handle_10:","cmd":"tc qdisc show dev d0 handle 10:","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"0","words":"qdisc show dev d0 handle 10:"}} +{"id":"tcsched/ec-024","desc":"corner: opt=plain cmd=schtsn:qdisc_show_dev_d0_handle_20:","cmd":"tc qdisc show dev d0 handle 20:","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"0","words":"qdisc show dev d0 handle 20:"}} +{"id":"tcsched/ec-025","desc":"corner: opt=plain cmd=schtsn:-d_qdisc_show_dev_d0","cmd":"tc -d qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"0","words":"-d qdisc show dev d0"}} +{"id":"tcsched/ec-026","desc":"positive: opt=plain cmd=schmultiq:qdisc_show_dev_d1_root","cmd":"tc qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 1: multiq"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmultiq","json":"0","words":"qdisc show dev d1 root"}} +{"id":"tcsched/ec-027","desc":"positive: opt=plain cmd=schmultiq:class_show_dev_d1","cmd":"tc class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 1: multiq"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmultiq","json":"0","words":"class show dev d1"}} +{"id":"tcsched/ec-028","desc":"positive: opt=plain cmd=schmqprio:qdisc_show_dev_d1_root","cmd":"tc qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"0","words":"qdisc show dev d1 root"}} +{"id":"tcsched/ec-029","desc":"positive: opt=plain cmd=schmqprio:-s_qdisc_show_dev_d1_root","cmd":"tc -s qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"0","words":"-s qdisc show dev d1 root"}} +{"id":"tcsched/ec-030","desc":"corner: opt=plain cmd=schmqprio:-o_qdisc_show_dev_d1_root","cmd":"tc -o qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"0","words":"-o qdisc show dev d1 root"}} +{"id":"tcsched/ec-031","desc":"corner: opt=plain cmd=schmqprio:-d_qdisc_show_dev_d1_root","cmd":"tc -d qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"0","words":"-d qdisc show dev d1 root"}} +{"id":"tcsched/ec-032","desc":"positive: opt=plain cmd=schmqprio:class_show_dev_d1","cmd":"tc class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"0","words":"class show dev d1"}} +{"id":"tcsched/ec-033","desc":"positive: opt=plain cmd=schtaprio:qdisc_show_dev_d1_root","cmd":"tc qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"0","words":"qdisc show dev d1 root"}} +{"id":"tcsched/ec-034","desc":"positive: opt=plain cmd=schtaprio:-s_qdisc_show_dev_d1_root","cmd":"tc -s qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"0","words":"-s qdisc show dev d1 root"}} +{"id":"tcsched/ec-035","desc":"corner: opt=plain cmd=schtaprio:-o_qdisc_show_dev_d1_root","cmd":"tc -o qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"0","words":"-o qdisc show dev d1 root"}} +{"id":"tcsched/ec-036","desc":"positive: opt=plain cmd=schtaprio:qdisc_show_dev_d1","cmd":"tc qdisc show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"0","words":"qdisc show dev d1"}} +{"id":"tcsched/ec-037","desc":"positive: opt=plain cmd=schtaprio:class_show_dev_d1","cmd":"tc class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"0","words":"class show dev d1"}} +{"id":"tcsched/ec-038","desc":"corner: opt=plain cmd=schtaprio2:qdisc_show_dev_d1_root","cmd":"tc qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000","tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio2","json":"0","words":"qdisc show dev d1 root"}} +{"id":"tcsched/ec-039","desc":"boundary: opt=plain cmd=schtaprio3:qdisc_show_dev_d1_root","cmd":"tc qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio3","json":"0","words":"qdisc show dev d1 root"}} +{"id":"tcsched/ec-040","desc":"positive: opt=plain cmd=schhfsc:batch:qdisc-then-class","cmd":"tc -batch b.txt","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit","printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"qdisc-then-class","fix":"schhfsc","json":"0","words":"-batch b.txt"}} +{"id":"tcsched/ec-041","desc":"corner: opt=plain cmd=schtaprio2:batch:root-then-all","cmd":"tc -batch b.txt","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000","tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000","printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"root-then-all","fix":"schtaprio2","json":"0","words":"-batch b.txt"}} +{"id":"tcsched/pw-001","desc":"positive: opt=plain cmd=schdrr:class_show_dev_d0","cmd":"tc class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"0","words":"class show dev d0"}} +{"id":"tcsched/pw-002","desc":"corner: opt=json cmd=schdrr:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-003","desc":"positive: opt=json cmd=schdrr:-s_class_show_dev_d0","cmd":"tc -j -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"1","words":"-s class show dev d0"}} +{"id":"tcsched/pw-004","desc":"corner: opt=json cmd=schdrr:-g_class_show_dev_d0","cmd":"tc -j -g class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schdrr","json":"1","words":"-g class show dev d0"}} +{"id":"tcsched/pw-005","desc":"corner: opt=json cmd=schqfq:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-006","desc":"positive: opt=json cmd=schqfq:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"1","words":"class show dev d0"}} +{"id":"tcsched/pw-007","desc":"corner: opt=json cmd=schqfq:-s_class_show_dev_d0","cmd":"tc -j -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: qfq","tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514","tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schqfq","json":"1","words":"-s class show dev d0"}} +{"id":"tcsched/pw-008","desc":"positive: opt=json cmd=schhfsc:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-009","desc":"positive: opt=json cmd=schhfsc:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"1","words":"class show dev d0"}} +{"id":"tcsched/pw-010","desc":"corner: opt=json cmd=schhfsc:-s_class_show_dev_d0","cmd":"tc -j -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"1","words":"-s class show dev d0"}} +{"id":"tcsched/pw-011","desc":"corner: opt=json cmd=schhfsc:-g_class_show_dev_d0","cmd":"tc -j -g class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"1","words":"-g class show dev d0"}} +{"id":"tcsched/pw-012","desc":"positive: opt=json cmd=schhfsc:class_show_dev_d0_classid_1:10","cmd":"tc -j class show dev d0 classid 1:10","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc","json":"1","words":"class show dev d0 classid 1:10"}} +{"id":"tcsched/pw-013","desc":"boundary: opt=json cmd=schhfsc0:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 2: hfsc"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc0","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-014","desc":"boundary: opt=json cmd=schhfsc0:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 2: hfsc"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schhfsc0","json":"1","words":"class show dev d0"}} +{"id":"tcsched/pw-015","desc":"positive: opt=json cmd=schets:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-016","desc":"positive: opt=json cmd=schets:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"1","words":"class show dev d0"}} +{"id":"tcsched/pw-017","desc":"positive: opt=json cmd=schets:-s_class_show_dev_d0","cmd":"tc -j -s class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"1","words":"-s class show dev d0"}} +{"id":"tcsched/pw-018","desc":"corner: opt=json cmd=schets:-o_qdisc_show_dev_d0","cmd":"tc -j -o qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets","json":"1","words":"-o qdisc show dev d0"}} +{"id":"tcsched/pw-019","desc":"boundary: opt=json cmd=schets0:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets strict 3"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets0","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-020","desc":"boundary: opt=json cmd=schets0:class_show_dev_d0","cmd":"tc -j class show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: ets strict 3"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schets0","json":"1","words":"class show dev d0"}} +{"id":"tcsched/pw-021","desc":"positive: opt=json cmd=schtsn:qdisc_show_dev_d0","cmd":"tc -j qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"1","words":"qdisc show dev d0"}} +{"id":"tcsched/pw-022","desc":"positive: opt=json cmd=schtsn:-s_qdisc_show_dev_d0","cmd":"tc -j -s qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"1","words":"-s qdisc show dev d0"}} +{"id":"tcsched/pw-023","desc":"corner: opt=json cmd=schtsn:qdisc_show_dev_d0_handle_10:","cmd":"tc -j qdisc show dev d0 handle 10:","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"1","words":"qdisc show dev d0 handle 10:"}} +{"id":"tcsched/pw-024","desc":"corner: opt=json cmd=schtsn:qdisc_show_dev_d0_handle_20:","cmd":"tc -j qdisc show dev d0 handle 20:","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"1","words":"qdisc show dev d0 handle 20:"}} +{"id":"tcsched/pw-025","desc":"corner: opt=json cmd=schtsn:-d_qdisc_show_dev_d0","cmd":"tc -j -d qdisc show dev d0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtsn","json":"1","words":"-d qdisc show dev d0"}} +{"id":"tcsched/pw-026","desc":"positive: opt=json cmd=schmultiq:qdisc_show_dev_d1_root","cmd":"tc -j qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 1: multiq"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmultiq","json":"1","words":"qdisc show dev d1 root"}} +{"id":"tcsched/pw-027","desc":"positive: opt=json cmd=schmultiq:class_show_dev_d1","cmd":"tc -j class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 1: multiq"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmultiq","json":"1","words":"class show dev d1"}} +{"id":"tcsched/pw-028","desc":"positive: opt=json cmd=schmqprio:qdisc_show_dev_d1_root","cmd":"tc -j qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"1","words":"qdisc show dev d1 root"}} +{"id":"tcsched/pw-029","desc":"positive: opt=json cmd=schmqprio:-s_qdisc_show_dev_d1_root","cmd":"tc -j -s qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"1","words":"-s qdisc show dev d1 root"}} +{"id":"tcsched/pw-030","desc":"corner: opt=json cmd=schmqprio:-o_qdisc_show_dev_d1_root","cmd":"tc -j -o qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"1","words":"-o qdisc show dev d1 root"}} +{"id":"tcsched/pw-031","desc":"corner: opt=json cmd=schmqprio:-d_qdisc_show_dev_d1_root","cmd":"tc -j -d qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"1","words":"-d qdisc show dev d1 root"}} +{"id":"tcsched/pw-032","desc":"positive: opt=json cmd=schmqprio:class_show_dev_d1","cmd":"tc -j class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schmqprio","json":"1","words":"class show dev d1"}} +{"id":"tcsched/pw-033","desc":"positive: opt=json cmd=schtaprio:qdisc_show_dev_d1_root","cmd":"tc -j qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"1","words":"qdisc show dev d1 root"}} +{"id":"tcsched/pw-034","desc":"positive: opt=json cmd=schtaprio:-s_qdisc_show_dev_d1_root","cmd":"tc -j -s qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"1","words":"-s qdisc show dev d1 root"}} +{"id":"tcsched/pw-035","desc":"corner: opt=json cmd=schtaprio:-o_qdisc_show_dev_d1_root","cmd":"tc -j -o qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"1","words":"-o qdisc show dev d1 root"}} +{"id":"tcsched/pw-036","desc":"positive: opt=json cmd=schtaprio:qdisc_show_dev_d1","cmd":"tc -j qdisc show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"1","words":"qdisc show dev d1"}} +{"id":"tcsched/pw-037","desc":"positive: opt=json cmd=schtaprio:class_show_dev_d1","cmd":"tc -j class show dev d1","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio","json":"1","words":"class show dev d1"}} +{"id":"tcsched/pw-038","desc":"corner: opt=json cmd=schtaprio2:qdisc_show_dev_d1_root","cmd":"tc -j qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000","tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio2","json":"1","words":"qdisc show dev d1 root"}} +{"id":"tcsched/pw-039","desc":"boundary: opt=json cmd=schtaprio3:qdisc_show_dev_d1_root","cmd":"tc -j qdisc show dev d1 root","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"fix":"schtaprio3","json":"1","words":"qdisc show dev d1 root"}} +{"id":"tcsched/pw-040","desc":"positive: opt=json cmd=schhfsc:batch:qdisc-then-class","cmd":"tc -j -batch b.txt","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: hfsc default 10","tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit","tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit","tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit","printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"qdisc-then-class","fix":"schhfsc","json":"1","words":"-batch b.txt"}} +{"id":"tcsched/pw-041","desc":"corner: opt=json cmd=schtaprio2:batch:root-then-all","cmd":"tc -j -batch b.txt","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000","tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000","printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":0,"refused_by":"none"},"axes":{"batch":"root-then-all","fix":"schtaprio2","json":"1","words":"-batch b.txt"}} +{"id":"tcsched/ng-001","desc":"negative: opt=plain cmd=ng:schdrr:qdisc_add_dev_d0_parent_1:1_handle_10:_mqprio_num_tc_2_map_0_0_1_1_queues_1@0_1@1_hw_0: mqprio is root only, on a multi-queue device: a write gotc refuses","cmd":"tc qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":2,"errno":"ENOTSUP","refused_by":"kernel"},"axes":{"fix":"schdrr","json":"0","words":"qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0"}} +{"id":"tcsched/ng-002","desc":"negative: opt=plain cmd=ng:schmultiq:qdisc_replace_dev_d1_root_handle_100:_taprio_num_tc_2_map_0_0_1_1_queues_4@0_4@4_base-time_0_sched-entry_S_01_300000: taprio without a clockid","cmd":"tc qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 base-time 0 sched-entry S 01 300000","pre":["ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up","tc qdisc add dev d1 root handle 1: multiq"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":2,"errno":"EINVAL","refused_by":"kernel"},"axes":{"fix":"schmultiq","json":"0","words":"qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 base-time 0 sched-entry S 01 300000"}} +{"id":"tcsched/ng-003","desc":"negative: opt=plain cmd=ng:schtsn:qdisc_replace_dev_d0_parent_1:1_handle_10:_cbs_idleslope_20000_sendslope_-980000_hicredit_30_locredit_-1470_offload_1: cbs offload needs ndo_setup_tc","cmd":"tc qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470 offload 1","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470","tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":2,"errno":"ENOTSUP","refused_by":"kernel"},"axes":{"fix":"schtsn","json":"0","words":"qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470 offload 1"}} +{"id":"tcsched/ng-004","desc":"negative: opt=plain cmd=ng:schdrr:qdisc_add_dev_d0_parent_1:2_handle_20:_etf_clockid_CLOCK_TAI_delta_300000_offload: etf offload needs ndo_setup_tc","cmd":"tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":2,"errno":"ENOTSUP","refused_by":"kernel"},"axes":{"fix":"schdrr","json":"0","words":"qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload"}} +{"id":"tcsched/ng-005","desc":"negative: opt=plain cmd=ng:schdrr:class_show_dev_nosuch: no such device: Cannot find device, rc 1","cmd":"tc class show dev nosuch","pre":["ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up","tc qdisc add dev d0 root handle 1: drr","tc class add dev d0 parent 1: classid 1:1 drr quantum 1514","tc class add dev d0 parent 1: classid 1:2 drr"],"modules":["sch_cbs","sch_drr","sch_etf","sch_ets","sch_hfsc","sch_mqprio","sch_multiq","sch_prio","sch_qfq","sch_taprio"],"proto":"route","expect":{"rc":1,"errno":"ENODEV","refused_by":"kernel"},"axes":{"fix":"schdrr","json":"0","words":"class show dev nosuch"}} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/cmd.json new file mode 100644 index 000000000..86c8a0860 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "corner: opt=plain cmd=schdrr:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-001", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.out new file mode 100644 index 000000000..1b5f2613c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.out @@ -0,0 +1 @@ +qdisc drr 1: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.pcap new file mode 100644 index 000000000..8443f7090 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/cmd.json new file mode 100644 index 000000000..f43a7ecb5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "positive: opt=json cmd=schdrr:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-002", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.out new file mode 100644 index 000000000..715a69914 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.out @@ -0,0 +1 @@ +[{"class":"drr","handle":"1:1","root":true},{"class":"drr","handle":"1:2","root":true}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.pcap new file mode 100644 index 000000000..a6a582c30 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/cmd.json new file mode 100644 index 000000000..e65b5fa8d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "-s class show dev d0" + }, + "cmd": "tc -s class show dev d0", + "desc": "positive: opt=plain cmd=schdrr:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-003", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.out new file mode 100644 index 000000000..0640279e4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.out @@ -0,0 +1,8 @@ +class drr 1:1 root quantum 1514b + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + deficit 0b +class drr 1:2 root quantum 1514b + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + deficit 0b diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.pcap new file mode 100644 index 000000000..61155c1e8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/cmd.json new file mode 100644 index 000000000..095d84fce --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "-g class show dev d0" + }, + "cmd": "tc -g class show dev d0", + "desc": "corner: opt=plain cmd=schdrr:-g_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-004", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.out new file mode 100644 index 000000000..ba58c18fb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.out @@ -0,0 +1,3 @@ ++---(1:2) drr quantum 1514b ++---(1:1) drr quantum 1514b + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.pcap new file mode 100644 index 000000000..8e218aff9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/cmd.json new file mode 100644 index 000000000..516012982 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "corner: opt=plain cmd=schqfq:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-005", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.out new file mode 100644 index 000000000..a45cbbae9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.out @@ -0,0 +1 @@ +qdisc qfq 1: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.pcap new file mode 100644 index 000000000..d02c6b17a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/cmd.json new file mode 100644 index 000000000..0d293597f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "positive: opt=plain cmd=schqfq:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-006", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.out new file mode 100644 index 000000000..ef88e1d53 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.out @@ -0,0 +1,2 @@ +class qfq 1:1 root weight 1 maxpkt 1514 +class qfq 1:2 root weight 30 maxpkt 9000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.pcap new file mode 100644 index 000000000..e7ee72306 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/cmd.json new file mode 100644 index 000000000..708a30e10 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "0", + "words": "-s class show dev d0" + }, + "cmd": "tc -s class show dev d0", + "desc": "corner: opt=plain cmd=schqfq:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-007", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.out new file mode 100644 index 000000000..62b1ddd17 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.out @@ -0,0 +1,6 @@ +class qfq 1:1 root weight 1 maxpkt 1514 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +class qfq 1:2 root weight 30 maxpkt 9000 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.pcap new file mode 100644 index 000000000..ff31b1efb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/cmd.json new file mode 100644 index 000000000..ff362aa32 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "positive: opt=plain cmd=schhfsc:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-008", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.out new file mode 100644 index 000000000..d450b60a3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.out @@ -0,0 +1 @@ +qdisc hfsc 1: root refcnt 2 default 0x10 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.pcap new file mode 100644 index 000000000..11663eb69 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/cmd.json new file mode 100644 index 000000000..99d0fad8f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "positive: opt=plain cmd=schhfsc:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-009", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.out new file mode 100644 index 000000000..6f6cc5285 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.out @@ -0,0 +1,4 @@ +class hfsc 1: root +class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 10Mbit ul m1 0bit d 0us m2 20Mbit +class hfsc 1:10 parent 1:1 rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit +class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 1Mbit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.pcap new file mode 100644 index 000000000..155a4361d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/cmd.json new file mode 100644 index 000000000..57a9cc9dd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "0", + "words": "-s class show dev d0" + }, + "cmd": "tc -s class show dev d0", + "desc": "corner: opt=plain cmd=schhfsc:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-010", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.out new file mode 100644 index 000000000..b5777ca17 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.out @@ -0,0 +1,20 @@ +class hfsc 1: root + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + period 0 level 2 + +class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 10Mbit ul m1 0bit d 0us m2 20Mbit + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + period 0 level 1 + +class hfsc 1:10 parent 1:1 rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + period 0 level 0 + +class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 1Mbit + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 + period 0 level 0 + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.pcap new file mode 100644 index 000000000..d04220617 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/cmd.json new file mode 100644 index 000000000..e696c5e02 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "0", + "words": "-g class show dev d0" + }, + "cmd": "tc -g class show dev d0", + "desc": "corner: opt=plain cmd=schhfsc:-g_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-011", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.out new file mode 100644 index 000000000..87e24efe7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.out @@ -0,0 +1,7 @@ ++---(1:) hfsc + +---(1:1) hfsc sc m1 0bit d 0us m2 10Mbit ul m1 0bit d 0us m2 20Mbit + +---(1:10) hfsc rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit + +---(1:20) hfsc sc m1 0bit d 0us m2 1Mbit + + + | diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.pcap new file mode 100644 index 000000000..28a8d62d4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/cmd.json new file mode 100644 index 000000000..045053a3d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "0", + "words": "class show dev d0 classid 1:10" + }, + "cmd": "tc class show dev d0 classid 1:10", + "desc": "positive: opt=plain cmd=schhfsc:class_show_dev_d0_classid_1:10", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-012", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.out new file mode 100644 index 000000000..c845de8b2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.out @@ -0,0 +1 @@ +class hfsc 1:10 parent 1:1 rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.pcap new file mode 100644 index 000000000..2f03a0aab Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/cmd.json new file mode 100644 index 000000000..22f35600d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schhfsc0", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "boundary: opt=plain cmd=schhfsc0:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-013", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 2: hfsc" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 2: hfsc", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.out new file mode 100644 index 000000000..5bc936e82 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.out @@ -0,0 +1 @@ +qdisc hfsc 2: root refcnt 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.pcap new file mode 100644 index 000000000..968317e75 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/cmd.json new file mode 100644 index 000000000..628bcb634 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schhfsc0", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "boundary: opt=plain cmd=schhfsc0:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-014", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 2: hfsc" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 2: hfsc", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.out new file mode 100644 index 000000000..f3fb477fd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.out @@ -0,0 +1 @@ +class hfsc 2: root diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.pcap new file mode 100644 index 000000000..763349269 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/cmd.json new file mode 100644 index 000000000..e8f06c263 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "positive: opt=plain cmd=schets:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-015", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.out new file mode 100644 index 000000000..8a010b3e7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.out @@ -0,0 +1 @@ +qdisc ets 1: root refcnt 2 bands 3 strict 1 quanta 1500 3000 priomap 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.pcap new file mode 100644 index 000000000..75237f605 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/cmd.json new file mode 100644 index 000000000..3f9ac6bab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "positive: opt=plain cmd=schets:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-016", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.out new file mode 100644 index 000000000..9f2991bef --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.out @@ -0,0 +1,3 @@ +class ets 1:1 root +class ets 1:2 root quantum 1500 +class ets 1:3 root quantum 3000 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.pcap new file mode 100644 index 000000000..5f6f73a64 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/cmd.json new file mode 100644 index 000000000..d2f64ba61 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "0", + "words": "-s class show dev d0" + }, + "cmd": "tc -s class show dev d0", + "desc": "positive: opt=plain cmd=schets:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-017", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.out new file mode 100644 index 000000000..284c5f80f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.out @@ -0,0 +1,9 @@ +class ets 1:1 root + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +class ets 1:2 root quantum 1500 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +class ets 1:3 root quantum 3000 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.pcap new file mode 100644 index 000000000..dc4e8b018 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/cmd.json new file mode 100644 index 000000000..fa2134a36 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "0", + "words": "-o qdisc show dev d0" + }, + "cmd": "tc -o qdisc show dev d0", + "desc": "corner: opt=plain cmd=schets:-o_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-018", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.out new file mode 100644 index 000000000..7fc471831 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.out @@ -0,0 +1 @@ +qdisc ets 1: root refcnt 2 bands 3 strict 1 quanta 1500 3000 priomap 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 2 \ \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.pcap new file mode 100644 index 000000000..ce523d467 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/cmd.json new file mode 100644 index 000000000..206a98956 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets0", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "boundary: opt=plain cmd=schets0:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-019", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets strict 3" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets strict 3", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.out new file mode 100644 index 000000000..c47a9e483 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.out @@ -0,0 +1 @@ +qdisc ets 1: root refcnt 2 bands 3 strict 3 priomap 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.pcap new file mode 100644 index 000000000..3f0a30680 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/cmd.json new file mode 100644 index 000000000..aa4b031fd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets0", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "boundary: opt=plain cmd=schets0:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-020", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets strict 3" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets strict 3", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.out new file mode 100644 index 000000000..a4d8c848f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.out @@ -0,0 +1,3 @@ +class ets 1:1 root +class ets 1:2 root +class ets 1:3 root diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.pcap new file mode 100644 index 000000000..e113fe6fb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/cmd.json new file mode 100644 index 000000000..8f5cf6fd3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "qdisc show dev d0" + }, + "cmd": "tc qdisc show dev d0", + "desc": "positive: opt=plain cmd=schtsn:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-021", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.out new file mode 100644 index 000000000..6098cb610 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.out @@ -0,0 +1,4 @@ +qdisc prio 1: root refcnt 2 bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +qdisc pfifo 0: parent 10: limit 1000p +qdisc cbs 10: parent 1:1 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0 +qdisc etf 20: parent 1:2 clockid TAI delta 300000 offload off deadline_mode off skip_sock_check on diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.pcap new file mode 100644 index 000000000..bbcd3cb98 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-021/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/cmd.json new file mode 100644 index 000000000..e9b763972 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "-s qdisc show dev d0" + }, + "cmd": "tc -s qdisc show dev d0", + "desc": "positive: opt=plain cmd=schtsn:-s_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-022", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.out new file mode 100644 index 000000000..e9b362f8f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.out @@ -0,0 +1,12 @@ +qdisc prio 1: root refcnt 2 bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +qdisc pfifo 0: parent 10: limit 1000p + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +qdisc cbs 10: parent 1:1 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +qdisc etf 20: parent 1:2 clockid TAI delta 300000 offload off deadline_mode off skip_sock_check on + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.pcap new file mode 100644 index 000000000..49c7e9998 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-022/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/cmd.json new file mode 100644 index 000000000..c21115c77 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "qdisc show dev d0 handle 10:" + }, + "cmd": "tc qdisc show dev d0 handle 10:", + "desc": "corner: opt=plain cmd=schtsn:qdisc_show_dev_d0_handle_10:", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-023", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.out new file mode 100644 index 000000000..fcddd6208 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.out @@ -0,0 +1 @@ +qdisc cbs 10: parent 1:1 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.pcap new file mode 100644 index 000000000..f8625520d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-023/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/cmd.json new file mode 100644 index 000000000..5257db59b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "qdisc show dev d0 handle 20:" + }, + "cmd": "tc qdisc show dev d0 handle 20:", + "desc": "corner: opt=plain cmd=schtsn:qdisc_show_dev_d0_handle_20:", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-024", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.out new file mode 100644 index 000000000..3bc347f45 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.out @@ -0,0 +1 @@ +qdisc etf 20: parent 1:2 clockid TAI delta 300000 offload off deadline_mode off skip_sock_check on diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.pcap new file mode 100644 index 000000000..3a0c02812 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-024/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/cmd.json new file mode 100644 index 000000000..c2430551b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "-d qdisc show dev d0" + }, + "cmd": "tc -d qdisc show dev d0", + "desc": "corner: opt=plain cmd=schtsn:-d_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-025", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.out new file mode 100644 index 000000000..6098cb610 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.out @@ -0,0 +1,4 @@ +qdisc prio 1: root refcnt 2 bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +qdisc pfifo 0: parent 10: limit 1000p +qdisc cbs 10: parent 1:1 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0 +qdisc etf 20: parent 1:2 clockid TAI delta 300000 offload off deadline_mode off skip_sock_check on diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.pcap new file mode 100644 index 000000000..bc77be077 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-025/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/cmd.json new file mode 100644 index 000000000..a3de4508c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmultiq", + "json": "0", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc qdisc show dev d1 root", + "desc": "positive: opt=plain cmd=schmultiq:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-026", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 1: multiq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 1: multiq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.out new file mode 100644 index 000000000..69cf01906 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.out @@ -0,0 +1 @@ +qdisc multiq 1: root refcnt 9 bands 8/8 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.pcap new file mode 100644 index 000000000..57236adb9 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-026/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/cmd.json new file mode 100644 index 000000000..57f79759f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmultiq", + "json": "0", + "words": "class show dev d1" + }, + "cmd": "tc class show dev d1", + "desc": "positive: opt=plain cmd=schmultiq:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-027", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 1: multiq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 1: multiq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.out new file mode 100644 index 000000000..1360b051d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.out @@ -0,0 +1,8 @@ +class multiq 1:1 parent 1: +class multiq 1:2 parent 1: +class multiq 1:3 parent 1: +class multiq 1:4 parent 1: +class multiq 1:5 parent 1: +class multiq 1:6 parent 1: +class multiq 1:7 parent 1: +class multiq 1:8 parent 1: diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.pcap new file mode 100644 index 000000000..f9fa30437 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-027/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/cmd.json new file mode 100644 index 000000000..72ecc183b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "0", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc qdisc show dev d1 root", + "desc": "positive: opt=plain cmd=schmqprio:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-028", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.out new file mode 100644 index 000000000..1de61e0d4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.out @@ -0,0 +1,6 @@ +qdisc mqprio 100: root tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 + queues:(0:3) (4:7) + mode:dcb + shaper:dcb + fp: E E E E E E E E E E E E E E E E + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.pcap new file mode 100644 index 000000000..051212524 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-028/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/cmd.json new file mode 100644 index 000000000..5374c9676 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "0", + "words": "-s qdisc show dev d1 root" + }, + "cmd": "tc -s qdisc show dev d1 root", + "desc": "positive: opt=plain cmd=schmqprio:-s_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-029", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.out new file mode 100644 index 000000000..714cb5430 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.out @@ -0,0 +1,8 @@ +qdisc mqprio 100: root tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 + queues:(0:3) (4:7) + mode:dcb + shaper:dcb + fp: E E E E E E E E E E E E E E E E + + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.pcap new file mode 100644 index 000000000..86912d751 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-029/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/cmd.json new file mode 100644 index 000000000..39ae415b1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "0", + "words": "-o qdisc show dev d1 root" + }, + "cmd": "tc -o qdisc show dev d1 root", + "desc": "corner: opt=plain cmd=schmqprio:-o_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-030", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.out new file mode 100644 index 000000000..52fc4eddd --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.out @@ -0,0 +1,5 @@ +qdisc mqprio 100: root tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 + queues:(0:3) (4:7) + mode:dcb + shaper:dcb + fp: E E E E E E E E E E E E E E E E\\ \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.pcap new file mode 100644 index 000000000..3df88c115 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-030/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/cmd.json new file mode 100644 index 000000000..c41103594 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "0", + "words": "-d qdisc show dev d1 root" + }, + "cmd": "tc -d qdisc show dev d1 root", + "desc": "corner: opt=plain cmd=schmqprio:-d_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-031", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.out new file mode 100644 index 000000000..1de61e0d4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.out @@ -0,0 +1,6 @@ +qdisc mqprio 100: root tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 + queues:(0:3) (4:7) + mode:dcb + shaper:dcb + fp: E E E E E E E E E E E E E E E E + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.pcap new file mode 100644 index 000000000..ed133035d Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-031/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/cmd.json new file mode 100644 index 000000000..35a9bafaa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "0", + "words": "class show dev d1" + }, + "cmd": "tc class show dev d1", + "desc": "positive: opt=plain cmd=schmqprio:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-032", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.out new file mode 100644 index 000000000..288187515 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.out @@ -0,0 +1,10 @@ +class mqprio 100:ffe0 root +class mqprio 100:ffe1 root +class mqprio 100:1 parent 100:ffe0 +class mqprio 100:2 parent 100:ffe0 +class mqprio 100:3 parent 100:ffe0 +class mqprio 100:4 parent 100:ffe0 +class mqprio 100:5 parent 100:ffe1 +class mqprio 100:6 parent 100:ffe1 +class mqprio 100:7 parent 100:ffe1 +class mqprio 100:8 parent 100:ffe1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.pcap new file mode 100644 index 000000000..d708f1b0a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-032/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/cmd.json new file mode 100644 index 000000000..a2d847786 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "0", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc qdisc show dev d1 root", + "desc": "positive: opt=plain cmd=schtaprio:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-033", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.out new file mode 100644 index 000000000..829144721 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.out @@ -0,0 +1,8 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI flags 0x1 txtime delay 200000 base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.pcap new file mode 100644 index 000000000..5b2c27d82 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-033/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/cmd.json new file mode 100644 index 000000000..fe94ffd61 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "0", + "words": "-s qdisc show dev d1 root" + }, + "cmd": "tc -s qdisc show dev d1 root", + "desc": "positive: opt=plain cmd=schtaprio:-s_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-034", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.out new file mode 100644 index 000000000..1d6e9eaff --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.out @@ -0,0 +1,10 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI flags 0x1 txtime delay 200000 base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.pcap new file mode 100644 index 000000000..3c3d4c7fe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-034/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/cmd.json new file mode 100644 index 000000000..a2837f88f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "0", + "words": "-o qdisc show dev d1 root" + }, + "cmd": "tc -o qdisc show dev d1 root", + "desc": "corner: opt=plain cmd=schtaprio:-o_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-035", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.out new file mode 100644 index 000000000..089561aad --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.out @@ -0,0 +1 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0\queues offset 0 count 4 offset 4 count 4\clockid TAI flags 0x1 txtime delay 200000 base-time 1000000000 cycle-time 500000 cycle-time-extension 0\ index 0 cmd S gatemask 0x1 interval 300000\ index 1 cmd S gatemask 0x2 interval 200000\max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\fp E E E E E E E E E E E E E E E E\\ \ No newline at end of file diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.pcap new file mode 100644 index 000000000..f39c6b79b Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-035/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/cmd.json new file mode 100644 index 000000000..32471811f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "0", + "words": "qdisc show dev d1" + }, + "cmd": "tc qdisc show dev d1", + "desc": "positive: opt=plain cmd=schtaprio:qdisc_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-036", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.out new file mode 100644 index 000000000..3522d5ce4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.out @@ -0,0 +1,16 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI flags 0x1 txtime delay 200000 base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + +qdisc pfifo 0: parent 100:8 limit 1000p +qdisc pfifo 0: parent 100:7 limit 1000p +qdisc pfifo 0: parent 100:6 limit 1000p +qdisc pfifo 0: parent 100:5 limit 1000p +qdisc pfifo 0: parent 100:4 limit 1000p +qdisc pfifo 0: parent 100:3 limit 1000p +qdisc pfifo 0: parent 100:2 limit 1000p +qdisc pfifo 0: parent 100:1 limit 1000p diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.pcap new file mode 100644 index 000000000..1787d0a14 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-036/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/cmd.json new file mode 100644 index 000000000..621ec00f1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "0", + "words": "class show dev d1" + }, + "cmd": "tc class show dev d1", + "desc": "positive: opt=plain cmd=schtaprio:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-037", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.out new file mode 100644 index 000000000..a40c1c537 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.out @@ -0,0 +1,8 @@ +class taprio 100:1 root +class taprio 100:2 root +class taprio 100:3 root +class taprio 100:4 root +class taprio 100:5 root +class taprio 100:6 root +class taprio 100:7 root +class taprio 100:8 root diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.pcap new file mode 100644 index 000000000..89fc1c7d4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-037/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/cmd.json new file mode 100644 index 000000000..e686a3cd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/cmd.json @@ -0,0 +1,61 @@ +{ + "axes": { + "fix": "schtaprio2", + "json": "0", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc qdisc show dev d1 root", + "desc": "corner: opt=plain cmd=schtaprio2:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-038", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + }, + { + "cmd": "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.out new file mode 100644 index 000000000..b3958f0ec --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.out @@ -0,0 +1,10 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 + base-time 4000000000000000000 cycle-time 100000 cycle-time-extension 0 + index 0 cmd S gatemask 0x3 interval 100000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.pcap new file mode 100644 index 000000000..5c0c0e408 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-038/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/cmd.json new file mode 100644 index 000000000..99e311cfc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio3", + "json": "0", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc qdisc show dev d1 root", + "desc": "boundary: opt=plain cmd=schtaprio3:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-039", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.out new file mode 100644 index 000000000..12ef4b1d5 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.out @@ -0,0 +1,6 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI base-time 4000000000000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.pcap new file mode 100644 index 000000000..b4072c786 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-039/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/b.txt new file mode 100644 index 000000000..3ae0c6a3b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/b.txt @@ -0,0 +1,3 @@ +qdisc show dev d0 +class show dev d0 +class show dev d0 classid 1:20 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/cmd.json new file mode 100644 index 000000000..4a4147650 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/cmd.json @@ -0,0 +1,77 @@ +{ + "axes": { + "batch": "qdisc-then-class", + "fix": "schhfsc", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "tc -batch b.txt", + "desc": "positive: opt=plain cmd=schhfsc:batch:qdisc-then-class", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-040", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.out new file mode 100644 index 000000000..f1697b369 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.out @@ -0,0 +1,6 @@ +qdisc hfsc 1: root refcnt 2 default 0x10 +class hfsc 1: root +class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 10Mbit ul m1 0bit d 0us m2 20Mbit +class hfsc 1:10 parent 1:1 rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit +class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 1Mbit +class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 1Mbit diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.pcap new file mode 100644 index 000000000..f3e8a4782 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-040/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/b.txt new file mode 100644 index 000000000..ca37e529a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/b.txt @@ -0,0 +1,3 @@ +qdisc show dev d1 root +class show dev d1 +qdisc show dev d1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/cmd.json new file mode 100644 index 000000000..3bf46fbe9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "batch": "root-then-all", + "fix": "schtaprio2", + "json": "0", + "words": "-batch b.txt" + }, + "cmd": "tc -batch b.txt", + "desc": "corner: opt=plain cmd=schtaprio2:batch:root-then-all", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/ec-041", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + }, + { + "cmd": "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.out new file mode 100644 index 000000000..9341e979a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.out @@ -0,0 +1,28 @@ +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 + base-time 4000000000000000000 cycle-time 100000 cycle-time-extension 0 + index 0 cmd S gatemask 0x3 interval 100000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + +class taprio 100:1 root +class taprio 100:2 root +class taprio 100:3 root +class taprio 100:4 root +class taprio 100:5 root +class taprio 100:6 root +class taprio 100:7 root +class taprio 100:8 root +qdisc taprio 100: root refcnt 9 tc 2 map 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 +queues offset 0 count 4 offset 4 count 4 +clockid TAI base-time 1000000000 cycle-time 500000 cycle-time-extension 0 + index 0 cmd S gatemask 0x1 interval 300000 + index 1 cmd S gatemask 0x2 interval 200000 + base-time 4000000000000000000 cycle-time 100000 cycle-time-extension 0 + index 0 cmd S gatemask 0x3 interval 100000 +max-sdu 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +fp E E E E E E E E E E E E E E E E + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.pcap new file mode 100644 index 000000000..d4e53efaa Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ec-041/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/cmd.json new file mode 100644 index 000000000..a13015d76 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0" + }, + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0", + "desc": "negative: opt=plain cmd=ng:schdrr:qdisc_add_dev_d0_parent_1:1_handle_10:_mqprio_num_tc_2_map_0_0_1_1_queues_1@0_1@1_hw_0: mqprio is root only, on a multi-queue device: a write gotc refuses", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "ENOTSUP", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcsched/ng-001", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.err new file mode 100644 index 000000000..3df9d21fb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.err @@ -0,0 +1 @@ +RTNETLINK answers: Operation not supported diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.pcap new file mode 100644 index 000000000..3fb2b8c72 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-001/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/cmd.json new file mode 100644 index 000000000..a1c0f1a50 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/cmd.json @@ -0,0 +1,57 @@ +{ + "axes": { + "fix": "schmultiq", + "json": "0", + "words": "qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 base-time 0 sched-entry S 01 300000" + }, + "cmd": "tc qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 base-time 0 sched-entry S 01 300000", + "desc": "negative: opt=plain cmd=ng:schmultiq:qdisc_replace_dev_d1_root_handle_100:_taprio_num_tc_2_map_0_0_1_1_queues_4@0_4@4_base-time_0_sched-entry_S_01_300000: taprio without a clockid", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "EINVAL", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcsched/ng-002", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 1: multiq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 1: multiq", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.err new file mode 100644 index 000000000..7af630bd6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.err @@ -0,0 +1 @@ +Error: Specifying a 'clockid' is mandatory. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.pcap new file mode 100644 index 000000000..9cf62fb64 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-002/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/cmd.json new file mode 100644 index 000000000..196a2af1a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "fix": "schtsn", + "json": "0", + "words": "qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470 offload 1" + }, + "cmd": "tc qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470 offload 1", + "desc": "negative: opt=plain cmd=ng:schtsn:qdisc_replace_dev_d0_parent_1:1_handle_10:_cbs_idleslope_20000_sendslope_-980000_hicredit_30_locredit_-1470_offload_1: cbs offload needs ndo_setup_tc", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "ENOTSUP", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcsched/ng-003", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.err new file mode 100644 index 000000000..92b5b8a7b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.err @@ -0,0 +1 @@ +Error: Specified device does not support cbs offload. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.pcap new file mode 100644 index 000000000..0fa71b37e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-003/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/cmd.json new file mode 100644 index 000000000..d8e159acf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload" + }, + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload", + "desc": "negative: opt=plain cmd=ng:schdrr:qdisc_add_dev_d0_parent_1:2_handle_20:_etf_clockid_CLOCK_TAI_delta_300000_offload: etf offload needs ndo_setup_tc", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "ENOTSUP", + "rc": 2, + "refused_by": "kernel" + }, + "id": "tcsched/ng-004", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 2, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.err new file mode 100644 index 000000000..e13b1d45e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.err @@ -0,0 +1 @@ +Error: Specified device does not support ETF offload. diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.pcap new file mode 100644 index 000000000..6894094f1 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.rc new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-004/ip.rc @@ -0,0 +1 @@ +2 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/cmd.json new file mode 100644 index 000000000..380dff026 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "class show dev nosuch" + }, + "cmd": "tc class show dev nosuch", + "desc": "negative: opt=plain cmd=ng:schdrr:class_show_dev_nosuch: no such device: Cannot find device, rc 1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "errno": "ENODEV", + "rc": 1, + "refused_by": "kernel" + }, + "id": "tcsched/ng-005", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 1, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.err new file mode 100644 index 000000000..11be93da0 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.err @@ -0,0 +1 @@ +Cannot find device "nosuch" diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.out new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.pcap new file mode 100644 index 000000000..a02dea56e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.rc new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/ng-005/ip.rc @@ -0,0 +1 @@ +1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/cmd.json new file mode 100644 index 000000000..9bd2ea02f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "0", + "words": "class show dev d0" + }, + "cmd": "tc class show dev d0", + "desc": "positive: opt=plain cmd=schdrr:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-001", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.out new file mode 100644 index 000000000..c398387e1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.out @@ -0,0 +1,2 @@ +class drr 1:1 root quantum 1514b +class drr 1:2 root quantum 1514b diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.pcap new file mode 100644 index 000000000..56eb3b1d3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-001/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/cmd.json new file mode 100644 index 000000000..81f691d86 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "corner: opt=json cmd=schdrr:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-002", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.out new file mode 100644 index 000000000..1741d1f3e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.out @@ -0,0 +1 @@ +[{"kind":"drr","handle":"1:","root":true,"refcnt":2,"options":{}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.pcap new file mode 100644 index 000000000..81d867004 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-002/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/cmd.json new file mode 100644 index 000000000..0082576ab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "1", + "words": "-s class show dev d0" + }, + "cmd": "tc -j -s class show dev d0", + "desc": "positive: opt=json cmd=schdrr:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-003", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.out new file mode 100644 index 000000000..0326b90d2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.out @@ -0,0 +1 @@ +[{"class":"drr","handle":"1:1","root":true,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}},{"class":"drr","handle":"1:2","root":true,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.pcap new file mode 100644 index 000000000..67ad027fc Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-003/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/cmd.json new file mode 100644 index 000000000..d3fde8c1d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schdrr", + "json": "1", + "words": "-g class show dev d0" + }, + "cmd": "tc -j -g class show dev d0", + "desc": "corner: opt=json cmd=schdrr:-g_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-004", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: drr", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 drr", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.out new file mode 100644 index 000000000..c65ce198f --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.out @@ -0,0 +1,4 @@ +[] ++---(1:2) drr quantum 1514b ++---(1:1) drr quantum 1514b + diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.pcap new file mode 100644 index 000000000..519ac6bfb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-004/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/cmd.json new file mode 100644 index 000000000..b486ae07a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "corner: opt=json cmd=schqfq:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-005", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.out new file mode 100644 index 000000000..ff7e45909 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.out @@ -0,0 +1 @@ +[{"kind":"qfq","handle":"1:","root":true,"refcnt":2,"options":{}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.pcap new file mode 100644 index 000000000..93abf3617 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-005/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/cmd.json new file mode 100644 index 000000000..0c9f55522 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "positive: opt=json cmd=schqfq:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-006", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.out new file mode 100644 index 000000000..d3dc94dd6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.out @@ -0,0 +1 @@ +[{"class":"qfq","handle":"1:1","root":true,"weight":1,"maxpkt":1514},{"class":"qfq","handle":"1:2","root":true,"weight":30,"maxpkt":9000}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.pcap new file mode 100644 index 000000000..9d887a909 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-006/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/cmd.json new file mode 100644 index 000000000..69f1544fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schqfq", + "json": "1", + "words": "-s class show dev d0" + }, + "cmd": "tc -j -s class show dev d0", + "desc": "corner: opt=json cmd=schqfq:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-007", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: qfq", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.out new file mode 100644 index 000000000..ad87dc6c3 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.out @@ -0,0 +1 @@ +[{"class":"qfq","handle":"1:1","root":true,"weight":1,"maxpkt":1514,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}},{"class":"qfq","handle":"1:2","root":true,"weight":30,"maxpkt":9000,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.pcap new file mode 100644 index 000000000..bd3460eac Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-007/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/cmd.json new file mode 100644 index 000000000..657c60408 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "positive: opt=json cmd=schhfsc:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-008", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.out new file mode 100644 index 000000000..1575e58d2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.out @@ -0,0 +1 @@ +[{"kind":"hfsc","handle":"1:","root":true,"refcnt":2,"options":{"default":"0x10"}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.pcap new file mode 100644 index 000000000..07c23daf3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-008/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/cmd.json new file mode 100644 index 000000000..25c9188fa --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "positive: opt=json cmd=schhfsc:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-009", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.out new file mode 100644 index 000000000..9b6fc1440 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.out @@ -0,0 +1 @@ +[{"class":"hfsc","handle":"1:","root":true},{"class":"hfsc","handle":"1:1","parent":"1:","sc":{"m1":0,"d":0,"m2":1250000},"ul":{"m1":0,"d":0,"m2":2500000}},{"class":"hfsc","handle":"1:10","parent":"1:1","rt":{"m1":250000,"d":10000,"m2":125000},"ls":{"m1":0,"d":0,"m2":375000}},{"class":"hfsc","handle":"1:20","parent":"1:1","sc":{"m1":0,"d":0,"m2":125000}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.pcap new file mode 100644 index 000000000..5da10b64c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-009/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/cmd.json new file mode 100644 index 000000000..1aba8ca60 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "1", + "words": "-s class show dev d0" + }, + "cmd": "tc -j -s class show dev d0", + "desc": "corner: opt=json cmd=schhfsc:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-010", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.out new file mode 100644 index 000000000..20b45d748 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.out @@ -0,0 +1 @@ +[{"class":"hfsc","handle":"1:","root":true,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0,"period":0,"level":2}},{"class":"hfsc","handle":"1:1","parent":"1:","sc":{"m1":0,"d":0,"m2":1250000},"ul":{"m1":0,"d":0,"m2":2500000},"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0,"period":0,"level":1}},{"class":"hfsc","handle":"1:10","parent":"1:1","rt":{"m1":250000,"d":10000,"m2":125000},"ls":{"m1":0,"d":0,"m2":375000},"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0,"period":0,"level":0}},{"class":"hfsc","handle":"1:20","parent":"1:1","sc":{"m1":0,"d":0,"m2":125000},"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0,"period":0,"level":0}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.pcap new file mode 100644 index 000000000..d0d55f1c3 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-010/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/cmd.json new file mode 100644 index 000000000..0925cbf12 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "1", + "words": "-g class show dev d0" + }, + "cmd": "tc -j -g class show dev d0", + "desc": "corner: opt=json cmd=schhfsc:-g_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-011", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.out new file mode 100644 index 000000000..95d22b469 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.out @@ -0,0 +1,8 @@ +[] ++---(1:) hfsc + +---(1:1) hfsc sc m1 0bit d 0us m2 10Mbit ul m1 0bit d 0us m2 20Mbit + +---(1:10) hfsc rt m1 2Mbit d 10ms m2 1Mbit ls m1 0bit d 0us m2 3Mbit + +---(1:20) hfsc sc m1 0bit d 0us m2 1Mbit + + + | diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.pcap new file mode 100644 index 000000000..9bf21fa0f Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-011/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/cmd.json new file mode 100644 index 000000000..a9ebcbad1 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/cmd.json @@ -0,0 +1,71 @@ +{ + "axes": { + "fix": "schhfsc", + "json": "1", + "words": "class show dev d0 classid 1:10" + }, + "cmd": "tc -j class show dev d0 classid 1:10", + "desc": "positive: opt=json cmd=schhfsc:class_show_dev_d0_classid_1:10", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-012", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.out new file mode 100644 index 000000000..1aec3c357 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.out @@ -0,0 +1 @@ +[{"class":"hfsc","handle":"1:10","parent":"1:1","rt":{"m1":250000,"d":10000,"m2":125000},"ls":{"m1":0,"d":0,"m2":375000}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.pcap new file mode 100644 index 000000000..d1a5a16a8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-012/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/cmd.json new file mode 100644 index 000000000..9533c2410 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schhfsc0", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "boundary: opt=json cmd=schhfsc0:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-013", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 2: hfsc" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 2: hfsc", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.out new file mode 100644 index 000000000..adc205af7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.out @@ -0,0 +1 @@ +[{"kind":"hfsc","handle":"2:","root":true,"refcnt":2,"options":{}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.pcap new file mode 100644 index 000000000..01b675159 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-013/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/cmd.json new file mode 100644 index 000000000..ef1b1ed5e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schhfsc0", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "boundary: opt=json cmd=schhfsc0:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-014", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 2: hfsc" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 2: hfsc", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.out new file mode 100644 index 000000000..299c0a7da --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.out @@ -0,0 +1 @@ +[{"class":"hfsc","handle":"2:","root":true}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.pcap new file mode 100644 index 000000000..b98bcae87 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-014/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/cmd.json new file mode 100644 index 000000000..c10faad15 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "positive: opt=json cmd=schets:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-015", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.out new file mode 100644 index 000000000..bc558cca7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.out @@ -0,0 +1 @@ +[{"kind":"ets","handle":"1:","root":true,"refcnt":2,"options":{"bands":3,"strict":1,"quanta":[1500,3000],"priomap":[2,1,0,2,2,2,2,2,2,2,2,2,2,2,2,2]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.pcap new file mode 100644 index 000000000..bbc30f7b4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-015/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/cmd.json new file mode 100644 index 000000000..6deb9cb46 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "positive: opt=json cmd=schets:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-016", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.out new file mode 100644 index 000000000..c4cfc4d04 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.out @@ -0,0 +1 @@ +[{"class":"ets","handle":"1:1","root":true},{"class":"ets","handle":"1:2","root":true,"quantum":1500},{"class":"ets","handle":"1:3","root":true,"quantum":3000}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.pcap new file mode 100644 index 000000000..94756bcac Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-016/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/cmd.json new file mode 100644 index 000000000..5af0c413a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "1", + "words": "-s class show dev d0" + }, + "cmd": "tc -j -s class show dev d0", + "desc": "positive: opt=json cmd=schets:-s_class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-017", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.out new file mode 100644 index 000000000..c5e1141f7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.out @@ -0,0 +1 @@ +[{"class":"ets","handle":"1:1","root":true,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}},{"class":"ets","handle":"1:2","root":true,"quantum":1500,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}},{"class":"ets","handle":"1:3","root":true,"quantum":3000,"stats":{"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.pcap new file mode 100644 index 000000000..c24b81ae4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-017/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/cmd.json new file mode 100644 index 000000000..5db272a16 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets", + "json": "1", + "words": "-o qdisc show dev d0" + }, + "cmd": "tc -j -o qdisc show dev d0", + "desc": "corner: opt=json cmd=schets:-o_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-018", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.out new file mode 100644 index 000000000..bc558cca7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.out @@ -0,0 +1 @@ +[{"kind":"ets","handle":"1:","root":true,"refcnt":2,"options":{"bands":3,"strict":1,"quanta":[1500,3000],"priomap":[2,1,0,2,2,2,2,2,2,2,2,2,2,2,2,2]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.pcap new file mode 100644 index 000000000..a76025118 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-018/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/cmd.json new file mode 100644 index 000000000..40c274d25 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets0", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "boundary: opt=json cmd=schets0:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-019", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets strict 3" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets strict 3", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.out new file mode 100644 index 000000000..0de2210d2 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.out @@ -0,0 +1 @@ +[{"kind":"ets","handle":"1:","root":true,"refcnt":2,"options":{"bands":3,"strict":3,"priomap":[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.pcap new file mode 100644 index 000000000..7565591e8 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-019/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/cmd.json new file mode 100644 index 000000000..5026d0757 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schets0", + "json": "1", + "words": "class show dev d0" + }, + "cmd": "tc -j class show dev d0", + "desc": "boundary: opt=json cmd=schets0:class_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-020", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: ets strict 3" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: ets strict 3", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.out new file mode 100644 index 000000000..f2d72f76e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.out @@ -0,0 +1 @@ +[{"class":"ets","handle":"1:1","root":true},{"class":"ets","handle":"1:2","root":true},{"class":"ets","handle":"1:3","root":true}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.pcap new file mode 100644 index 000000000..43d9eaa88 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-020/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/cmd.json new file mode 100644 index 000000000..d8c108e1d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "1", + "words": "qdisc show dev d0" + }, + "cmd": "tc -j qdisc show dev d0", + "desc": "positive: opt=json cmd=schtsn:qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-021", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.out new file mode 100644 index 000000000..6bbfff8fe --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.out @@ -0,0 +1 @@ +[{"kind":"prio","handle":"1:","root":true,"refcnt":2,"options":{"bands":2,"priomap":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"multiqueue":false}},{"kind":"pfifo","handle":"0:","parent":"10:","options":{"limit":1000}},{"kind":"cbs","handle":"10:","parent":"1:1","options":{"hicredit":30,"locredit":-1470,"sendslope":-980000,"idleslope":20000,"offload":0}},{"kind":"etf","handle":"20:","parent":"1:2","options":{"clockid":"TAI","delta":300000,"offload":"off","deadline_mode":"off","skip_sock_check":"on"}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.pcap new file mode 100644 index 000000000..2f7313edd Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-021/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/cmd.json new file mode 100644 index 000000000..2fe1c9b4c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "1", + "words": "-s qdisc show dev d0" + }, + "cmd": "tc -j -s qdisc show dev d0", + "desc": "positive: opt=json cmd=schtsn:-s_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-022", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.out new file mode 100644 index 000000000..5cbf1565c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.out @@ -0,0 +1 @@ +[{"kind":"prio","handle":"1:","root":true,"refcnt":2,"options":{"bands":2,"priomap":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"multiqueue":false},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0},{"kind":"pfifo","handle":"0:","parent":"10:","options":{"limit":1000},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0},{"kind":"cbs","handle":"10:","parent":"1:1","options":{"hicredit":30,"locredit":-1470,"sendslope":-980000,"idleslope":20000,"offload":0},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0},{"kind":"etf","handle":"20:","parent":"1:2","options":{"clockid":"TAI","delta":300000,"offload":"off","deadline_mode":"off","skip_sock_check":"on"},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.pcap new file mode 100644 index 000000000..aaf9d0232 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-022/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/cmd.json new file mode 100644 index 000000000..124d32c4c --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "1", + "words": "qdisc show dev d0 handle 10:" + }, + "cmd": "tc -j qdisc show dev d0 handle 10:", + "desc": "corner: opt=json cmd=schtsn:qdisc_show_dev_d0_handle_10:", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-023", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.out new file mode 100644 index 000000000..13ec1334a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.out @@ -0,0 +1 @@ +[{"kind":"cbs","handle":"10:","parent":"1:1","options":{"hicredit":30,"locredit":-1470,"sendslope":-980000,"idleslope":20000,"offload":0}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.pcap new file mode 100644 index 000000000..8ec338a84 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-023/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/cmd.json new file mode 100644 index 000000000..ee009a334 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "1", + "words": "qdisc show dev d0 handle 20:" + }, + "cmd": "tc -j qdisc show dev d0 handle 20:", + "desc": "corner: opt=json cmd=schtsn:qdisc_show_dev_d0_handle_20:", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-024", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.out new file mode 100644 index 000000000..eb4a47024 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.out @@ -0,0 +1 @@ +[{"kind":"etf","handle":"20:","parent":"1:2","options":{"clockid":"TAI","delta":300000,"offload":"off","deadline_mode":"off","skip_sock_check":"on"}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.pcap new file mode 100644 index 000000000..6bffe8be0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-024/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/cmd.json new file mode 100644 index 000000000..ba8ba5e99 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/cmd.json @@ -0,0 +1,66 @@ +{ + "axes": { + "fix": "schtsn", + "json": "1", + "words": "-d qdisc show dev d0" + }, + "cmd": "tc -j -d qdisc show dev d0", + "desc": "corner: opt=json cmd=schtsn:-d_qdisc_show_dev_d0", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-025", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.out new file mode 100644 index 000000000..6bbfff8fe --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.out @@ -0,0 +1 @@ +[{"kind":"prio","handle":"1:","root":true,"refcnt":2,"options":{"bands":2,"priomap":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"multiqueue":false}},{"kind":"pfifo","handle":"0:","parent":"10:","options":{"limit":1000}},{"kind":"cbs","handle":"10:","parent":"1:1","options":{"hicredit":30,"locredit":-1470,"sendslope":-980000,"idleslope":20000,"offload":0}},{"kind":"etf","handle":"20:","parent":"1:2","options":{"clockid":"TAI","delta":300000,"offload":"off","deadline_mode":"off","skip_sock_check":"on"}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.pcap new file mode 100644 index 000000000..84fdd6540 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-025/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/cmd.json new file mode 100644 index 000000000..7b214a829 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmultiq", + "json": "1", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc -j qdisc show dev d1 root", + "desc": "positive: opt=json cmd=schmultiq:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-026", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 1: multiq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 1: multiq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.out new file mode 100644 index 000000000..2f3f137f4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.out @@ -0,0 +1 @@ +[{"kind":"multiq","handle":"1:","root":true,"refcnt":9,"options":{"bands":8,"max_bands":8}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.pcap new file mode 100644 index 000000000..caef969a6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-026/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/cmd.json new file mode 100644 index 000000000..a71fcce74 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmultiq", + "json": "1", + "words": "class show dev d1" + }, + "cmd": "tc -j class show dev d1", + "desc": "positive: opt=json cmd=schmultiq:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-027", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 1: multiq" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 1: multiq", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.out new file mode 100644 index 000000000..000ac8dab --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.out @@ -0,0 +1 @@ +[{"class":"multiq","handle":"1:1","parent":"1:"},{"class":"multiq","handle":"1:2","parent":"1:"},{"class":"multiq","handle":"1:3","parent":"1:"},{"class":"multiq","handle":"1:4","parent":"1:"},{"class":"multiq","handle":"1:5","parent":"1:"},{"class":"multiq","handle":"1:6","parent":"1:"},{"class":"multiq","handle":"1:7","parent":"1:"},{"class":"multiq","handle":"1:8","parent":"1:"}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.pcap new file mode 100644 index 000000000..f711098a2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-027/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/cmd.json new file mode 100644 index 000000000..f671f09b4 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "1", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc -j qdisc show dev d1 root", + "desc": "positive: opt=json cmd=schmqprio:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-028", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.out new file mode 100644 index 000000000..2b3e56bb6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.out @@ -0,0 +1 @@ +[{"kind":"mqprio","handle":"100:","root":true,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[[0,3],[4,7]],"mode":"dcb","shaper":"dcb","fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.pcap new file mode 100644 index 000000000..8f3589068 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-028/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/cmd.json new file mode 100644 index 000000000..74bc1cf69 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "1", + "words": "-s qdisc show dev d1 root" + }, + "cmd": "tc -j -s qdisc show dev d1 root", + "desc": "positive: opt=json cmd=schmqprio:-s_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-029", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.out new file mode 100644 index 000000000..cc5afbfce --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.out @@ -0,0 +1 @@ +[{"kind":"mqprio","handle":"100:","root":true,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[[0,3],[4,7]],"mode":"dcb","shaper":"dcb","fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.pcap new file mode 100644 index 000000000..169bf7c18 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-029/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/cmd.json new file mode 100644 index 000000000..0b4f2cab8 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "1", + "words": "-o qdisc show dev d1 root" + }, + "cmd": "tc -j -o qdisc show dev d1 root", + "desc": "corner: opt=json cmd=schmqprio:-o_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-030", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.out new file mode 100644 index 000000000..2b3e56bb6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.out @@ -0,0 +1 @@ +[{"kind":"mqprio","handle":"100:","root":true,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[[0,3],[4,7]],"mode":"dcb","shaper":"dcb","fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.pcap new file mode 100644 index 000000000..e1f9626eb Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-030/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/cmd.json new file mode 100644 index 000000000..a3e313361 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "1", + "words": "-d qdisc show dev d1 root" + }, + "cmd": "tc -j -d qdisc show dev d1 root", + "desc": "corner: opt=json cmd=schmqprio:-d_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-031", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.out new file mode 100644 index 000000000..2b3e56bb6 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.out @@ -0,0 +1 @@ +[{"kind":"mqprio","handle":"100:","root":true,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[[0,3],[4,7]],"mode":"dcb","shaper":"dcb","fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.pcap new file mode 100644 index 000000000..840d6f701 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-031/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/cmd.json new file mode 100644 index 000000000..ac2692866 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schmqprio", + "json": "1", + "words": "class show dev d1" + }, + "cmd": "tc -j class show dev d1", + "desc": "positive: opt=json cmd=schmqprio:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-032", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.out new file mode 100644 index 000000000..f9f8c14df --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.out @@ -0,0 +1 @@ +[{"class":"mqprio","handle":"100:ffe0","root":true},{"class":"mqprio","handle":"100:ffe1","root":true},{"class":"mqprio","handle":"100:1","parent":"100:ffe0"},{"class":"mqprio","handle":"100:2","parent":"100:ffe0"},{"class":"mqprio","handle":"100:3","parent":"100:ffe0"},{"class":"mqprio","handle":"100:4","parent":"100:ffe0"},{"class":"mqprio","handle":"100:5","parent":"100:ffe1"},{"class":"mqprio","handle":"100:6","parent":"100:ffe1"},{"class":"mqprio","handle":"100:7","parent":"100:ffe1"},{"class":"mqprio","handle":"100:8","parent":"100:ffe1"}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.pcap new file mode 100644 index 000000000..f8e161148 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-032/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/cmd.json new file mode 100644 index 000000000..9ffd90ccf --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "1", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc -j qdisc show dev d1 root", + "desc": "positive: opt=json cmd=schtaprio:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-033", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.out new file mode 100644 index 000000000..39d33dcb7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","flags":"0x1","txtime_delay":200000,"base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.pcap new file mode 100644 index 000000000..285983fef Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-033/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/cmd.json new file mode 100644 index 000000000..b9643bbdb --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "1", + "words": "-s qdisc show dev d1 root" + }, + "cmd": "tc -j -s qdisc show dev d1 root", + "desc": "positive: opt=json cmd=schtaprio:-s_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-034", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.out new file mode 100644 index 000000000..a4acdd05d --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","flags":"0x1","txtime_delay":200000,"base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]},"bytes":0,"packets":0,"drops":0,"overlimits":0,"requeues":0,"backlog":0,"qlen":0}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.pcap new file mode 100644 index 000000000..ae3548df6 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-034/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/cmd.json new file mode 100644 index 000000000..d4eee4211 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "1", + "words": "-o qdisc show dev d1 root" + }, + "cmd": "tc -j -o qdisc show dev d1 root", + "desc": "corner: opt=json cmd=schtaprio:-o_qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-035", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.out new file mode 100644 index 000000000..39d33dcb7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","flags":"0x1","txtime_delay":200000,"base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.pcap new file mode 100644 index 000000000..2b5e71afe Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-035/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/cmd.json new file mode 100644 index 000000000..cda9aef63 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "1", + "words": "qdisc show dev d1" + }, + "cmd": "tc -j qdisc show dev d1", + "desc": "positive: opt=json cmd=schtaprio:qdisc_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-036", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.out new file mode 100644 index 000000000..496f53827 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","flags":"0x1","txtime_delay":200000,"base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}},{"kind":"pfifo","handle":"0:","parent":"100:8","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:7","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:6","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:5","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:4","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:3","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:2","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"100:1","options":{"limit":1000}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.pcap new file mode 100644 index 000000000..3b867dc8e Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-036/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/cmd.json new file mode 100644 index 000000000..5a0dc5053 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio", + "json": "1", + "words": "class show dev d1" + }, + "cmd": "tc -j class show dev d1", + "desc": "positive: opt=json cmd=schtaprio:class_show_dev_d1", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-037", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.out new file mode 100644 index 000000000..0172af4ef --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.out @@ -0,0 +1 @@ +[{"class":"taprio","handle":"100:1","root":true},{"class":"taprio","handle":"100:2","root":true},{"class":"taprio","handle":"100:3","root":true},{"class":"taprio","handle":"100:4","root":true},{"class":"taprio","handle":"100:5","root":true},{"class":"taprio","handle":"100:6","root":true},{"class":"taprio","handle":"100:7","root":true},{"class":"taprio","handle":"100:8","root":true}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.pcap new file mode 100644 index 000000000..9b43a0a6a Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-037/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/cmd.json new file mode 100644 index 000000000..6ddb22f62 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/cmd.json @@ -0,0 +1,61 @@ +{ + "axes": { + "fix": "schtaprio2", + "json": "1", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc -j qdisc show dev d1 root", + "desc": "corner: opt=json cmd=schtaprio2:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-038", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + }, + { + "cmd": "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.out new file mode 100644 index 000000000..7fc9db668 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"admin":{"base_time":4000000000000000000,"cycle_time":100000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x3","interval":100000}]},"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.pcap new file mode 100644 index 000000000..f4bbaf53c Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-038/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/cmd.json new file mode 100644 index 000000000..3f1372a2e --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/cmd.json @@ -0,0 +1,56 @@ +{ + "axes": { + "fix": "schtaprio3", + "json": "1", + "words": "qdisc show dev d1 root" + }, + "cmd": "tc -j qdisc show dev d1 root", + "desc": "boundary: opt=json cmd=schtaprio3:qdisc_show_dev_d1_root", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-039", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.out new file mode 100644 index 000000000..8b1543247 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.out @@ -0,0 +1 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","admin":{"base_time":4000000000000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}]}}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.pcap new file mode 100644 index 000000000..c55cd35d4 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-039/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/b.txt new file mode 100644 index 000000000..3ae0c6a3b --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/b.txt @@ -0,0 +1,3 @@ +qdisc show dev d0 +class show dev d0 +class show dev d0 classid 1:20 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/cmd.json new file mode 100644 index 000000000..e70b1dbfc --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/cmd.json @@ -0,0 +1,77 @@ +{ + "axes": { + "batch": "qdisc-then-class", + "fix": "schhfsc", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "tc -j -batch b.txt", + "desc": "positive: opt=json cmd=schhfsc:batch:qdisc-then-class", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-040", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d0 address 02:00:00:00:02:00 type dummy && ip link set d0 addrgenmode none && ip link set d0 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d0 root handle 1: hfsc default 10", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "rc": 0 + }, + { + "cmd": "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc show dev d0' 'class show dev d0' 'class show dev d0 classid 1:20' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.out new file mode 100644 index 000000000..6ede4b7d7 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.out @@ -0,0 +1,3 @@ +[{"kind":"hfsc","handle":"1:","root":true,"refcnt":2,"options":{"default":"0x10"}}] +[{"class":"hfsc","handle":"1:","root":true},{"class":"hfsc","handle":"1:1","parent":"1:","sc":{"m1":0,"d":0,"m2":1250000},"ul":{"m1":0,"d":0,"m2":2500000}},{"class":"hfsc","handle":"1:10","parent":"1:1","rt":{"m1":250000,"d":10000,"m2":125000},"ls":{"m1":0,"d":0,"m2":375000}},{"class":"hfsc","handle":"1:20","parent":"1:1","sc":{"m1":0,"d":0,"m2":125000}}] +[{"class":"hfsc","handle":"1:20","parent":"1:1","sc":{"m1":0,"d":0,"m2":125000}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.pcap new file mode 100644 index 000000000..6bfed9db2 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-040/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/b.txt b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/b.txt new file mode 100644 index 000000000..ca37e529a --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/b.txt @@ -0,0 +1,3 @@ +qdisc show dev d1 root +class show dev d1 +qdisc show dev d1 diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/cmd.json b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/cmd.json new file mode 100644 index 000000000..7cbc36c62 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/cmd.json @@ -0,0 +1,67 @@ +{ + "axes": { + "batch": "root-then-all", + "fix": "schtaprio2", + "json": "1", + "words": "-batch b.txt" + }, + "cmd": "tc -j -batch b.txt", + "desc": "corner: opt=json cmd=schtaprio2:batch:root-then-all", + "env": { + "iproute2": "ip utility, iproute2-7.2.0, libbpf 1.8.0", + "kconfig": [ + "CONFIG_IPV6_IOAM6_LWTUNNEL=y", + "CONFIG_IPV6_RPL_LWTUNNEL=y", + "CONFIG_IPV6_SEG6_LWTUNNEL=y", + "CONFIG_LWTUNNEL=y", + "CONFIG_LWTUNNEL_BPF=y" + ], + "kernel": "7.3.1" + }, + "expect": { + "rc": 0, + "refused_by": "none" + }, + "id": "tcsched/pw-041", + "modules": [ + "sch_cbs", + "sch_drr", + "sch_etf", + "sch_ets", + "sch_hfsc", + "sch_mqprio", + "sch_multiq", + "sch_prio", + "sch_qfq", + "sch_taprio" + ], + "pre": [ + "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt" + ], + "proto": "route", + "result": { + "pre": [ + { + "cmd": "ip link add d1 address 02:00:00:00:02:00 numtxqueues 8 type dummy && ip link set d1 addrgenmode none && ip link set d1 up", + "rc": 0 + }, + { + "cmd": "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "rc": 0 + }, + { + "cmd": "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", + "rc": 0 + }, + { + "cmd": "printf '%s\\n' 'qdisc show dev d1 root' 'class show dev d1' 'qdisc show dev d1' > b.txt", + "rc": 0 + } + ], + "rc": 0, + "status": "OK" + } +} diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.err b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.err new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.out b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.out new file mode 100644 index 000000000..1a69a1c44 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.out @@ -0,0 +1,3 @@ +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"admin":{"base_time":4000000000000000000,"cycle_time":100000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x3","interval":100000}]},"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] +[{"class":"taprio","handle":"100:1","root":true},{"class":"taprio","handle":"100:2","root":true},{"class":"taprio","handle":"100:3","root":true},{"class":"taprio","handle":"100:4","root":true},{"class":"taprio","handle":"100:5","root":true},{"class":"taprio","handle":"100:6","root":true},{"class":"taprio","handle":"100:7","root":true},{"class":"taprio","handle":"100:8","root":true}] +[{"kind":"taprio","handle":"100:","root":true,"refcnt":9,"options":{"tc":2,"map":[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"queues":[{"offset":0,"count":4},{"offset":4,"count":4}],"clockid":"TAI","base_time":1000000000,"cycle_time":500000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x1","interval":300000},{"index":1,"cmd":"S","gatemask":"0x2","interval":200000}],"admin":{"base_time":4000000000000000000,"cycle_time":100000,"cycle_time_extension":0,"schedule":[{"index":0,"cmd":"S","gatemask":"0x3","interval":100000}]},"max-sdu":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"fp":["E","E","E","E","E","E","E","E","E","E","E","E","E","E","E","E"]}}] diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.pcap b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.pcap new file mode 100644 index 000000000..cde85ffc0 Binary files /dev/null and b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.pcap differ diff --git a/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.rc b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.rc new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/pkg/xtcpnl/testdata/7_3_1/ws/tcsched/pw-041/ip.rc @@ -0,0 +1 @@ +0 diff --git a/pkg/xtcpnl/xtcpnl_tc_kind.go b/pkg/xtcpnl/xtcpnl_tc_kind.go index 6e1dc13f0..9b1de8e84 100644 --- a/pkg/xtcpnl/xtcpnl_tc_kind.go +++ b/pkg/xtcpnl/xtcpnl_tc_kind.go @@ -83,6 +83,8 @@ type TcQopt struct { HasNetemGi bool NetemGe TcNetemGemodel HasNetemGe bool + + Sched TcSched // drr, qfq, hfsc, ets, mqprio, taprio, multiq, cbs, etf } // ParseTcQopt decodes opt, a TCA_OPTIONS payload, for kind. A kind whose @@ -112,11 +114,27 @@ func ParseTcQopt(kind string, opt []byte) (TcQopt, error) { case TcKindNetem: err = q.parseNetem(opt) default: + if ok, serr := q.parseSched(kind, opt, false); ok { + return q, serr + } return q, fmt.Errorf("%w: %q", ErrTcKindUnknown, kind) } return q, err } +// ParseTcCopt decodes opt, a class's TCA_OPTIONS, for kind: print_copt's +// reads. hfsc's and ets's class options differ from their qdisc's (service +// curves; TCA_ETS_QUANTA_BAND); every other kind's are read as its qdisc +// options are (htb, drr and qfq share one printer). +func ParseTcCopt(kind string, opt []byte) (TcQopt, error) { + if kind != TcKindHfsc && kind != TcKindEts { + return ParseTcQopt(kind, opt) + } + q := TcQopt{Kind: kind} + _, err := q.parseSched(kind, opt, true) + return q, err +} + // SplitTcCompat is parse_rtattr_nested_compat(tb, max, rta, data, len): // opt's first hdrLen bytes are the fixed structure, and when at least an // rtattr header follows RTA_ALIGN(hdrLen), that rtattr's payload is the @@ -339,6 +357,13 @@ type TcXstats struct { Htb TcHtbXstats Sfq TcSfqXstats Netem TcNetemXstats + Drr TcDrrStats + Hfsc TcHfscStats + + TaprioWindowDrops uint64 + HasTaprioWindowDrops bool + TaprioTxOverruns uint64 + HasTaprioTxOverruns bool } // ParseTcXstats decodes b for kind's print_xstats. fq_codel, fq and netem @@ -362,6 +387,9 @@ func ParseTcXstats(kind string, b []byte) (TcXstats, error) { case TcKindSfq: x.Sfq, err = DecodeTcSfqXstats(b) default: + if ok, serr := x.parseSchedXstats(kind, b); ok { + return x, serr + } return x, fmt.Errorf("%w: %q", ErrTcKindUnknown, kind) } x.Has = err == nil diff --git a/pkg/xtcpnl/xtcpnl_tc_kind_test.go b/pkg/xtcpnl/xtcpnl_tc_kind_test.go index 968da1cf4..17a3115b8 100644 --- a/pkg/xtcpnl/xtcpnl_tc_kind_test.go +++ b/pkg/xtcpnl/xtcpnl_tc_kind_test.go @@ -706,6 +706,8 @@ var wsTcSliceKinds = []string{ TcKindNoqueue, TcKindMq, TcKindPfifoFast, TcKindPrio, TcKindPfifo, TcKindBfifo, TcKindPfifoHeadDrop, TcKindFqCodel, TcKindFq, TcKindHtb, TcKindTbf, TcKindSfq, TcKindNetem, TcKindIngress, TcKindClsact, + TcKindDrr, TcKindQfq, TcKindHfsc, TcKindEts, TcKindMqprio, TcKindTaprio, TcKindMultiq, + TcKindCbs, TcKindEtf, } // TestWsTcKinds decodes every qdisc and class the kernel sent in any @@ -741,7 +743,7 @@ func TestWsTcKinds(t *testing.T) { continue } seen[ti.Kind]++ - if err := wsTcKindProblem(ti); err != nil { + if err := wsTcKindProblem(ti, m.h.Type == unix.RTM_NEWTCLASS); err != nil { t.Errorf("%s message %d (kind %s): %v", p, i, ti.Kind, err) } } @@ -755,9 +757,13 @@ func TestWsTcKinds(t *testing.T) { t.Logf("decoded %v; %d messages of other kinds", seen, other) } -func wsTcKindProblem(ti TcInfo) error { +func wsTcKindProblem(ti TcInfo, class bool) error { + parse := ParseTcQopt + if class { + parse = ParseTcCopt + } if ti.HasOptions || len(ti.Options) > 0 { - if _, err := ParseTcQopt(ti.Kind, ti.Options); err != nil { + if _, err := parse(ti.Kind, ti.Options); err != nil { return err } } @@ -820,6 +826,9 @@ func FuzzParseTcQopt(f *testing.F) { if _, err := ParseTcXstats(kind, in); err != nil && !errors.Is(err, ErrTcShort) { t.Fatalf("xstats for a decodable kind: %v", err) } + if c, err := ParseTcCopt(kind, in); err == nil && c.Kind != kind { + t.Fatalf("class kind %q, expected %q", c.Kind, kind) + } }) } diff --git a/pkg/xtcpnl/xtcpnl_tc_sched.go b/pkg/xtcpnl/xtcpnl_tc_sched.go new file mode 100644 index 000000000..27341ec57 --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_sched.go @@ -0,0 +1,960 @@ +package xtcpnl + +import ( + "encoding/binary" + "errors" + "fmt" + + "github.com/randomizedcoder/xtcp2/pkg/cint" +) + +// This file decodes the classful and scheduling qdisc kinds (gotc 15P): +// drr, qfq, hfsc, ets, mqprio, taprio, multiq, cbs and etf, each read the +// way its tc/q_*.c printer reads it (iproute2 v7.2.0). The constants and +// structures are include/uapi/linux/pkt_sched.h at linux v7.4-rc4. +// +// The decoders read at C's widths and keep C's walks, so the printers' +// quirks stay visible to gotc: taprio's TXTIME_DELAY, a u32 on the wire, +// is read as s32 (rta_getattr_s32, q_taprio.c:610); ets's quanta and +// priomap loops step by rta_len (q_ets.c:234, 263); mqprio's options must +// reach RTA_ALIGN(sizeof(struct tc_mqprio_qopt)) (q_mqprio.c:328). Where C +// writes past a fixed array, the decoder stops at the array (Q53). + +// Qdisc kinds of increment 15 (tc/q_*.c qdisc_util.id). +const ( + TcKindDrr = "drr" + TcKindQfq = "qfq" + TcKindHfsc = "hfsc" + TcKindEts = "ets" + TcKindMqprio = "mqprio" + TcKindTaprio = "taprio" + TcKindMultiq = "multiq" + TcKindCbs = "cbs" + TcKindEtf = "etf" +) + +const ( + // TcMultiqQoptSizeCst is sizeof(struct tc_multiq_qopt): u16 bands and + // u16 max_bands. + TcMultiqQoptSizeCst = 4 + // TcHfscQoptSizeCst is sizeof(struct tc_hfsc_qopt): u16 defcls. + TcHfscQoptSizeCst = 2 + // TcServiceCurveSizeCst is sizeof(struct tc_service_curve): u32 m1, d + // and m2. + TcServiceCurveSizeCst = 12 + // TcHfscStatsSizeCst is sizeof(struct tc_hfsc_stats): u64 work and + // rtwork, u32 period and level. + TcHfscStatsSizeCst = 24 + // TcDrrStatsSizeCst is sizeof(struct tc_drr_stats): u32 deficit. + TcDrrStatsSizeCst = 4 + // TcQfqStatsSizeCst is sizeof(struct tc_qfq_stats): u32 weight and lmax. + TcQfqStatsSizeCst = 8 + // TcMqprioQoptSizeCst is sizeof(struct tc_mqprio_qopt): u8 num_tc, + // TC_QOPT_BITMASK+1 map bytes, u8 hw, then TC_QOPT_MAX_QUEUE u16 + // counts and offsets. + TcMqprioQoptSizeCst = 82 + // TcCbsQoptSizeCst is sizeof(struct tc_cbs_qopt): u8 offload, 3 pad + // bytes and four s32s. + TcCbsQoptSizeCst = 20 + // TcEtfQoptSizeCst is sizeof(struct tc_etf_qopt): s32 delta, s32 + // clockid, u32 flags. + TcEtfQoptSizeCst = 12 + + // TcQoptMaxQueueCst is TC_QOPT_MAX_QUEUE. + TcQoptMaxQueueCst = 16 + // TcQoptBitmaskCst is TC_QOPT_BITMASK: a map has TcQoptBitmaskCst+1 + // entries. + TcQoptBitmaskCst = 15 + // TcqEtsMaxBandsCst is TCQ_ETS_MAX_BANDS. + TcqEtsMaxBandsCst = 16 + + // TCA_DRR_*. + TcaDrrQuantum uint16 = 1 + // TcaDrrMaxKnown is TCA_DRR_MAX. + TcaDrrMaxKnown = TcaDrrQuantum + + // TCA_QFQ_*. + TcaQfqWeight uint16 = 1 + TcaQfqLmax uint16 = 2 + // TcaQfqMaxKnown is TCA_QFQ_MAX. + TcaQfqMaxKnown = TcaQfqLmax + + // TCA_HFSC_*: the class's service curves. + TcaHfscRsc uint16 = 1 + TcaHfscFsc uint16 = 2 + TcaHfscUsc uint16 = 3 + // TcaHfscMaxKnown is TCA_HFSC_MAX. + TcaHfscMaxKnown = TcaHfscUsc + + // TCA_ETS_*. + TcaEtsNbands uint16 = 1 + TcaEtsNstrict uint16 = 2 + TcaEtsQuanta uint16 = 3 + TcaEtsQuantaBand uint16 = 4 + TcaEtsPriomap uint16 = 5 + TcaEtsPriomapBand uint16 = 6 + // TcaEtsMaxKnown is TCA_ETS_MAX. + TcaEtsMaxKnown = TcaEtsPriomapBand + + // TCA_MQPRIO_*. + TcaMqprioMode uint16 = 1 + TcaMqprioShaper uint16 = 2 + TcaMqprioMinRate64 uint16 = 3 + TcaMqprioMaxRate64 uint16 = 4 + TcaMqprioTcEntry uint16 = 5 + // TcaMqprioMaxKnown is TCA_MQPRIO_MAX. + TcaMqprioMaxKnown = TcaMqprioTcEntry + // TCA_MQPRIO_TC_ENTRY_*. + TcaMqprioTcEntryIndex uint16 = 1 + TcaMqprioTcEntryFp uint16 = 2 + // TcaMqprioTcEntryMaxKnown is TCA_MQPRIO_TC_ENTRY_MAX. + TcaMqprioTcEntryMaxKnown = TcaMqprioTcEntryFp + + // TC_MQPRIO_MODE_* and TC_MQPRIO_SHAPER_*. + TcMqprioModeDcb uint16 = 0 + TcMqprioModeChannel uint16 = 1 + TcMqprioShaperDcb uint16 = 0 + TcMqprioShaperBwRate uint16 = 1 + TcFpExpress uint32 = 1 + TcFpPreemptible uint32 = 2 + tcMqprioQoptAlignedSz = 84 // RTA_ALIGN(sizeof(struct tc_mqprio_qopt)) + + // TCA_TAPRIO_ATTR_*. + TcaTaprioAttrPriomap uint16 = 1 + TcaTaprioAttrSchedEntryList uint16 = 2 + TcaTaprioAttrSchedBaseTime uint16 = 3 + TcaTaprioAttrSchedSingleEntry uint16 = 4 + TcaTaprioAttrSchedClockid uint16 = 5 + TcaTaprioAttrPad uint16 = 6 + TcaTaprioAttrAdminSched uint16 = 7 + TcaTaprioAttrSchedCycleTime uint16 = 8 + TcaTaprioAttrSchedCycleTimeExtension uint16 = 9 + TcaTaprioAttrFlags uint16 = 10 + TcaTaprioAttrTxtimeDelay uint16 = 11 + TcaTaprioAttrTcEntry uint16 = 12 + // TcaTaprioAttrMaxKnown is TCA_TAPRIO_ATTR_MAX. + TcaTaprioAttrMaxKnown = TcaTaprioAttrTcEntry + // TCA_TAPRIO_SCHED_ENTRY_*. + TcaTaprioSchedEntryIndex uint16 = 1 + TcaTaprioSchedEntryCmd uint16 = 2 + TcaTaprioSchedEntryGateMask uint16 = 3 + TcaTaprioSchedEntryInterval uint16 = 4 + // TcaTaprioSchedEntryMaxKnown is TCA_TAPRIO_SCHED_ENTRY_MAX. + TcaTaprioSchedEntryMaxKnown = TcaTaprioSchedEntryInterval + // TCA_TAPRIO_TC_ENTRY_*. + TcaTaprioTcEntryIndex uint16 = 1 + TcaTaprioTcEntryMaxSdu uint16 = 2 + TcaTaprioTcEntryFp uint16 = 3 + // TcaTaprioTcEntryMaxKnown is TCA_TAPRIO_TC_ENTRY_MAX. + TcaTaprioTcEntryMaxKnown = TcaTaprioTcEntryFp + // TCA_TAPRIO_OFFLOAD_STATS_*. + TcaTaprioOffloadStatsPad uint16 = 1 + TcaTaprioOffloadStatsWindowDrops uint16 = 2 + TcaTaprioOffloadStatsTxOverruns uint16 = 3 + // TcaTaprioOffloadStatsMaxKnown is TCA_TAPRIO_OFFLOAD_STATS_MAX. + TcaTaprioOffloadStatsMaxKnown = TcaTaprioOffloadStatsTxOverruns + // TCA_TAPRIO_ATTR_FLAG_*. + TcaTaprioAttrFlagTxtimeAssist uint32 = 1 << 0 + TcaTaprioAttrFlagFullOffload uint32 = 1 << 1 + + // TCA_CBS_* and TCA_ETF_*. + TcaCbsParms uint16 = 1 + // TcaCbsMaxKnown is TCA_CBS_MAX. + TcaCbsMaxKnown = TcaCbsParms + TcaEtfParms uint16 = 1 + // TcaEtfMaxKnown is TCA_ETF_MAX. + TcaEtfMaxKnown = TcaEtfParms + // TC_ETF_* flags. + TcEtfDeadlineModeOn uint32 = 1 << 0 + TcEtfOffloadOn uint32 = 1 << 1 + TcEtfSkipSockCheckOn uint32 = 1 << 2 +) + +// ErrTcSchedList is an ets quanta or priomap list tc's printer gives up on +// ("No ETS band quantum", "No ETS priomap band"), or a list longer than +// TCQ_ETS_MAX_BANDS, more than any kernel sends. mqprio's rate lists stop +// at TC_QOPT_MAX_QUEUE instead, the entries past it dropped (Q53). +var ErrTcSchedList = errors.New("xtcpnl: tc schedule list malformed") + +// TcMultiqQopt is struct tc_multiq_qopt. +type TcMultiqQopt struct { + Bands uint16 + MaxBands uint16 +} + +// DecodeTcMultiqQopt decodes a struct tc_multiq_qopt. +func DecodeTcMultiqQopt(b []byte) (TcMultiqQopt, error) { + if err := tcNeed(b, TcMultiqQoptSizeCst, "tc_multiq_qopt"); err != nil { + return TcMultiqQopt{}, err + } + r := tcRd{b: b} + return TcMultiqQopt{Bands: r.u16(), MaxBands: r.u16()}, nil +} + +// TcHfscQopt is struct tc_hfsc_qopt. +type TcHfscQopt struct{ Defcls uint16 } + +// DecodeTcHfscQopt decodes a struct tc_hfsc_qopt. +func DecodeTcHfscQopt(b []byte) (TcHfscQopt, error) { + if err := tcNeed(b, TcHfscQoptSizeCst, "tc_hfsc_qopt"); err != nil { + return TcHfscQopt{}, err + } + r := tcRd{b: b} + return TcHfscQopt{Defcls: r.u16()}, nil +} + +// TcServiceCurve is struct tc_service_curve. D is in kernel time units +// (tc_core_ktime2time converts it). +type TcServiceCurve struct { + M1 uint32 + D uint32 + M2 uint32 +} + +// DecodeTcServiceCurve decodes a struct tc_service_curve. +func DecodeTcServiceCurve(b []byte) (TcServiceCurve, error) { + if err := tcNeed(b, TcServiceCurveSizeCst, "tc_service_curve"); err != nil { + return TcServiceCurve{}, err + } + r := tcRd{b: b} + return TcServiceCurve{M1: r.u32(), D: r.u32(), M2: r.u32()}, nil +} + +// TcHfscStats is struct tc_hfsc_stats, a class's xstats. +type TcHfscStats struct { + Work uint64 + Rtwork uint64 + Period uint32 + Level uint32 +} + +// DecodeTcHfscStats decodes a struct tc_hfsc_stats. +func DecodeTcHfscStats(b []byte) (TcHfscStats, error) { + if err := tcNeed(b, TcHfscStatsSizeCst, "tc_hfsc_stats"); err != nil { + return TcHfscStats{}, err + } + r := tcRd{b: b} + return TcHfscStats{Work: r.u64(), Rtwork: r.u64(), Period: r.u32(), Level: r.u32()}, nil +} + +// TcDrrStats is struct tc_drr_stats, a class's xstats. +type TcDrrStats struct{ Deficit uint32 } + +// DecodeTcDrrStats decodes a struct tc_drr_stats. +func DecodeTcDrrStats(b []byte) (TcDrrStats, error) { + if err := tcNeed(b, TcDrrStatsSizeCst, "tc_drr_stats"); err != nil { + return TcDrrStats{}, err + } + r := tcRd{b: b} + return TcDrrStats{Deficit: r.u32()}, nil +} + +// TcQfqStats is struct tc_qfq_stats, the class xstats sch_qfq.c sends and +// tc has no printer for (Q39, K24). +type TcQfqStats struct { + Weight uint32 + Lmax uint32 +} + +// DecodeTcQfqStats decodes a struct tc_qfq_stats. +func DecodeTcQfqStats(b []byte) (TcQfqStats, error) { + if err := tcNeed(b, TcQfqStatsSizeCst, "tc_qfq_stats"); err != nil { + return TcQfqStats{}, err + } + r := tcRd{b: b} + return TcQfqStats{Weight: r.u32(), Lmax: r.u32()}, nil +} + +// TcMqprioQopt is struct tc_mqprio_qopt, mqprio's options header and +// taprio's TCA_TAPRIO_ATTR_PRIOMAP. +type TcMqprioQopt struct { + NumTc uint8 + PrioTcMap [TcQoptBitmaskCst + 1]uint8 + Hw uint8 + Count [TcQoptMaxQueueCst]uint16 + Offset [TcQoptMaxQueueCst]uint16 +} + +// DecodeTcMqprioQopt decodes a struct tc_mqprio_qopt. +func DecodeTcMqprioQopt(b []byte) (TcMqprioQopt, error) { + var q TcMqprioQopt + if err := tcNeed(b, TcMqprioQoptSizeCst, "tc_mqprio_qopt"); err != nil { + return q, err + } + r := tcRd{b: b} + q.NumTc = r.u8() + for i := range q.PrioTcMap { + q.PrioTcMap[i] = r.u8() + } + q.Hw = r.u8() + for i := range q.Count { + q.Count[i] = r.u16() + } + for i := range q.Offset { + q.Offset[i] = r.u16() + } + return q, nil +} + +// TcCbsQopt is struct tc_cbs_qopt, TCA_CBS_PARMS. +type TcCbsQopt struct { + Offload uint8 + Hicredit int32 + Locredit int32 + Idleslope int32 + Sendslope int32 +} + +// DecodeTcCbsQopt decodes a struct tc_cbs_qopt. +func DecodeTcCbsQopt(b []byte) (TcCbsQopt, error) { + if err := tcNeed(b, TcCbsQoptSizeCst, "tc_cbs_qopt"); err != nil { + return TcCbsQopt{}, err + } + r := tcRd{b: b} + q := TcCbsQopt{Offload: r.u8()} + r.off += 3 // _pad[3] + q.Hicredit, q.Locredit, q.Idleslope, q.Sendslope = r.s32(), r.s32(), r.s32(), r.s32() + return q, nil +} + +// TcEtfQopt is struct tc_etf_qopt, TCA_ETF_PARMS. +type TcEtfQopt struct { + Delta int32 + Clockid int32 + Flags uint32 +} + +// DecodeTcEtfQopt decodes a struct tc_etf_qopt. +func DecodeTcEtfQopt(b []byte) (TcEtfQopt, error) { + if err := tcNeed(b, TcEtfQoptSizeCst, "tc_etf_qopt"); err != nil { + return TcEtfQopt{}, err + } + r := tcRd{b: b} + return TcEtfQopt{Delta: r.s32(), Clockid: r.s32(), Flags: r.u32()}, nil +} + +// TcEts is ets_print_opt's reads (qdisc) and ets_print_copt's (class). +type TcEts struct { + Nbands uint8 + Nstrict uint8 + HasNstrict bool + Quanta [TcqEtsMaxBandsCst]uint32 // Quanta[:NQuanta], when HasQuanta + NQuanta int + HasQuanta bool + Priomap [TcPrioMaxCst + 1]uint8 // Priomap[:NPriomap] + NPriomap int + + Quantum uint32 // a class's TCA_ETS_QUANTA_BAND + HasQuantum bool +} + +// TcTaprioEntry is one TCA_TAPRIO_SCHED_ENTRY: print_sched_list prints +// each field that is present. +type TcTaprioEntry struct { + Index uint32 + HasIndex bool + Cmd uint8 + HasCmd bool + GateMask uint32 + HasGateMask bool + Interval uint32 + HasInterval bool +} + +// TcTaprioSched is print_schedule's reads, the oper schedule at the top +// level of the options or the admin one inside TCA_TAPRIO_ATTR_ADMIN_SCHED. +type TcTaprioSched struct { + BaseTime int64 + HasBaseTime bool + CycleTime int64 + HasCycleTime bool + CycleTimeExtension int64 + HasCycleTimeExtension bool + Entries []TcTaprioEntry + HasEntries bool +} + +// TcTcEntries is dump_tc_entries' arrays (q_mqprio.c and q_taprio.c): per +// traffic class, MaxSdu and Fp as last set, and the highest class each was +// set for, -1 when none. Entries without an index or with one of +// TC_QOPT_MAX_QUEUE or more are skipped, as tc skips them. +type TcTcEntries struct { + MaxSdu [TcQoptMaxQueueCst]uint32 + MaxTcMaxSdu int + Fp [TcQoptMaxQueueCst]uint32 + MaxTcFp int +} + +// TcMqprio is mqprio_print_opt's reads. +type TcMqprio struct { + Qopt TcMqprioQopt + // Tail is whether attributes follow the header (len > 0): only then + // are mode, shaper, rates and entries read, and mode and shaper + // default to dcb. + Tail bool + Mode uint16 + HasMode bool + Shaper uint16 + HasShaper bool + MinRate [TcQoptMaxQueueCst]uint64 // MinRate[:NMinRate] + NMinRate int + HasMinRate bool + MaxRate [TcQoptMaxQueueCst]uint64 + NMaxRate int + HasMaxRate bool + TcEntries TcTcEntries +} + +// TcTaprio is taprio_print_opt's reads. +type TcTaprio struct { + Priomap TcMqprioQopt + Clockid int32 + HasClockid bool + Flags uint32 + HasFlags bool + TxtimeDelay int32 // rta_getattr_s32 of a u32 (Q55) + HasTxtimeDelay bool + Oper TcTaprioSched + Admin TcTaprioSched + HasAdmin bool + TcEntries TcTcEntries +} + +// TcSched is the increment-15 kinds' options decoded; TcQopt.Sched. +type TcSched struct { + Multiq TcMultiqQopt + HasMultiq bool // multiq_print_opt prints nothing for a short struct + Hfsc TcHfscQopt + HasHfsc bool + + // hfsc class curves; a short one is skipped with tc's "HFSC: + // truncated ... option" warning, so it is not an error. + HfscRsc TcServiceCurve + HasHfscRsc bool + HfscFsc TcServiceCurve + HasHfscFsc bool + HfscUsc TcServiceCurve + HasHfscUsc bool + + DrrQuantum uint32 + HasDrrQuantum bool + QfqWeight uint32 + HasQfqWeight bool + QfqLmax uint32 + HasQfqLmax bool + + Ets TcEts + Mqprio TcMqprio + Taprio TcTaprio + Cbs TcCbsQopt + Etf TcEtfQopt +} + +// parseSched decodes kind's qdisc options; ok is false for a kind that is +// not one of increment 15's. +func (q *TcQopt) parseSched(kind string, opt []byte, class bool) (bool, error) { + s := &q.Sched + var err error + switch kind { + case TcKindDrr: + err = q.parseDrr(opt) + case TcKindQfq: + err = q.parseQfq(opt) + case TcKindHfsc: + if class { + err = q.parseHfscClass(opt) + } else { + s.Hfsc, err = DecodeTcHfscQopt(opt) + s.HasHfsc = err == nil + } + case TcKindEts: + err = q.parseEts(opt, class) + case TcKindMqprio: + err = s.Mqprio.parse(opt) + case TcKindTaprio: + err = q.parseTaprio(opt) + case TcKindMultiq: + if len(opt) >= TcMultiqQoptSizeCst { + s.Multiq, err = DecodeTcMultiqQopt(opt) + s.HasMultiq = err == nil + } + case TcKindCbs: + var b []byte + if b, err = q.parms(opt, TcaCbsMaxKnown, TcaCbsParms, "TCA_CBS_PARMS"); err == nil { + s.Cbs, err = DecodeTcCbsQopt(b) + } + case TcKindEtf: + var b []byte + if b, err = q.parms(opt, TcaEtfMaxKnown, TcaEtfParms, "TCA_ETF_PARMS"); err == nil { + s.Etf, err = DecodeTcEtfQopt(b) + } + default: + return false, nil + } + return true, err +} + +// parseDrr is drr_print_opt, the qdisc's (no options: sch_drr.c has no +// .dump, K29) and the class's. +func (q *TcQopt) parseDrr(opt []byte) error { + tb, err := ParseAttrTableFlags(opt, TcaDrrMaxKnown, tcNestedFlags) + if err != nil { + return err + } + q.Tb = tb + if tb.Has(TcaDrrQuantum) { + if err := tcNeed(tb.Bytes(TcaDrrQuantum), 4, "TCA_DRR_QUANTUM"); err != nil { + return err + } + q.Sched.DrrQuantum, q.Sched.HasDrrQuantum = tb.U32(TcaDrrQuantum) + } + return nil +} + +// parseQfq is qfq_print_opt, the qdisc's (none, K29) and the class's. +func (q *TcQopt) parseQfq(opt []byte) error { + tb, err := ParseAttrTableFlags(opt, TcaQfqMaxKnown, tcNestedFlags) + if err != nil { + return err + } + q.Tb = tb + s := &q.Sched + if tb.Has(TcaQfqWeight) { + if err := tcNeed(tb.Bytes(TcaQfqWeight), 4, "TCA_QFQ_WEIGHT"); err != nil { + return err + } + s.QfqWeight, s.HasQfqWeight = tb.U32(TcaQfqWeight) + } + if tb.Has(TcaQfqLmax) { + if err := tcNeed(tb.Bytes(TcaQfqLmax), 4, "TCA_QFQ_LMAX"); err != nil { + return err + } + s.QfqLmax, s.HasQfqLmax = tb.U32(TcaQfqLmax) + } + return nil +} + +// parseHfscClass is hfsc_print_class_opt's reads. +func (q *TcQopt) parseHfscClass(opt []byte) error { + tb, err := ParseAttrTableFlags(opt, TcaHfscMaxKnown, tcNestedFlags) + if err != nil { + return err + } + q.Tb = tb + s := &q.Sched + for _, c := range []struct { + t uint16 + sc *TcServiceCurve + has *bool + }{ + {TcaHfscRsc, &s.HfscRsc, &s.HasHfscRsc}, + {TcaHfscFsc, &s.HfscFsc, &s.HasHfscFsc}, + {TcaHfscUsc, &s.HfscUsc, &s.HasHfscUsc}, + } { + if b := tb.Bytes(c.t); len(b) >= TcServiceCurveSizeCst { + if *c.sc, err = DecodeTcServiceCurve(b); err != nil { + return err + } + *c.has = true + } + } + return nil +} + +// parseEts is ets_print_opt (NBANDS and PRIOMAP required, "Incomplete ETS +// options") or, for a class, ets_print_copt. +func (q *TcQopt) parseEts(opt []byte, class bool) error { + tb, err := ParseAttrTableFlags(opt, TcaEtsMaxKnown, tcNestedFlags) + if err != nil { + return err + } + q.Tb = tb + e := &q.Sched.Ets + if class { + if tb.Has(TcaEtsQuantaBand) { + if err := tcNeed(tb.Bytes(TcaEtsQuantaBand), 4, "TCA_ETS_QUANTA_BAND"); err != nil { + return err + } + e.Quantum, e.HasQuantum = tb.U32(TcaEtsQuantaBand) + } + return nil + } + if !tb.Has(TcaEtsNbands) || !tb.Has(TcaEtsPriomap) { + return fmt.Errorf("%w: TCA_ETS_NBANDS or TCA_ETS_PRIOMAP", ErrTcMissing) + } + if err := tcNeed(tb.Bytes(TcaEtsNbands), 1, "TCA_ETS_NBANDS"); err != nil { + return err + } + e.Nbands, _ = tb.U8(TcaEtsNbands) + if tb.Has(TcaEtsNstrict) { + if err := tcNeed(tb.Bytes(TcaEtsNstrict), 1, "TCA_ETS_NSTRICT"); err != nil { + return err + } + e.Nstrict, e.HasNstrict = tb.U8(TcaEtsNstrict) + } + if tb.Has(TcaEtsQuanta) { + n, err := etsList(tb.Bytes(TcaEtsQuanta), TcaEtsQuantaBand, 4, 0, func(i int, v []byte) { + e.Quanta[i] = binary.LittleEndian.Uint32(v) + }) + if err != nil { + return err + } + e.NQuanta, e.HasQuanta = n, true + } + n, err := etsList(tb.Bytes(TcaEtsPriomap), TcaEtsPriomapBand, 1, 3, func(i int, v []byte) { + e.Priomap[i] = v[0] + }) + e.NPriomap = n + return err +} + +// etsList is ets_print_opt_quanta's and ets_print_opt_priomap's loop: at +// each offset, parse_rtattr (no flag masked) from there to the end takes +// the first attribute of type band, and the offset steps by the rta_len +// at that offset plus pad (3 for the priomap's u8s). A step with no band +// attribute, or a band shorter than width, is ErrTcSchedList, where tc +// prints "No ETS ..." (or reads past the attribute). At most +// TCQ_ETS_MAX_BANDS (and TC_PRIO_MAX+1) entries are kept. +func etsList(b []byte, band uint16, width, pad int, set func(i int, v []byte)) (int, error) { + n := 0 + for off := 0; off < len(b); { + var val []byte + found := false + walkRawAttrsLoose(b[off:], func(raw uint16, v []byte) { + if !found && raw == band { + val, found = v, true + } + }) + if len(b)-off < RTAttrSizeCst || !found { + return n, fmt.Errorf("%w: no band attribute at offset %d", ErrTcSchedList, off) + } + if len(val) < width { + return n, fmt.Errorf("%w: band attribute of %d bytes at offset %d", ErrTcSchedList, len(val), off) + } + if n == TcqEtsMaxBandsCst { + return n, fmt.Errorf("%w: more than %d bands", ErrTcSchedList, TcqEtsMaxBandsCst) + } + set(n, val) + n++ + off += int(binary.LittleEndian.Uint16(b[off:off+2])) + pad + } + return n, nil +} + +// parse is mqprio_print_opt's reads: the header ("options size error" +// short of RTA_ALIGN(sizeof)), then parse_rtattr over what follows. +func (m *TcMqprio) parse(opt []byte) error { + if len(opt) < tcMqprioQoptAlignedSz { + return fmt.Errorf("%w: mqprio options are %d bytes, want %d", ErrTcShort, len(opt), tcMqprioQoptAlignedSz) + } + var err error + if m.Qopt, err = DecodeTcMqprioQopt(opt); err != nil { + return err + } + tail := opt[tcMqprioQoptAlignedSz:] + m.TcEntries = TcTcEntries{MaxTcMaxSdu: -1, MaxTcFp: -1} + if len(tail) == 0 { + return nil + } + m.Tail = true + tb, err := ParseAttrTableFlags(tail, TcaMqprioMaxKnown, 0) + if err != nil { + return err + } + if tb.Has(TcaMqprioMode) { + if m.Mode, m.HasMode = tb.U16(TcaMqprioMode); !m.HasMode { + return fmt.Errorf("%w: TCA_MQPRIO_MODE", ErrTcShort) + } + } + if tb.Has(TcaMqprioShaper) { + if m.Shaper, m.HasShaper = tb.U16(TcaMqprioShaper); !m.HasShaper { + return fmt.Errorf("%w: TCA_MQPRIO_SHAPER", ErrTcShort) + } + } + if tb.Has(TcaMqprioMinRate64) { + if m.NMinRate, err = mqprioRates(tb.Bytes(TcaMqprioMinRate64), TcaMqprioMinRate64, &m.MinRate); err != nil { + return err + } + m.HasMinRate = true + } + if tb.Has(TcaMqprioMaxRate64) { + if m.NMaxRate, err = mqprioRates(tb.Bytes(TcaMqprioMaxRate64), TcaMqprioMaxRate64, &m.MaxRate); err != nil { + return err + } + m.HasMaxRate = true + } + return tcEntries(tail, TcaMqprioTcEntry, TcaMqprioTcEntryMaxKnown, TcaMqprioTcEntryIndex, 0, TcaMqprioTcEntryFp, &m.TcEntries) +} + +// mqprioRates is the MIN_RATE64/MAX_RATE64 RTA_OK loop: every member must +// be of the list's own type (tc returns -1 otherwise) and a u64. tc writes +// each into a 16-entry stack array with no bound (Q53); the entries past +// it are dropped here. +func mqprioRates(b []byte, t uint16, out *[TcQoptMaxQueueCst]uint64) (int, error) { + n := 0 + var bad error + walkRawAttrsLoose(b, func(raw uint16, v []byte) { + switch { + case bad != nil: + case raw != t: + bad = fmt.Errorf("%w: rate attribute type %d in a list of %d", ErrTcSchedList, raw, t) + case len(v) < 8: + bad = fmt.Errorf("%w: rate attribute of %d bytes", ErrTcShort, len(v)) + case n < len(out): + out[n] = binary.LittleEndian.Uint64(v) + n++ + } + }) + return n, bad +} + +// tcEntries is dump_tc_entries: an RTA_OK walk of b for raw type entry +// with NLA_F_NESTED set, each parsed nested; sdu 0 is a list without +// MAX_SDU (mqprio's). A missing index or one of 16 or more is tc's message +// and the entry skipped. A present index, MAX_SDU or FP shorter than a u32 +// is where tc reads past the attribute: ErrTcShort, as gotc refuses it. +// Each value is checked before its array slot or highest-index marker is +// touched. +func tcEntries(b []byte, entry, maxType, index, sdu, fp uint16, out *TcTcEntries) error { + var bad error + walkRawAttrsLoose(b, func(raw uint16, v []byte) { + if bad != nil || raw != entry|tcNestedFlags { + return + } + var buf smallAttrBuf + tb := parseSmallLoose(v, maxType, &buf) + tc, has, err := tcOptU32(tb, index, "TC_ENTRY_INDEX") + if err != nil { + bad = err + return + } + if !has || tc >= TcQoptMaxQueueCst { + return + } + if sdu != 0 { + s, hasSdu, err := tcOptU32(tb, sdu, "TC_ENTRY_MAX_SDU") + if err != nil { + bad = err + return + } + if hasSdu { + out.MaxSdu[tc] = s + out.MaxTcMaxSdu = max(out.MaxTcMaxSdu, int(tc)) + } + } + f, hasFp, err := tcOptU32(tb, fp, "TC_ENTRY_FP") + if err != nil { + bad = err + return + } + if hasFp { + out.Fp[tc] = f + out.MaxTcFp = max(out.MaxTcFp, int(tc)) + } + }) + return bad +} + +// smallAttrBuf backs the table of a small nest (a tc or schedule entry) +// on the caller's stack. +type smallAttrBuf [TcaTaprioSchedEntryMaxKnown + 1][]byte + +// parseSmallLoose is parse_rtattr_nested over a nest of at most +// len(smallAttrBuf)-1 types, as ParseAttrTableLoose without its +// allocation: RTA_OK stops at a malformed attribute, keeping those before. +func parseSmallLoose(data []byte, maxType uint16, buf *smallAttrBuf) AttrTable { + t := AttrTable{vals: buf[:min(int(maxType)+1, len(buf))]} + walkRawAttrsLoose(data, func(raw uint16, val []byte) { + atype := raw &^ tcNestedFlags + if int(atype) < len(t.vals) && t.vals[atype] == nil { + t.vals[atype] = val[:len(val):len(val)] + } + }) + return t +} + +// parseTaprio is taprio_print_opt's reads: PRIOMAP is required (tc +// returns -1), then the top level's fields, the oper schedule, the admin +// schedule and the tc entries. +func (q *TcQopt) parseTaprio(opt []byte) error { + tb, err := ParseAttrTableFlags(opt, TcaTaprioAttrMaxKnown, tcNestedFlags) + if err != nil { + return err + } + q.Tb = tb + t := &q.Sched.Taprio + if !tb.Has(TcaTaprioAttrPriomap) { + return fmt.Errorf("%w: TCA_TAPRIO_ATTR_PRIOMAP", ErrTcMissing) + } + if t.Priomap, err = DecodeTcMqprioQopt(tb.Bytes(TcaTaprioAttrPriomap)); err != nil { + return err + } + var v uint32 + if v, t.HasClockid, err = tcOptU32(tb, TcaTaprioAttrSchedClockid, "TCA_TAPRIO_ATTR_SCHED_CLOCKID"); err != nil { + return err + } + t.Clockid = cint.Int(v) + if t.Flags, t.HasFlags, err = tcOptU32(tb, TcaTaprioAttrFlags, "TCA_TAPRIO_ATTR_FLAGS"); err != nil { + return err + } + if v, t.HasTxtimeDelay, err = tcOptU32(tb, TcaTaprioAttrTxtimeDelay, "TCA_TAPRIO_ATTR_TXTIME_DELAY"); err != nil { + return err + } + t.TxtimeDelay = cint.Int(v) // rta_getattr_s32 (Q55) + if t.Oper, err = taprioSched(tb); err != nil { + return err + } + if tb.Has(TcaTaprioAttrAdminSched) { + at, err := ParseAttrTableFlags(tb.Bytes(TcaTaprioAttrAdminSched), TcaTaprioAttrMaxKnown, tcNestedFlags) + if err != nil { + return err + } + if t.Admin, err = taprioSched(at); err != nil { + return err + } + t.HasAdmin = true + } + t.TcEntries = TcTcEntries{MaxTcMaxSdu: -1, MaxTcFp: -1} + return tcEntries(opt, TcaTaprioAttrTcEntry, TcaTaprioTcEntryMaxKnown, TcaTaprioTcEntryIndex, + TcaTaprioTcEntryMaxSdu, TcaTaprioTcEntryFp, &t.TcEntries) +} + +// taprioSched is print_schedule: the s64 times and the entry list, each +// entry parsed nested with its fields read when present. +func taprioSched(tb AttrTable) (TcTaprioSched, error) { + var s TcTaprioSched + var err error + if s.BaseTime, s.HasBaseTime, err = tcOptS64(tb, TcaTaprioAttrSchedBaseTime, "TCA_TAPRIO_ATTR_SCHED_BASE_TIME"); err != nil { + return s, err + } + if s.CycleTime, s.HasCycleTime, err = tcOptS64(tb, TcaTaprioAttrSchedCycleTime, "TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME"); err != nil { + return s, err + } + if s.CycleTimeExtension, s.HasCycleTimeExtension, err = tcOptS64(tb, TcaTaprioAttrSchedCycleTimeExtension, + "TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION"); err != nil { + return s, err + } + if !tb.Has(TcaTaprioAttrSchedEntryList) { + return s, nil + } + s.HasEntries = true + var bad error + walkRawAttrsLoose(tb.Bytes(TcaTaprioAttrSchedEntryList), func(_ uint16, v []byte) { + if bad != nil { + return + } + var buf smallAttrBuf + et := parseSmallLoose(v, TcaTaprioSchedEntryMaxKnown, &buf) + e, err := taprioEntry(et) + if err != nil { + bad = err + return + } + s.Entries = append(s.Entries, e) + }) + return s, bad +} + +// taprioEntry is print_sched_list's reads of one entry: each field when +// present, at its width. +func taprioEntry(et AttrTable) (TcTaprioEntry, error) { + var e TcTaprioEntry + var err error + if e.Index, e.HasIndex, err = tcOptU32(et, TcaTaprioSchedEntryIndex, "TCA_TAPRIO_SCHED_ENTRY_INDEX"); err != nil { + return e, err + } + if et.Has(TcaTaprioSchedEntryCmd) { + if e.Cmd, e.HasCmd = et.U8(TcaTaprioSchedEntryCmd); !e.HasCmd { + return e, fmt.Errorf("%w: TCA_TAPRIO_SCHED_ENTRY_CMD", ErrTcShort) + } + } + if e.GateMask, e.HasGateMask, err = tcOptU32(et, TcaTaprioSchedEntryGateMask, "TCA_TAPRIO_SCHED_ENTRY_GATE_MASK"); err != nil { + return e, err + } + e.Interval, e.HasInterval, err = tcOptU32(et, TcaTaprioSchedEntryInterval, "TCA_TAPRIO_SCHED_ENTRY_INTERVAL") + return e, err +} + +// tcOptU32 is `if (tb[t]) v = rta_getattr_u32(tb[t])`: has is whether +// the attribute is present, and a present one shorter than a u32 is +// ErrTcShort (tc reads past it). +func tcOptU32(tb AttrTable, t uint16, what string) (uint32, bool, error) { + if !tb.Has(t) { + return 0, false, nil + } + v, ok := tb.U32(t) + if !ok { + return 0, false, fmt.Errorf("%w: %s", ErrTcShort, what) + } + return v, true, nil +} + +// tcOptU64 is tcOptU32 for rta_getattr_u64. +func tcOptU64(tb AttrTable, t uint16, what string) (uint64, bool, error) { + if !tb.Has(t) { + return 0, false, nil + } + v, ok := tb.U64(t) + if !ok { + return 0, false, fmt.Errorf("%w: %s", ErrTcShort, what) + } + return v, true, nil +} + +// tcOptS64 is tcOptU32 for rta_getattr_s64. +func tcOptS64(tb AttrTable, t uint16, what string) (int64, bool, error) { + v, has, err := tcOptU64(tb, t, what) + return cint.LongLong(v), has, err +} + +// parms is cbs_print_opt's and etf_print_opt's first reads: the nest's +// PARMS, which tc requires. +func (q *TcQopt) parms(opt []byte, maxType, parms uint16, what string) ([]byte, error) { + tb, err := ParseAttrTableFlags(opt, maxType, tcNestedFlags) + if err != nil { + return nil, err + } + q.Tb = tb + if !tb.Has(parms) { + return nil, fmt.Errorf("%w: %s", ErrTcMissing, what) + } + return tb.Bytes(parms), nil +} + +// parseSchedXstats decodes the increment-15 kinds' xstats; ok is false +// for another kind. drr and hfsc print class xstats (ErrTcShort when +// short); taprio prints its offload stats nest; qfq, ets, mqprio, multiq, +// cbs and etf have no print_xstats. +func (x *TcXstats) parseSchedXstats(kind string, b []byte) (bool, error) { + var err error + switch kind { + case TcKindQfq, TcKindEts, TcKindMqprio, TcKindMultiq, TcKindCbs, TcKindEtf: + return true, nil + case TcKindDrr: + x.Drr, err = DecodeTcDrrStats(b) + case TcKindHfsc: + x.Hfsc, err = DecodeTcHfscStats(b) + case TcKindTaprio: + err = x.parseTaprioXstats(b) + default: + return false, nil + } + x.Has = err == nil + return true, err +} + +// parseTaprioXstats is taprio_print_xstats: the offload stats nest, each +// counter a u64 when present. +func (x *TcXstats) parseTaprioXstats(b []byte) error { + tb, err := ParseAttrTableFlags(b, TcaTaprioOffloadStatsMaxKnown, tcNestedFlags) + if err != nil { + return err + } + if x.TaprioWindowDrops, x.HasTaprioWindowDrops, err = tcOptU64(tb, TcaTaprioOffloadStatsWindowDrops, + "TCA_TAPRIO_OFFLOAD_STATS_WINDOW_DROPS"); err != nil { + return err + } + x.TaprioTxOverruns, x.HasTaprioTxOverruns, err = tcOptU64(tb, TcaTaprioOffloadStatsTxOverruns, + "TCA_TAPRIO_OFFLOAD_STATS_TX_OVERRUNS") + return err +} diff --git a/pkg/xtcpnl/xtcpnl_tc_sched_test.go b/pkg/xtcpnl/xtcpnl_tc_sched_test.go new file mode 100644 index 000000000..8bc76809d --- /dev/null +++ b/pkg/xtcpnl/xtcpnl_tc_sched_test.go @@ -0,0 +1,484 @@ +package xtcpnl + +import ( + "errors" + "fmt" + "path/filepath" + "strings" + "testing" + + "golang.org/x/sys/unix" +) + +// tcschedMsgs is every kernel reply of kind in a tcsched row's capture: +// qdiscs, or classes when class. +func tcschedMsgs(t testing.TB, row, kind string, class bool) []TcInfo { + t.Helper() + want := uint16(unix.RTM_NEWQDISC) + if class { + want = unix.RTM_NEWTCLASS + } + var out []TcInfo + for _, m := range pcapNlMsgs(t, filepath.Join("testdata", "7_3_1", "ws", "tcsched", row, "ip.pcap")) { + if m.proto != unix.NETLINK_ROUTE || m.h.Flags&unix.NLM_F_REQUEST != 0 || m.h.Type != want { + continue + } + ti, err := ParseTcMsg(m.body) + if err != nil { + t.Fatal(err) + } + if ti.Kind == kind { + out = append(out, ti) + } + } + if len(out) == 0 { + t.Fatalf("%s: no %s message", row, kind) + } + return out +} + +// tcschedXstats is a captured message's xstats as print_xstats gets them: +// TCA_STATS_APP, else TCA_XSTATS. +func tcschedXstats(t testing.TB, ti TcInfo) []byte { + t.Helper() + if ti.HasStats2 { + s, err := ParseTcStats2(ti.Stats2) + if err != nil { + t.Fatal(err) + } + if s.HasApp { + return s.App + } + } + return ti.Xstats +} + +// schedMqprioQopt is a struct tc_mqprio_qopt with num_tc 2, queues 4@0 +// 4@4, RTA_ALIGN-padded as the kernel sends it. +func schedMqprioQopt(pad int) []byte { + b := make([]byte, TcMqprioQoptSizeCst+pad) + b[0] = 2 + b[3], b[4] = 1, 1 + copy(b[18:], le16(4)) + copy(b[20:], le16(4)) + copy(b[50:], le16(0)) + copy(b[52:], le16(4)) + return b +} + +func nest(t uint16, kids ...[]byte) []byte { return rtattr(t|unix.NLA_F_NESTED, cat(kids...)) } + +// schedTcEntry is a TCA_*_TC_ENTRY nest: index and fp. +func schedTcEntry(entry uint16, index, fp uint32) []byte { + return nest(entry, rtattr(1, le32(index)), rtattr(TcaMqprioTcEntryFp, le32(fp))) +} + +// shortTcEntry parses a tc entry at index 0 whose scalar t has a payload +// of 0 to 4 bytes, one "len err" per length. +func shortTcEntry(kind string, entry, t uint16) string { + out := make([]string, 0, 5) + for n := range 5 { + e := nest(entry, rtattr(1, le32(0)), rtattr(t, make([]byte, n))) + in := cat(schedMqprioQopt(2), e) + if kind == TcKindTaprio { + in = schedTaprioOpts(e) + } + _, err := ParseTcQopt(kind, in) + s := "" + if err != nil { + s = schedErr(err) + } + out = append(out, fmt.Sprintf("%d %s", n, s)) + } + return strings.Join(out, "; ") +} + +func schedTaprioOpts(extra ...[]byte) []byte { + return cat(append([][]byte{rtattr(TcaTaprioAttrPriomap, schedMqprioQopt(0))}, extra...)...) +} + +func schedSum(q TcQopt, err error) string { + if err != nil { + return "err " + schedErr(err) + } + s := q.Sched + switch q.Kind { + case TcKindDrr: + return fmt.Sprintf("quantum %d %t", s.DrrQuantum, s.HasDrrQuantum) + case TcKindQfq: + return fmt.Sprintf("weight %d %t lmax %d %t", s.QfqWeight, s.HasQfqWeight, s.QfqLmax, s.HasQfqLmax) + case TcKindMultiq: + return fmt.Sprintf("bands %d/%d %t", s.Multiq.Bands, s.Multiq.MaxBands, s.HasMultiq) + case TcKindCbs: + c := s.Cbs + return fmt.Sprintf("hi %d lo %d send %d idle %d off %d", c.Hicredit, c.Locredit, c.Sendslope, c.Idleslope, c.Offload) + case TcKindEtf: + return fmt.Sprintf("delta %d clock %d flags %#x", s.Etf.Delta, s.Etf.Clockid, s.Etf.Flags) + case TcKindEts: + e := s.Ets + return fmt.Sprintf("bands %d strict %d %t quanta %t %v priomap %v quantum %d %t", e.Nbands, e.Nstrict, e.HasNstrict, + e.HasQuanta, e.Quanta[:e.NQuanta], e.Priomap[:e.NPriomap], e.Quantum, e.HasQuantum) + case TcKindMqprio: + m := s.Mqprio + return fmt.Sprintf("tc %d map %v count %v offset %v tail %t mode %d %t shaper %d %t min %v max %v fp %d %v", + m.Qopt.NumTc, m.Qopt.PrioTcMap[:4], m.Qopt.Count[:2], m.Qopt.Offset[:2], m.Tail, m.Mode, m.HasMode, + m.Shaper, m.HasShaper, m.MinRate[:m.NMinRate], m.MaxRate[:m.NMaxRate], m.TcEntries.MaxTcFp, m.TcEntries.Fp[:2]) + } + return "?" +} + +func schedErr(err error) string { + for _, e := range []error{ErrTcShort, ErrTcMissing, ErrTcSchedList, ErrTcKindUnknown, ErrRTAttrSmall} { + if errors.Is(err, e) { + return e.Error() + } + } + return err.Error() +} + +// schedFrom is s from the first sep on. +func schedFrom(s, sep string) string { + if i := strings.Index(s, sep); i >= 0 { + return s[i:] + } + return s +} + +func schedCurves(q TcQopt, err error) string { + if err != nil { + return "err " + schedErr(err) + } + s := q.Sched + return fmt.Sprintf("rt %v %t ls %v %t ul %v %t", s.HfscRsc, s.HasHfscRsc, s.HfscFsc, s.HasHfscFsc, s.HfscUsc, s.HasHfscUsc) +} + +func schedTaprioSum(q TcQopt, err error) string { + if err != nil { + return "err " + schedErr(err) + } + tp := q.Sched.Taprio + sched := func(s TcTaprioSched) string { + out := fmt.Sprintf("base %d cycle %d ext %d:", s.BaseTime, s.CycleTime, s.CycleTimeExtension) + for _, e := range s.Entries { + out += fmt.Sprintf(" [%d %d %#x %d]", e.Index, e.Cmd, e.GateMask, e.Interval) + } + return out + } + out := fmt.Sprintf("tc %d clock %d %t flags %#x %t txtime %d %t oper {%s}", tp.Priomap.NumTc, tp.Clockid, tp.HasClockid, + tp.Flags, tp.HasFlags, tp.TxtimeDelay, tp.HasTxtimeDelay, sched(tp.Oper)) + if tp.HasAdmin { + out += " admin {" + sched(tp.Admin) + "}" + } + return out + fmt.Sprintf(" sdu %d fp %d", tp.TcEntries.MaxTcMaxSdu, tp.TcEntries.MaxTcFp) +} + +// TestParseTcSched decodes the increment-15 kinds' options from the +// tcsched captures and from crafted bytes. The captured rows' tc output +// (testdata/7_3_1/ws/tcsched//ip.out) gives the expected values. +// +// go test ./pkg/xtcpnl/ -run TestParseTcSched +func TestParseTcSched(t *testing.T) { + cap1 := func(row, kind string, class bool, i int) TcInfo { return tcschedMsgs(t, row, kind, class)[i] } + qopt := func(row, kind string, i int) string { + ti := cap1(row, kind, false, i) + return schedSum(ParseTcQopt(kind, ti.Options)) + } + copt := func(row, kind string, i int) string { + ti := cap1(row, kind, true, i) + return schedSum(ParseTcCopt(kind, ti.Options)) + } + curves := func(row string, i int) string { + return schedCurves(ParseTcCopt(TcKindHfsc, cap1(row, TcKindHfsc, true, i).Options)) + } + taprio := func(row string) string { + return schedTaprioSum(ParseTcQopt(TcKindTaprio, cap1(row, TcKindTaprio, false, 0).Options)) + } + sc := func(m1, d, m2 uint32) []byte { return cat(le32(m1), le32(d), le32(m2)) } + quanta := func(kids ...[]byte) []byte { + return cat(rtattr(TcaEtsNbands, []byte{3}), nest(TcaEtsQuanta, kids...), + nest(TcaEtsPriomap, rtattr(TcaEtsPriomapBand, []byte{0}))) + } + rates := func(n int) []byte { + kids := make([][]byte, n) + for i := range kids { + kids[i] = rtattr(TcaMqprioMinRate64, le64(uint64(1000+i))) + } + return cat(schedMqprioQopt(2), rtattr(TcaMqprioMinRate64, cat(kids...))) // nla_nest_start_noflag + } + entries := func(idx ...uint32) []byte { + b := schedMqprioQopt(2) + for _, i := range idx { + b = cat(b, schedTcEntry(TcaMqprioTcEntry, i, TcFpPreemptible)) + } + return b + } + tests := []struct { + description string + input func() string + expected string + }{ + // Positive: captured. + {"positive: drr class quantum, set and default (pw-001)", func() string { return copt("pw-001", TcKindDrr, 0) + "; " + copt("pw-001", TcKindDrr, 1) }, + "quantum 1514 true; quantum 1514 true"}, + {"positive: qfq classes (ec-006)", func() string { return copt("ec-006", TcKindQfq, 0) + "; " + copt("ec-006", TcKindQfq, 1) }, + "weight 1 true lmax 1514 true; weight 30 true lmax 9000 true"}, + {"positive: hfsc default 10 (ec-008)", func() string { + q, err := ParseTcQopt(TcKindHfsc, cap1("ec-008", TcKindHfsc, false, 0).Options) + return fmt.Sprintf("%#x %t %v", q.Sched.Hfsc.Defcls, q.Sched.HasHfsc, err) + }, "0x10 true "}, + {"positive: hfsc rt and ls differ (ec-009, 1:10)", func() string { return curves("ec-009", 2) }, + "rt {250000 10000 125000} true ls {0 0 375000} true ul {0 0 0} false"}, + {"positive: hfsc rt equal to ls, printed as sc (ec-009, 1:20, Q43)", func() string { return curves("ec-009", 3) }, + "rt {0 0 125000} true ls {0 0 125000} true ul {0 0 0} false"}, + {"positive: hfsc ls and ul (ec-009, 1:1)", func() string { return curves("ec-009", 1) }, + "rt {0 0 1250000} true ls {0 0 1250000} true ul {0 0 2500000} true"}, + {"positive: ets bands 3 strict 1 (ec-015)", func() string { return qopt("ec-015", TcKindEts, 0) }, + "bands 3 strict 1 true quanta true [1500 3000] priomap [2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 2] quantum 0 false"}, + {"positive: ets classes, the strict one without a quantum (ec-016, Q46)", func() string { + return copt("ec-016", TcKindEts, 0) + "; " + copt("ec-016", TcKindEts, 1) + }, "bands 0 strict 0 false quanta false [] priomap [] quantum 0 false; bands 0 strict 0 false quanta false [] priomap [] quantum 1500 true"}, + {"positive: cbs (ec-021)", func() string { return qopt("ec-021", TcKindCbs, 0) }, + "hi 30 lo -1470 send -980000 idle 20000 off 0"}, + {"positive: etf skip_sock_check, CLOCK_TAI (ec-021)", func() string { return qopt("ec-021", TcKindEtf, 0) }, + "delta 300000 clock 11 flags 0x4"}, + {"positive: multiq bands 8/8 (ec-026, K27)", func() string { return qopt("ec-026", TcKindMultiq, 0) }, "bands 8/8 true"}, + {"positive: mqprio hw 0, no mode attribute, 16 entries (ec-028, Q49)", func() string { return qopt("ec-028", TcKindMqprio, 0) }, + "tc 2 map [0 0 1 1] count [4 4] offset [0 4] tail true mode 0 false shaper 0 false min [] max [] fp 15 [1 1]"}, + {"positive: taprio txtime-assist (ec-033, Q55)", func() string { return taprio("ec-033") }, + "tc 2 clock 11 true flags 0x1 true txtime 200000 true oper {base 1000000000 cycle 500000 ext 0: [0 0 0x1 300000] [1 0 0x2 200000]} sdu 15 fp 15"}, + {"positive: taprio oper and admin (ec-038, Q57)", func() string { return taprio("ec-038") }, + "tc 2 clock 11 true flags 0x0 false txtime 0 false oper {base 1000000000 cycle 500000 ext 0: [0 0 0x1 300000] [1 0 0x2 200000]} " + + "admin {base 4000000000000000000 cycle 100000 ext 0: [0 0 0x3 100000]} sdu 15 fp 15"}, + // Positive: crafted. + {"positive: hfsc class with rt, ls and ul", func() string { + return schedCurves(ParseTcCopt(TcKindHfsc, cat(rtattr(TcaHfscRsc, sc(1, 2, 3)), rtattr(TcaHfscFsc, sc(4, 5, 6)), rtattr(TcaHfscUsc, sc(7, 8, 9))))) + }, "rt {1 2 3} true ls {4 5 6} true ul {7 8 9} true"}, + // Negative. + {"negative: mqprio options of sizeof, short of RTA_ALIGN(sizeof)", func() string { + return schedSum(ParseTcQopt(TcKindMqprio, schedMqprioQopt(1))) + }, "err " + ErrTcShort.Error()}, + {"negative: taprio without PRIOMAP", func() string { + return schedTaprioSum(ParseTcQopt(TcKindTaprio, rtattr(TcaTaprioAttrFlags, le32(1)))) + }, "err " + ErrTcMissing.Error()}, + {"negative: taprio entry with a 2-byte index", func() string { + return schedTaprioSum(ParseTcQopt(TcKindTaprio, schedTaprioOpts(nest(TcaTaprioAttrSchedEntryList, + nest(1, rtattr(TcaTaprioSchedEntryIndex, le16(5))))))) + }, "err " + ErrTcShort.Error()}, + {"negative: taprio entry whose second attribute overruns keeps the first, as C", func() string { + bad := cat(rtattr(TcaTaprioSchedEntryIndex, le32(5)), []byte{0x40, 0, byte(TcaTaprioSchedEntryCmd), 0}) + return schedTaprioSum(ParseTcQopt(TcKindTaprio, schedTaprioOpts(nest(TcaTaprioAttrSchedEntryList, nest(1, bad))))) + }, "tc 2 clock 0 false flags 0x0 false txtime 0 false oper {base 0 cycle 0 ext 0: [5 0 0x0 0]} sdu -1 fp -1"}, + {"negative: cbs without PARMS", func() string { return schedSum(ParseTcQopt(TcKindCbs, rtattr(2, le32(0)))) }, "err " + ErrTcMissing.Error()}, + {"negative: etf PARMS short", func() string { + return schedSum(ParseTcQopt(TcKindEtf, rtattr(TcaEtfParms, make([]byte, TcEtfQoptSizeCst-1)))) + }, "err " + ErrTcShort.Error()}, + {"negative: ets without PRIOMAP", func() string { return schedSum(ParseTcQopt(TcKindEts, rtattr(TcaEtsNbands, []byte{3}))) }, + "err " + ErrTcMissing.Error()}, + {"negative: an ets class's options read as a qdisc's", func() string { + return schedSum(ParseTcQopt(TcKindEts, rtattr(TcaEtsQuantaBand, le32(1500)))) + }, "err " + ErrTcMissing.Error()}, + {"negative: ets quanta holding only a priomap band", func() string { + return schedSum(ParseTcQopt(TcKindEts, quanta(rtattr(TcaEtsPriomapBand, le32(1))))) + }, "err " + ErrTcSchedList.Error()}, + {"negative: mqprio rate list with a foreign member", func() string { + return schedSum(ParseTcQopt(TcKindMqprio, cat(schedMqprioQopt(2), rtattr(TcaMqprioMaxRate64, rtattr(TcaMqprioMinRate64, le64(1)))))) + }, "err " + ErrTcSchedList.Error()}, + {"negative: an increment-16 kind", func() string { return schedSum(ParseTcQopt("red", nil)) }, "err " + ErrTcKindUnknown.Error()}, + // Boundary. + {"boundary: ets nbands == nstrict, no QUANTA (ec-019, K25)", func() string { return qopt("ec-019", TcKindEts, 0) }, + "bands 3 strict 3 true quanta false [] priomap [2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2] quantum 0 false"}, + {"boundary: mqprio 16 min rates", func() string { return schedFrom(schedSum(ParseTcQopt(TcKindMqprio, rates(16))), "min ") }, + "min [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015] max [] fp -1 [0 0]"}, + {"boundary: mqprio 17 min rates, the 17th dropped (Q53)", func() string { return schedFrom(schedSum(ParseTcQopt(TcKindMqprio, rates(17))), "min ") }, + "min [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015] max [] fp -1 [0 0]"}, + {"boundary: tc entry index 15 kept, 16 skipped", func() string { + q, err := ParseTcQopt(TcKindMqprio, entries(15, 16)) + return fmt.Sprint(q.Sched.Mqprio.TcEntries.MaxTcFp, q.Sched.Mqprio.TcEntries.Fp[15], err) + }, "15 2 "}, + {"boundary: mqprio tc entry FP of 0..3 bytes is ErrTcShort", func() string { + return shortTcEntry(TcKindMqprio, TcaMqprioTcEntry, TcaMqprioTcEntryFp) + }, "0 " + ErrTcShort.Error() + "; 1 " + ErrTcShort.Error() + "; 2 " + ErrTcShort.Error() + "; 3 " + ErrTcShort.Error() + "; 4 "}, + {"boundary: taprio tc entry FP of 0..3 bytes is ErrTcShort", func() string { + return shortTcEntry(TcKindTaprio, TcaTaprioAttrTcEntry, TcaTaprioTcEntryFp) + }, "0 " + ErrTcShort.Error() + "; 1 " + ErrTcShort.Error() + "; 2 " + ErrTcShort.Error() + "; 3 " + ErrTcShort.Error() + "; 4 "}, + {"boundary: taprio tc entry MAX_SDU of 0..3 bytes is ErrTcShort", func() string { + return shortTcEntry(TcKindTaprio, TcaTaprioAttrTcEntry, TcaTaprioTcEntryMaxSdu) + }, "0 " + ErrTcShort.Error() + "; 1 " + ErrTcShort.Error() + "; 2 " + ErrTcShort.Error() + "; 3 " + ErrTcShort.Error() + "; 4 "}, + {"negative: tc entry with a 2-byte index is ErrTcShort, as gotc refuses it", func() string { + _, err := ParseTcQopt(TcKindMqprio, cat(schedMqprioQopt(2), nest(TcaMqprioTcEntry, rtattr(TcaMqprioTcEntryIndex, le16(0))))) + return schedErr(err) + }, ErrTcShort.Error()}, + {"negative: a truncated duplicate after a valid entry is an error, not a zero", func() string { + in := cat(schedMqprioQopt(2), schedTcEntry(TcaMqprioTcEntry, 0, TcFpExpress), + nest(TcaMqprioTcEntry, rtattr(TcaMqprioTcEntryIndex, le32(0)), rtattr(TcaMqprioTcEntryFp, []byte{1}))) + _, err := ParseTcQopt(TcKindMqprio, in) + return schedErr(err) + }, ErrTcShort.Error()}, + {"corner: a tc entry without an index is still skipped", func() string { + in := cat(schedMqprioQopt(2), nest(TcaMqprioTcEntry, rtattr(TcaMqprioTcEntryFp, le32(TcFpExpress)))) + q, err := ParseTcQopt(TcKindMqprio, in) + return fmt.Sprint(q.Sched.Mqprio.TcEntries.MaxTcFp, err) + }, "-1 "}, + {"boundary: multiq of 3 bytes prints nothing, no error", func() string { return schedSum(ParseTcQopt(TcKindMultiq, []byte{8, 0, 8})) }, + "bands 0/0 false"}, + // Corner. + {"corner: drr and qfq qdiscs carry no options (K29)", func() string { + d, q := cap1("pw-002", TcKindDrr, false, 0), cap1("pw-005", TcKindQfq, false, 0) + return fmt.Sprint(d.HasOptions, len(d.Options), q.HasOptions, len(q.Options), " ", qopt("pw-002", TcKindDrr, 0)) + }, "false 0 false 0 quantum 0 false"}, + {"corner: TXTIME_DELAY 0x80000000 reads as s32 (Q55)", func() string { + q, err := ParseTcQopt(TcKindTaprio, schedTaprioOpts(rtattr(TcaTaprioAttrTxtimeDelay, le32(0x80000000)))) + return fmt.Sprint(q.Sched.Taprio.TxtimeDelay, err) + }, "-2147483648 "}, + {"corner: an ets priomap band of 4 bytes misaligns the +3 step", func() string { + in := cat(rtattr(TcaEtsNbands, []byte{3}), nest(TcaEtsPriomap, rtattr(TcaEtsPriomapBand, le32(1)), rtattr(TcaEtsPriomapBand, le32(2)))) + return schedSum(ParseTcQopt(TcKindEts, in)) + }, "err " + ErrTcSchedList.Error()}, + {"corner: a truncated hfsc curve is skipped, not an error", func() string { + return schedCurves(ParseTcCopt(TcKindHfsc, rtattr(TcaHfscRsc, le32(1)))) + }, "rt {0 0 0} false ls {0 0 0} false ul {0 0 0} false"}, + } + for _, tt := range tests { + t.Run(tt.description, func(t *testing.T) { + if got := tt.input(); got != tt.expected { + t.Errorf("got\n%q\nwant\n%q", got, tt.expected) + } + }) + } +} + +// TestParseTcSchedXstats decodes the class xstats drr and hfsc print, and +// taprio's offload stats. +func TestParseTcSchedXstats(t *testing.T) { + xs := func(row, kind string, class bool, i int) string { + ti := tcschedMsgs(t, row, kind, class)[i] + x, err := ParseTcXstats(kind, tcschedXstats(t, ti)) + return fmt.Sprintf("%t %+v %+v %v", x.Has, x.Drr, x.Hfsc, err) + } + tests := []struct { + description string + input func() string + expected string + }{ + {"positive: drr deficit (pw-003, Q38)", func() string { return xs("pw-003", TcKindDrr, true, 0) }, + "true {Deficit:0} {Work:0 Rtwork:0 Period:0 Level:0} "}, + {"positive: hfsc root class level 2 (ec-010)", func() string { return xs("ec-010", TcKindHfsc, true, 0) }, + "true {Deficit:0} {Work:0 Rtwork:0 Period:0 Level:2} "}, + {"positive: taprio offload stats", func() string { + x, err := ParseTcXstats(TcKindTaprio, rtattr(TcaTaprioOffloadStatsWindowDrops, le64(7))) + return fmt.Sprint(x.Has, x.TaprioWindowDrops, x.HasTaprioWindowDrops, x.HasTaprioTxOverruns, err) + }, "true 7 true false "}, + {"negative: drr xstats short", func() string { + _, err := ParseTcXstats(TcKindDrr, []byte{1, 2}) + return schedErr(err) + }, ErrTcShort.Error()}, + {"boundary: hfsc xstats of exactly sizeof", func() string { + x, err := ParseTcXstats(TcKindHfsc, make([]byte, TcHfscStatsSizeCst)) + return fmt.Sprint(x.Has, err) + }, "true "}, + {"corner: qfq sends xstats tc never prints (Q39, K24)", func() string { + ti := tcschedMsgs(t, "pw-007", TcKindQfq, true)[1] + b := tcschedXstats(t, ti) + x, err := ParseTcXstats(TcKindQfq, b) + st, serr := DecodeTcQfqStats(b) + return fmt.Sprint(x.Has, err, " ", st, serr) + }, "false {30 9000} "}, + } + for _, tt := range tests { + t.Run(tt.description, func(t *testing.T) { + if got := tt.input(); got != tt.expected { + t.Errorf("got %q, want %q", got, tt.expected) + } + }) + } +} + +// TestParseTcSchedAllocs pins the decoders' allocations: the top-level +// attribute tables and taprio's entry slices. The tc and schedule entry +// nests are parsed into a stack table, so 16 entries cost nothing. +func TestParseTcSchedAllocs(t *testing.T) { + allocs := func(kind string, in []byte) float64 { + return testing.AllocsPerRun(100, func() { + if _, err := ParseTcQopt(kind, in); err != nil { + t.Fatal(err) + } + }) + } + entryList := func(n int) []byte { + kids := make([][]byte, n) + for i := range kids { + kids[i] = nest(1, rtattr(TcaTaprioSchedEntryIndex, le32(uint32(i))), rtattr(TcaTaprioSchedEntryInterval, le32(1000))) + } + return nest(TcaTaprioAttrSchedEntryList, kids...) + } + mq16 := schedMqprioQopt(2) + for i := range uint32(16) { + mq16 = cat(mq16, schedTcEntry(TcaMqprioTcEntry, i, TcFpExpress)) + } + tests := []struct { + description string + input func() float64 + expected float64 + }{ + {"positive: hfsc qdisc, a fixed struct", func() float64 { return allocs(TcKindHfsc, le16(0x10)) }, 0}, + {"positive: multiq, a fixed struct", func() float64 { return allocs(TcKindMultiq, cat(le16(8), le16(8))) }, 0}, + {"positive: cbs, its table", func() float64 { return allocs(TcKindCbs, rtattr(TcaCbsParms, make([]byte, TcCbsQoptSizeCst))) }, 1}, + {"positive: etf, its table", func() float64 { return allocs(TcKindEtf, rtattr(TcaEtfParms, make([]byte, TcEtfQoptSizeCst))) }, 1}, + {"positive: taprio, oper and admin with 2 entries each", func() float64 { + return allocs(TcKindTaprio, schedTaprioOpts(entryList(2), nest(TcaTaprioAttrAdminSched, entryList(2)))) + }, 6}, // 2 tables, 2 appends per entry list + {"boundary: mqprio with 16 tc entries, the header table only", func() float64 { return allocs(TcKindMqprio, mq16) }, 1}, + {"corner: drr qdisc, no options", func() float64 { return allocs(TcKindDrr, nil) }, 1}, + } + for _, tt := range tests { + t.Run(tt.description, func(t *testing.T) { + if got := tt.input(); got != tt.expected { + t.Errorf("got %v allocations, want %v", got, tt.expected) + } + }) + } +} + +func BenchmarkParseTcSched(b *testing.B) { + mq := schedMqprioQopt(2) + for i := range uint32(16) { + mq = cat(mq, schedTcEntry(TcaMqprioTcEntry, i, TcFpExpress)) + } + for _, c := range []struct { + kind string + opt []byte + }{ + {TcKindDrr, rtattr(TcaDrrQuantum, le32(1514))}, + {TcKindHfsc, le16(0x10)}, + {TcKindEts, cat(rtattr(TcaEtsNbands, []byte{3}), nest(TcaEtsQuanta, rtattr(TcaEtsQuantaBand, le32(1500))), + nest(TcaEtsPriomap, rtattr(TcaEtsPriomapBand, []byte{0})))}, + {TcKindMqprio, mq}, + {TcKindTaprio, schedTaprioOpts(rtattr(TcaTaprioAttrSchedClockid, le32(11)), + nest(TcaTaprioAttrSchedEntryList, nest(1, rtattr(TcaTaprioSchedEntryIndex, le32(0)))))}, + {TcKindCbs, rtattr(TcaCbsParms, make([]byte, TcCbsQoptSizeCst))}, + {TcKindEtf, rtattr(TcaEtfParms, make([]byte, TcEtfQoptSizeCst))}, + {TcKindMultiq, cat(le16(8), le16(8))}, + } { + b.Run(c.kind, func(b *testing.B) { + b.ReportAllocs() + for b.Loop() { + if _, err := ParseTcQopt(c.kind, c.opt); err != nil { + b.Fatal(err) + } + } + }) + } + for _, c := range []struct { + kind string + x []byte + }{{TcKindDrr, le32(1)}, {TcKindHfsc, make([]byte, TcHfscStatsSizeCst)}} { + b.Run(c.kind+"-xstats", func(b *testing.B) { + b.ReportAllocs() + for b.Loop() { + if _, err := ParseTcXstats(c.kind, c.x); err != nil { + b.Fatal(err) + } + } + }) + } +} diff --git a/tools/nlcapgen/main.go b/tools/nlcapgen/main.go index bb930c0ff..760e46cde 100644 --- a/tools/nlcapgen/main.go +++ b/tools/nlcapgen/main.go @@ -157,6 +157,7 @@ var families = map[string]func() []*space{ "tcaction": func() []*space { return []*space{tcactionSpace()} }, "tcaction2": func() []*space { return []*space{tcaction2Space()} }, "tcmonitor": func() []*space { return []*space{tcmonitorSpace()} }, + "tcsched": func() []*space { return []*space{tcschedSpace()} }, } // namedFamilies are families of named rows, written out as they are @@ -170,7 +171,7 @@ var namedFamilies = map[string]func() []row{ func runMatrix(args []string, stdout, stderr io.Writer) int { fs := flag.NewFlagSet("matrix", flag.ContinueOnError) fs.SetOutput(stderr) - family := fs.String("family", "", "the family to generate: route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, tcqdisc, tcclass, tcfilter, tcflower, tcaction, tcaction2, tcmonitor, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats") + family := fs.String("family", "", "the family to generate: route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, tcqdisc, tcclass, tcfilter, tcflower, tcaction, tcaction2, tcmonitor, tcsched, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats") seed := fs.Uint64("seed", 1, "the random rows' seed, recorded in their ids") random := fs.Int("random", 0, "random rows per space") out := fs.String("out", "", "rows file to write") @@ -182,7 +183,7 @@ func runMatrix(args []string, stdout, stderr io.Writer) int { ok = true } if !ok || *out == "" || *random < 0 { - fmt.Fprintln(stderr, "nlcapgen matrix: -family (route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, tcqdisc, tcclass, tcfilter, tcflower, tcaction, tcaction2, tcmonitor, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats) and -out are required, -random must be >= 0") + fmt.Fprintln(stderr, "nlcapgen matrix: -family (route, rule, nexthop, addr, neigh, link, linkattr, routeget, fdb, mdb, ss, mpls, ethtool, devlink, vdpa, fou, mptcp, tipc, bridge, bridgex, bridgefdb, bridgemdb, tunnel, tuntap, tcqdisc, tcclass, tcfilter, tcflower, tcaction, tcaction2, tcmonitor, tcsched, kwlive, lwt, lwtx, lwtenc, nhstats, v730, v730ip720, stats) and -out are required, -random must be >= 0") return 2 } var rows []row diff --git a/tools/nlcapgen/matrix_tcsched.go b/tools/nlcapgen/matrix_tcsched.go new file mode 100644 index 000000000..78c4bfcb8 --- /dev/null +++ b/tools/nlcapgen/matrix_tcsched.go @@ -0,0 +1,213 @@ +package main + +// The scheduling qdisc space (gotc 15C): `tc qdisc show` and `tc class +// show` of the nine classful and scheduling kinds increment 9 left (drr, +// qfq, hfsc, ets, mqprio, taprio, multiq, cbs, etf), each command plain +// and -j, in one corpus directory, ws/tcsched. +// +// tc's side is tc/q_drr.c, q_qfq.c, q_hfsc.c, q_ets.c, q_mqprio.c, +// q_taprio.c, q_multiq.c, q_cbs.c and q_etf.c under tc_qdisc.c's and +// tc_class.c's frames. The kernel's side is each net/sched/sch_.c +// dump, dump_class and dump_class_stats. +// +// The rows pin the plan's leads (docs/netlink/upstream/iproute2-tc-sched.md): +// drr's text-only quantum and deficit (Q37, Q38); qfq's unread class +// xstats (Q39); hfsc's double space and string default (Q40), its blank +// -s line (Q42), sc against rt and ls (Q43), its raw JSON d (Q44); ets's +// trailing spaces (Q45) and strict classes (Q46); mqprio's hard newlines +// (Q48), its dcb mode and shaper (Q49), its 16 fp entries (Q50), queues +// (Q51) and map (Q52); taprio's txtime delay (Q55), max-sdu (Q56), the +// unlabelled admin schedule (Q57), the blank line (Q58) and an admin-only +// dump (K28); multiq's bands (Q60); cbs's and etf's offload (Q61) and +// etf's skip_sock_check (Q63). +// +// mqprio, taprio and multiq need a multi-queue device: a dummy with eight +// tx queues. mqprio's children are the default qdisc, a sysctl of the +// guest's, so its rows show the root only. Offload needs ndo_setup_tc, +// which a dummy lacks: offload appears only as negatives. (Replacing an +// existing etf fails first, "Change operation not supported", EINVAL, so +// the etf negative grafts a new one on a drr class.) +// +// Determinism: explicit handles, fixed MACs, no packets. taprio's +// base-times are a past one (the oper schedule starts at once) and a far +// future one (an admin schedule that never starts). Writes appear only as +// negatives. + +// tcSchedModules are the qdisc modules the fixtures use; prio holds cbs +// and etf. +var tcSchedModules = []string{ + "sch_cbs", "sch_drr", "sch_etf", "sch_ets", "sch_hfsc", "sch_mqprio", "sch_multiq", "sch_prio", + "sch_qfq", "sch_taprio", +} + +// schdrrFix: drr with a class of quantum 1514 and one at the default (the +// device's MTU). +var schdrrFix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: drr", + "tc class add dev d0 parent 1: classid 1:1 drr quantum 1514", + "tc class add dev d0 parent 1: classid 1:2 drr", +} + +// schqfqFix: qfq with two classes of different weights and maxpkt. (qfqFix +// in matrix_tc.go is fq.) +var schqfqFix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: qfq", + "tc class add dev d0 parent 1: classid 1:1 qfq weight 1 maxpkt 1514", + "tc class add dev d0 parent 1: classid 1:2 qfq weight 30 maxpkt 9000", +} + +// schhfscFix: hfsc default 10; a parent with sc and ul, a child with rt +// unlike ls (m1, d and m2), and a child whose rt and ls are the same (sc). +var schhfscFix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: hfsc default 10", + "tc class add dev d0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 20mbit", + "tc class add dev d0 parent 1:1 classid 1:10 hfsc rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", + "tc class add dev d0 parent 1:1 classid 1:20 hfsc rt m2 1mbit ls m2 1mbit", +} + +// schhfsc0Fix: hfsc with no default, so no default key. +var schhfsc0Fix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 2: hfsc", +} + +// schetsFix: ets with one strict band and two quanta, a short priomap. +var schetsFix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: ets bands 3 strict 1 quanta 1500 3000 priomap 2 1 0", +} + +// schets0Fix: ets with every band strict: no quanta. +var schets0Fix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: ets strict 3", +} + +// schtsnFix: a two-band prio holding cbs and etf with skip_sock_check. +var schtsnFix = []string{ + tcDummies("d0"), + "tc qdisc add dev d0 root handle 1: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "tc qdisc add dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 skip_sock_check", +} + +// schmultiqFix: multiq on eight queues. +var schmultiqFix = []string{ + tcDummies("d1/8"), + "tc qdisc add dev d1 root handle 1: multiq", +} + +// schmqprioFix: software mqprio, two traffic classes over eight queues. +var schmqprioFix = []string{ + tcDummies("d1/8"), + "tc qdisc add dev d1 root handle 100: mqprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 hw 0", +} + +// tcSchedTaprio is the common head of the taprio fixtures. +const tcSchedTaprio = "tc qdisc add dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 clockid CLOCK_TAI" + +// schtaprioFix: taprio in txtime-assist mode (flags 0x1) with a txtime +// delay, a past base-time and two entries. +var schtaprioFix = []string{ + tcDummies("d1/8"), + tcSchedTaprio + " base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000 flags 0x1 txtime-delay 200000", +} + +// schtaprio2Fix: a running oper schedule and, replaced over it, an admin +// schedule whose base-time is far in the future (Q57). +var schtaprio2Fix = []string{ + tcDummies("d1/8"), + tcSchedTaprio + " base-time 1000000000 sched-entry S 01 300000 sched-entry S 02 200000", + "tc qdisc replace dev d1 root handle 100: taprio clockid CLOCK_TAI base-time 4000000000000000000 sched-entry S 03 100000", +} + +// schtaprio3Fix: only an admin schedule, never started, so no oper, no +// max-sdu and no fp (K28). +var schtaprio3Fix = []string{ + tcDummies("d1/8"), + tcSchedTaprio + " base-time 4000000000000000000 sched-entry S 01 300000 sched-entry S 02 200000", +} + +// tcschedSpace: `tc qdisc show` and `tc class show` of the nine kinds over +// twelve fixtures. +func tcschedSpace() *space { + cmds := []value{ + // drr. + bc(brCorner, "schdrr", "qdisc show dev d0", schdrrFix), // no options (K29) + bc(brPos, "schdrr", "class show dev d0", schdrrFix), // Q37 + bc(brPos, "schdrr", "-s class show dev d0", schdrrFix), // Q38 + bc(brCorner, "schdrr", "-g class show dev d0", schdrrFix), + // qfq. + bc(brCorner, "schqfq", "qdisc show dev d0", schqfqFix), + bc(brPos, "schqfq", "class show dev d0", schqfqFix), + bc(brCorner, "schqfq", "-s class show dev d0", schqfqFix), // Q39 + // hfsc. + bc(brPos, "schhfsc", "qdisc show dev d0", schhfscFix), // Q40 + bc(brPos, "schhfsc", "class show dev d0", schhfscFix), // Q43, Q44 + bc(brCorner, "schhfsc", "-s class show dev d0", schhfscFix), // Q42 + bc(brCorner, "schhfsc", "-g class show dev d0", schhfscFix), + bc(brPos, "schhfsc", "class show dev d0 classid 1:10", schhfscFix), + bc(brBoundary, "schhfsc0", "qdisc show dev d0", schhfsc0Fix), // Q40: no default + bc(brBoundary, "schhfsc0", "class show dev d0", schhfsc0Fix), // the root class only + // ets. + bc(brPos, "schets", "qdisc show dev d0", schetsFix), // Q45 + bc(brPos, "schets", "class show dev d0", schetsFix), // Q46 + bc(brPos, "schets", "-s class show dev d0", schetsFix), + bc(brCorner, "schets", "-o qdisc show dev d0", schetsFix), + bc(brBoundary, "schets0", "qdisc show dev d0", schets0Fix), // no quanta (K25) + bc(brBoundary, "schets0", "class show dev d0", schets0Fix), + // cbs and etf. + bc(brPos, "schtsn", "qdisc show dev d0", schtsnFix), // Q61, Q63 + bc(brPos, "schtsn", "-s qdisc show dev d0", schtsnFix), + bc(brCorner, "schtsn", "qdisc show dev d0 handle 10:", schtsnFix), + bc(brCorner, "schtsn", "qdisc show dev d0 handle 20:", schtsnFix), + bc(brCorner, "schtsn", "-d qdisc show dev d0", schtsnFix), + // multiq. + bc(brPos, "schmultiq", "qdisc show dev d1 root", schmultiqFix), // Q60 + bc(brPos, "schmultiq", "class show dev d1", schmultiqFix), + // mqprio: the root only. + bc(brPos, "schmqprio", "qdisc show dev d1 root", schmqprioFix), // Q49, Q50, Q51, Q52 + bc(brPos, "schmqprio", "-s qdisc show dev d1 root", schmqprioFix), + bc(brCorner, "schmqprio", "-o qdisc show dev d1 root", schmqprioFix), // Q48 + bc(brCorner, "schmqprio", "-d qdisc show dev d1 root", schmqprioFix), + bc(brPos, "schmqprio", "class show dev d1", schmqprioFix), + // taprio. + bc(brPos, "schtaprio", "qdisc show dev d1 root", schtaprioFix), // Q55, Q56, Q58 + bc(brPos, "schtaprio", "-s qdisc show dev d1 root", schtaprioFix), + bc(brCorner, "schtaprio", "-o qdisc show dev d1 root", schtaprioFix), + bc(brPos, "schtaprio", "qdisc show dev d1", schtaprioFix), // its pfifo children + bc(brPos, "schtaprio", "class show dev d1", schtaprioFix), + bc(brCorner, "schtaprio2", "qdisc show dev d1 root", schtaprio2Fix), // Q57 + bc(brBoundary, "schtaprio3", "qdisc show dev d1 root", schtaprio3Fix), // K28 + // Batches: each line in turn. + bb(brPos, "schhfsc", "qdisc-then-class", "", false, batchFile( + "qdisc show dev d0", + "class show dev d0", + "class show dev d0 classid 1:20"), schhfscFix), + // A second "root" is "parent is already specified" (tcqdisc's + // sticky-root); a plain show after it keeps the first line's root. + bb(brCorner, "schtaprio2", "root-then-all", "", false, batchFile( + "qdisc show dev d1 root", + "class show dev d1", + "qdisc show dev d1"), schtaprio2Fix), + } + notsupp := expect{RC: intp(2), Errno: "ENOTSUP", RefusedBy: refKernel} + bad := []badValue{ + brBad("schdrr", "qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0", + schdrrFix, notsupp, "mqprio is root only, on a multi-queue device: a write gotc refuses"), + brBad("schmultiq", "qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4"+ + " base-time 0 sched-entry S 01 300000", schmultiqFix, + expect{RC: intp(2), Errno: "EINVAL", RefusedBy: refKernel}, "taprio without a clockid"), + brBad("schtsn", "qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000"+ + " hicredit 30 locredit -1470 offload 1", schtsnFix, notsupp, "cbs offload needs ndo_setup_tc"), + brBad("schdrr", "qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload", + schdrrFix, notsupp, "etf offload needs ndo_setup_tc"), + brBad("schdrr", "class show dev nosuch", schdrrFix, tcNodev, "no such device: Cannot find device, rc 1"), + } + sp := tcSpace("tcsched", cmds, bad) + sp.Build = func(vals []value) row { return tcBuildMods(tcSchedModules, vals) } + return sp +} diff --git a/tools/nlcapgen/matrix_tcsched_test.go b/tools/nlcapgen/matrix_tcsched_test.go new file mode 100644 index 000000000..bc943b7dc --- /dev/null +++ b/tools/nlcapgen/matrix_tcsched_test.go @@ -0,0 +1,197 @@ +package main + +import ( + "bytes" + "fmt" + "regexp" + "strings" + "testing" +) + +// TestTcSchedSpace pins the scheduling qdisc rows (gotc 15C): `qdisc show` +// and `class show` of drr, qfq, hfsc, ets, mqprio, taprio, multiq, cbs and +// etf over twelve fixtures, their batches and their refusals. Rows are +// keyed by command, fixture and batch file. +// +// go test ./tools/nlcapgen/ -run TestTcSchedSpace +func TestTcSchedSpace(t *testing.T) { + rows, err := matrixRows(families["tcsched"](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatal(err) + } + if err := checkRows(rows); err != nil { + t.Fatal(err) + } + if len(rows) != 87 { + t.Errorf("%d rows, want 87 (41 commands plain and -j, 5 negatives)", len(rows)) + } + byKey := map[string]row{} + key := func(r row) string { return r.Cmd + "|" + r.Axes["fix"] + "|" + r.Axes["batch"] } + for _, r := range rows { + if !strings.HasPrefix(r.ID, "tcsched/") { + t.Errorf("%s: not in tcsched/", r.ID) + } + if r.InitNS || r.Serial || r.Proto != "route" || strings.Join(r.Modules, ",") != strings.Join(tcSchedModules, ",") { + t.Errorf("%s: initns %t serial %t proto %q modules %v", r.ID, r.InitNS, r.Serial, r.Proto, r.Modules) + } + for _, m := range r.Modules { + if !tdcGuestModules[m] { + t.Errorf("%s: module %s is not one the guest has", r.ID, m) + } + } + if _, dup := byKey[key(r)]; dup { + t.Errorf("%s: %q twice", r.ID, key(r)) + } + byKey[key(r)] = r + } + + tests := []struct { + description string + key string // cmd|fix|batch + expected string // kind rc refused-by errno | pre count + }{ + // Positive. + {"positive: drr classes (Q37)", "tc -j class show dev d0|schdrr|", "positive 0 none | 4"}, + {"positive: drr deficit (Q38)", "tc -s class show dev d0|schdrr|", "positive 0 none | 4"}, + {"positive: qfq classes", "tc class show dev d0|schqfq|", "positive 0 none | 4"}, + {"positive: hfsc default (Q40)", "tc qdisc show dev d0|schhfsc|", "positive 0 none | 5"}, + {"positive: hfsc curves (Q43, Q44)", "tc -j class show dev d0|schhfsc|", "positive 0 none | 5"}, + {"positive: ets quanta (Q45)", "tc qdisc show dev d0|schets|", "positive 0 none | 2"}, + {"positive: ets strict class (Q46)", "tc -j class show dev d0|schets|", "positive 0 none | 2"}, + {"positive: cbs and etf (Q61, Q63)", "tc -j qdisc show dev d0|schtsn|", "positive 0 none | 4"}, + {"positive: multiq bands (Q60)", "tc qdisc show dev d1 root|schmultiq|", "positive 0 none | 2"}, + {"positive: mqprio (Q49-Q52)", "tc -j qdisc show dev d1 root|schmqprio|", "positive 0 none | 2"}, + {"positive: taprio txtime (Q55, Q56)", "tc -j qdisc show dev d1 root|schtaprio|", "positive 0 none | 2"}, + {"positive: a batch of hfsc shows", "tc -batch b.txt|schhfsc|qdisc-then-class", "positive 0 none | 6"}, + // Negative. + {"negative: mqprio not at the root", "tc qdisc add dev d0 parent 1:1 handle 10: mqprio num_tc 2 map 0 0 1 1 queues 1@0 1@1 hw 0|schdrr|", + "negative 2 kernel ENOTSUP | 4"}, + {"negative: taprio with no clockid", "tc qdisc replace dev d1 root handle 100: taprio num_tc 2 map 0 0 1 1 queues 4@0 4@4 base-time 0 sched-entry S 01 300000|schmultiq|", + "negative 2 kernel EINVAL | 2"}, + {"negative: cbs offload", "tc qdisc replace dev d0 parent 1:1 handle 10: cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470 offload 1|schtsn|", + "negative 2 kernel ENOTSUP | 4"}, + {"negative: etf offload", "tc qdisc add dev d0 parent 1:2 handle 20: etf clockid CLOCK_TAI delta 300000 offload|schdrr|", + "negative 2 kernel ENOTSUP | 4"}, + {"negative: no such device", "tc class show dev nosuch|schdrr|", "negative 1 kernel ENODEV | 4"}, + // Boundary. + {"boundary: hfsc with no default (Q40)", "tc -j qdisc show dev d0|schhfsc0|", "boundary 0 none | 2"}, + {"boundary: ets all strict (K25)", "tc -j qdisc show dev d0|schets0|", "boundary 0 none | 2"}, + {"boundary: taprio admin only (K28)", "tc qdisc show dev d1 root|schtaprio3|", "boundary 0 none | 2"}, + // Corner. + {"corner: drr qdisc without options (K29)", "tc -j qdisc show dev d0|schdrr|", "corner 0 none | 4"}, + {"corner: qfq xstats unread (Q39)", "tc -j -s class show dev d0|schqfq|", "corner 0 none | 4"}, + {"corner: hfsc blank -s line (Q42)", "tc -s class show dev d0|schhfsc|", "corner 0 none | 5"}, + {"corner: mqprio under -o (Q48)", "tc -o qdisc show dev d1 root|schmqprio|", "corner 0 none | 2"}, + {"corner: taprio oper and admin (Q57)", "tc qdisc show dev d1 root|schtaprio2|", "corner 0 none | 3"}, + {"corner: the hfsc graph", "tc -g class show dev d0|schhfsc|", "corner 0 none | 5"}, + {"corner: taprio shows in a batch", "tc -batch b.txt|schtaprio2|root-then-all", "corner 0 none | 4"}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + r, ok := byKey[tc.key] + if !ok { + t.Fatalf("no row %q", tc.key) + } + kind, _, _ := strings.Cut(r.Desc, ":") + got := fmt.Sprintf("%s %d %s %s | %d", kind, *r.Expect.RC, r.Expect.RefusedBy, r.Expect.Errno, len(r.Pre)) + if got != tc.expected { + t.Errorf("got %q, want %q", got, tc.expected) + } + }) + } + + write := regexp.MustCompile(`\b(add|del|delete|change|replace|flush)\b`) + fixtures := map[string]bool{} + kinds := map[string]map[string]bool{} // fixture -> object shown + multiq := map[string]bool{"schmultiq": true, "schmqprio": true, "schtaprio": true, "schtaprio2": true, "schtaprio3": true} + for k, r := range byKey { + fix := r.Axes["fix"] + fixtures[fix] = true + neg := strings.HasPrefix(r.Desc, "negative:") + // Writes appear only as refusals; offload only in them. + if write.MatchString(r.Cmd) && !neg { + t.Errorf("%s: %q writes but is not a negative", r.ID, r.Cmd) + } + if strings.Contains(r.Cmd, "offload") && !neg { + t.Errorf("%s: %q offloads but is not a negative", r.ID, r.Cmd) + } + // mqprio, taprio and multiq run on the eight-queue dummy only. + for _, p := range r.Pre { + if regexp.MustCompile(`\b(mqprio|taprio|multiq)\b`).MatchString(p.Cmd) && !multiq[fix] { + t.Errorf("%s: %q outside a multi-queue fixture", r.ID, p.Cmd) + } + if multiq[fix] && strings.HasPrefix(p.Cmd, "ip link add") && !strings.Contains(p.Cmd, "numtxqueues 8") { + t.Errorf("%s: %q is not an eight-queue dummy", r.ID, p.Cmd) + } + } + if kinds[fix] == nil { + kinds[fix] = map[string]bool{} + } + for _, obj := range []string{"qdisc show", "class show", "-s class show"} { + if strings.HasPrefix(strings.TrimPrefix(r.Cmd, "tc -j "), obj) || strings.HasPrefix(strings.TrimPrefix(r.Cmd, "tc "), obj) { + kinds[fix][obj] = true + } + } + // Every positive command runs plain and -j. + if neg || strings.HasPrefix(r.Cmd, "tc -j ") { + continue + } + cmd, rest, _ := strings.Cut(k, "|") + if _, ok := byKey[strings.Replace(cmd, "tc ", "tc -j ", 1)+"|"+rest]; !ok { + t.Errorf("%s: %q has no -j row", r.ID, cmd) + } + } + for _, fix := range []string{"schdrr", "schqfq", "schhfsc", "schhfsc0", "schets", "schets0", "schtsn", + "schmultiq", "schmqprio", "schtaprio", "schtaprio2", "schtaprio3"} { + if !fixtures[fix] { + t.Errorf("fixture %s has no row", fix) + } + if !kinds[fix]["qdisc show"] { + t.Errorf("fixture %s has no qdisc show", fix) + } + } + // The classful kinds show their classes, with and without -s. + for _, fix := range []string{"schdrr", "schqfq", "schhfsc", "schets"} { + if !kinds[fix]["class show"] || !kinds[fix]["-s class show"] { + t.Errorf("fixture %s: class show %t, -s class show %t", fix, kinds[fix]["class show"], kinds[fix]["-s class show"]) + } + } + all := new(strings.Builder) + for _, r := range rows { + all.WriteString(r.Cmd + "\n") + for _, p := range r.Pre { + all.WriteString(p.Cmd + "\n") + } + } + for _, kind := range []string{"drr", "qfq", "hfsc", "ets", "mqprio", "taprio", "multiq", "cbs", "etf"} { + if !regexp.MustCompile(`qdisc add .*handle \w+: ` + kind + `\b`).MatchString(all.String()) { + t.Errorf("no fixture adds %s", kind) + } + } + for _, s := range []string{"drr quantum 1514", "qfq weight 30 maxpkt 9000", "hfsc default 10", + "rt m1 2mbit d 10ms m2 1mbit ls m2 3mbit", "rt m2 1mbit ls m2 1mbit", "ul rate", "strict 1 quanta", + "ets strict 3", "skip_sock_check", "flags 0x1 txtime-delay 200000", "base-time 4000000000000000000", "hw 0"} { + if !strings.Contains(all.String(), s) { + t.Errorf("no row or fixture has %q", s) + } + } + // No packets: the counters and the timers must not move. + if pk := regexp.MustCompile(`\b(ping|mausezahn|mz|nc|iperf3?|trafgen)\b`); pk.MatchString(all.String()) { + t.Errorf("a row sends packets: %q", pk.FindString(all.String())) + } + + // Determinism: the same seed writes the same bytes. + var a, b bytes.Buffer + for _, buf := range []*bytes.Buffer{&a, &b} { + rows, err := matrixRows(families["tcsched"](), matrixOpts{Seed: 1}) + if err != nil { + t.Fatal(err) + } + if err := writeRows(buf, nil, rows); err != nil { + t.Fatal(err) + } + } + if !bytes.Equal(a.Bytes(), b.Bytes()) { + t.Error("two runs with seed 1 differ") + } +}