Repository navigation
gotc: tc actions list/get and 12 action kinds (increment 12) - #334
Merged
Merged
Conversation
tcaction: 132 rows over six fixtures and a bare netns, `tc actions list/get` of 13 action kinds and `filter show` of filters holding them, each positive plain and -j. Two batches on one boot agree on every stdout, stderr and rc; the pcaps differ only inside tcf_t. The captures confirm AC8, AC10, AC15, AC16, AC18, AC22, AC24-AC26 and AC29, correct AC9 (an empty get prints total acts 0, rc 0) and add AC31-AC34. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decoders for the options of police, mirred, skbedit, vlan, csum, nat, simple, connmark, ctinfo, sample, skbmod and mpls, each MIN-copying its parms struct and keeping the attribute's length as tc sees it. Adds BuildTcActionDump and BuildTcActionGet, byte-equal to tc 7.2.0's requests, and FamilyHdrLen for the action message types. Every action of these kinds in the tcaction and tdc captures decodes (756). New kernel note K5: dump and get replies carry RTM_GETACTION. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tc actions ls/list/show and get, following m_action.c's do_action, tc_action_gd and print_action with their argument quirks (AC6-AC10, AC34). police, mirred, skbedit, vlan, csum, nat, simple, connmark, ctinfo, sample, skbmod and mpls print at bind 0 and in filters at bind 1; police in u32/basic/cgroup/fw/route4/flow no longer refused. Writes and the increment-13 kinds are refused by name. Also: SkbeditFInheritDsfield is 0x20, csum update flag constants, BuildTcActionGet takes []TcActRef, and wsreplay no longer merges a same-seq request into a get's echo transaction. All 132 tcaction rows replay; 887 tdc readbacks render; 85.4% cover; 10/10 mutants killed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/netlink/upstream/iproute2-tc-action.md, not submitted to netdev: AC1-AC12 and AC14-AC34 confirmed against v7.2.0, the tcaction corpus and the kernel at v7.4-rc4; AC13 dropped as a duplicate of F24. New: AC35 (double spaces by kind), AC36 (total acts is per message), AC37 (police's kind is JSON-only, so -br text has none), K6 and K7. Three corner rows pin AC17, AC19 and AC27; gotc.md gains an increment 12 section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gotc beside tc 7.2.0 on the workbench over the 132 tcaction rows and two -netns reads: 133 of 134 identical on stdout, stderr and rc, the -s rows included; the difference is the refused write (ng-006). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BuildTcActionGet built into a 56-byte buffer, enough for one action, so a get naming three gacts (or two connmarks) failed in gotc while tc sent it. The buffer is now sized from the actions named (TcActGetLen). Past tc's MAX_MSG, gotc refuses: tc ignores addattr_l's failures there and sends what fit (AC38, confirmed live). tcaction gains gets of 3, 32 and 33 actions, appended so earlier ids stay. The 33-action get found K8: the kernel answers only the first 32 (TCA_ACT_MAX_PRIO), with no error. Cleanups: linkedActKinds is derived from actionUtils plus deferredActKinds; printOneAction's comment covers both callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Increment 12: gotc gains the read side of
tc actions, plus 12 action kinds.tc actionslist/show/ls and get.tc actionsand inside filters.monitor.tcactionnlcapgen capture space and its corpusBuildTcActionDumpandBuildTcActionGetaction_cmd.goand them_*.gokind printersdocs/netlink/upstream/iproute2-tc-action.md(findings AC1–AC37, kernel notes K1–K7)iproute2 findings (recorded only, not submitted to netdev)
action ordernumbering restarts at 0 in each message.TCA_ROOT_COUNTis per message, and an empty dump sends only the end-of-dump message(
NLMSG_DONE).Test plan
go test ./...nix build .#checks.x86_64-linux.test-go-racedifference is
actions delete, which gotc refuses by design.🤖 Generated with Claude Code