Skip to content

gotc: pedit, tunnel_key, ife, ct, gate, bpf actions and the bpf filter (increment 13) - #344

Merged
randomizedcoder merged 6 commits into
mainfrom
gotc/actions2
Nov 26, 2026
Merged

randomizedcoder merged 6 commits into
mainfrom
gotc/actions2

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

Summary

gotc now prints the six action kinds tc 7.2.0 links that it still refused (pedit, tunnel_key, ife, ct, gate and the bpf action), and the bpf filter. Both bpf printers are cBPF only: an eBPF program ID is refused as "eBPF program info via bpf(2)". tc monitor is next (increment 14).

Task Commit What
13C f80d8fb tcaction2 nlcapgen capture space, 105 rows (V019)
13P 47b4f27 xtcpnl decoders, table tests (37 rows), fuzz target, benchmarks, pinned alloc budgets (V020)
13R 0c5a805 gotc printers m_{pedit,tunnel_key,ife,ct,gate,bpf}.go, f_bpf.go; TestGotcAction2Unit 29 rows (V021)
13B 7da5a53 iproute2 findings AC39–AC71, kernel notes K9–K18 (DOC005)
13L 5ef8863 Live diff against tc 7.2.0 on the workbench (V022)
K18 e76d798 Kernel write-up: a tc action get skips the hw stats refresh a dump does (DOC006)

Results

  • Corpus: ws/tcaction2 replays byte for byte; the earlier tc spaces are unchanged.
  • tdc readbacks: the seven action:* / filter:bpf skips are removed; rendered 887 → 1025.
  • Live diff: 104/107 identical. ng-007 is the planned write refusal; ec-049/pw-049 differ only by kernel state (K18). Swapping the run order swaps the difference.
  • Mutants: 12/12 killed. Coverage: internal/gotc 85.7%.
  • Perf: parseActKind now returns its reader by value, saving 2 allocs per decode across all 18 kinds.
  • Docs: iproute2 findings and kernel notes are recorded under docs/netlink/upstream/ only; not submitted to netdev.

Test plan

  • go test ./...
  • nix build --no-link .#checks.x86_64-linux.test-go-race
  • nix build .#gotc, .#test-go-unit
  • golangci-lint (comprehensive), netlink-audit, kernel-citation-audit
  • Live diff on the workbench (VM left clean, powered off as found)

🤖 Generated with Claude Code

randomizedcoder and others added 6 commits November 25, 2026 11:00
… and the bpf filter (13C, V019)

105 rows over six fixtures (pedit, tunnel_key, ife, ct, gate, cBPF action
and filter) plus a bare netns, every positive plain and -j, and 7
negatives. Two batches on one boot agree apart from the -s timers.
Confirms AC39, AC42-AC44, AC48, AC49, AC51, AC53, AC56, AC57, AC59, AC61,
AC65 and AC66, and adds K13 (helpers registered NFPROTO_UNSPEC dump
family 0, so an ipv4 helper reads back as ipv6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the bpf filter (13P, V020)

Each kind's options decode the way its tc/m_<kind>.c printer reads them,
parms MIN-copied, with a flag wherever tc reads past an attribute or
through NULL (AC40, AC45-AC47, AC54-AC56, AC63, AC64). The bpf filter
decodes its cBPF ops and name in ParseTcFopt. Every action of the six
kinds in the tcaction2 and tdc captures decodes cleanly, at bind 0 and
inside filters.

parseActKind returns its reader by value and allocates the zero buffer
only without parms: 2 fewer allocations per decode for all 18 kinds.
TestParseTcActKinds2Allocs pins the budgets; list elements add none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ilter (13R, V021)

The six kinds print in tc actions and inside filters, and the bpf filter
prints its cBPF program, each following its tc/m_<kind>.c or f_bpf.c
printer with tc's quirks kept (AC39, AC42-AC44, AC48, AC49, AC51-AC53,
AC56, AC57, AC59-AC62, AC65, AC66). Reads tc makes past an attribute or
through NULL are refused, as is an eBPF program's ID (bpf(2)).

All 105 tcaction2 rows replay byte for byte; the 138 tdc readbacks
skipped before render exactly (1025). All 19 linked action kinds print,
so deferredActKinds is gone. 12/12 mutants killed.

Also: ctNatUnchecked follows C's else-if (equal IPv4 bounds fall through
to the IPv6 test), and 13 shared words become constants (goconst).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd bpf (13B, DOC005)

iproute2-tc-action.md gains AC39-AC71 and K9-K17. Of the plan's 28 leads,
14 are confirmed in the tcaction2 corpus and 14 are latent with unit rows.
New: pedit's unpadded JSON hex, tunnel_key's double space, gate's
`flags 0`, ife's parser chatter, and a filter's police merging into its
options JSON; kernel notes K14-K17. All present at HEAD. Not submitted
to netdev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the workbench gotc matches tc 7.2.0 on 104 of 107 rows (105 tcaction2
rows and two -netns reads), byte for byte. The rest: the planned write
refusal, and two get-then-ls batches where the kernel's answer to the get
changes once a dump has run. K18: only tcf_dump_walker asks the offload
callbacks, so used_hw_stats appears in gets only after an action's first
dump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esh (DOC006)

Only the dump path (tcf_dump_walker, and the flower/matchall stats
dump) calls tcf_action_update_hw_stats, which sets used_hw_stats_valid.
A get never does, so TCA_ACT_USED_HW_STATS appears in a get only once
something has dumped the action. Seen live in tcaction2/ec-049.
Recorded only; not submitted to netdev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit 492fa15 into main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant