Repository navigation
gotc: pedit, tunnel_key, ife, ct, gate, bpf actions and the bpf filter (increment 13) - #344
Merged
Merged
Conversation
… 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>
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
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 monitoris next (increment 14).tcaction2nlcapgen capture space, 105 rows (V019)m_{pedit,tunnel_key,ife,ct,gate,bpf}.go,f_bpf.go;TestGotcAction2Unit29 rows (V021)Results
ws/tcaction2replays byte for byte; the earlier tc spaces are unchanged.action:*/filter:bpfskips are removed; rendered 887 → 1025.internal/gotc85.7%.parseActKindnow returns its reader by value, saving 2 allocs per decode across all 18 kinds.docs/netlink/upstream/only; not submitted to netdev.Test plan
go test ./...nix build --no-link .#checks.x86_64-linux.test-go-racenix build .#gotc,.#test-go-unit🤖 Generated with Claude Code