Repository navigation
gotc: ematch writes for basic, cgroup and flow match (increment 21) - #373
Merged
Merged
Conversation
257 rows (144 writes, 113 refusals) of basic and cgroup writes and flow's match: the ematch grammar, every cmp, nbyte, u32, meta and canid keyword, the leads W123-W155 that a capture can end on, F25, W95 and W97, and the refusals by name (police, ipset, ipt). Each rc was checked on the host tc first; two workbench batches on one boot agree. The workbench kernel (7.3.1) dumps a 4095-byte nbyte with its header alone: tcf_em_tree_dump ignored nla_put_nohdr's failure until 528de6832b21 (v7.4-rc1). TestWsTcFilterKinds accepts such a match, and W151's 16 KiB refusal is ParseNlMsgErr's new largest pick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Append for the ematch tree and match headers and the cmp, nbyte, canid and meta structs, laid out as the v7.4-rc4 uapi headers have them, and PutRaw, iproute2's addraw_l. TestBuildTcEmatchWrite builds fifteen tcematch requests and matches tc's captured bytes, including the flattened nested tree, W136's 4096-byte needle and W124's shared strbuf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tc's ematch lexer and parser (flex's buffer, bison's LALR tables, the state a batch carries between lines), the cmp, nbyte, u32, meta and canid modules, and basic's and cgroup's parse_fopt with flow's match arm. ipset, ipt and police are refused by name, and so are the leads where tc reads or writes memory it doesn't own, or hangs (W123-W128, W132). Fixes the read side's meta vlan id (46, not 48). 243 of 257 tcematch rows replay byte for byte (14 refused by name); tcfwrite ec-114/115/118 now match; 245 tdc filter writes match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/netlink/upstream/iproute2-tc-ematch-write.md: W123-W155 and K56-K62, each with file:line at v7.2.0 / v7.4-rc4, its tcematch pinning row and gotc's behaviour; every lead is present at HEAD. F25, K2, W95 and W97 gain increment-21 extensions where they live, and the filter-write doc points at the new one. Not submitted to netdev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gocritic's nilValReturn: the word is nil on that path, so say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the workbench, tc and the gotc_write build agree on 246 of 260 rows (the 257 tcematch rows and tcfwrite ec-114/115/118): every request byte for byte; the other 14 are the refusals by name. A size probe pins K62: tc can't list a filter whose dump outgrows a page-sized first skb (between 3600 and 3800 bytes of canid rules). W155's non-root message is checked on the host. The VM was left as found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A trailing police is NEXT_ARG's exit, as in every kind's parse_opt: `Command line is not complete`, rc 255, for basic, cgroup, fw, route, u32 and flow (errPolice becomes runner.policeArm). - Two rows pin bison's YYMAXDEPTH: 4995 nested parens parse, 4996 give tc 7.2.0's `memory exhausted` stderr byte for byte (host bisect). - The tree header sets ProgID to the new xtcpnl.TcfEmProgTc. 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.
Increment 21: dry-run ematch writes for tc 7.2.0. This covers
tc filterwith kind basic and kind cgroup, and flow'smatch. The parts ported are tc's ematch lexer and grammar, plus the cmp, nbyte, u32, meta and canid modules.tcematchcapture space with 257 rows. Two batches on one boot agree (V055).Appendencoders for the ematch tree and match headers and for cmp, nbyte, canid and meta, plusAttrBuilder.PutRaw(tc's addraw_l) (V056).match(V057).-batchlines is modelled, as tc does it (W124, W128, W129).docs/netlink/upstream/iproute2-tc-ematch-write.md. Not sent to netdev (DOC014).meta("a" eq "b")is sent as"b" eq "b". When that buffer grows, tc sends freed heap bytes.policenow gives tc'sCommand line is not complete, rc 255, for basic, cgroup, fw, route, u32 and flow. tc 7.2.0 on the host gives the same.(still parse; 4996 givesmemory exhausted, and gotc's stderr matches tc's byte for byte.ProgIDtoTcfEmProgTcexplicitly.Gates:
go test ./...,test-go-race, lint-baseline (tiers 0-2), no-write-encoders andnix build .#gotcpass.🤖 Generated with Claude Code