Repository navigation
fix(attach): Deliver same-node traffic on a tagged public side - #1560
Conversation
On a tagged public side, edge_lb hands a same-node packet to the kernel on the public VLAN netdevice, so only that interface's tc ingress can claim it. A cluster CNI such as Cilium attaches its host program there through tcx, which the kernel runs before clsact filters, and passes traffic not its own with TC_ACT_OK. That ends classification, so usid_ingress never ran and the packet met the discard route for the node's own locator. A bond is unaffected: its members claim the packet and carry no CNI program. Attach usid_ingress also as a pinned tcx link at the head of the chain on each selected interface that is neither a bond nor a bond member, and remove it on detach. Unclaimed traffic returns TC_ACT_UNSPEC, which tcx takes as "next", so later programs still see it. IngressAttachedTo, which gates the gateway's status.localDelivery, now fails while another tcx program runs ahead of usid_ingress on such an interface. TestVLANTransport_SameNodeExchange runs real UDP and TCP exchanges with an IPv6 and an IPv4 VIP whose backend is on the gateway's node, request and reply, with a tcx stand-in for the CNI, in both host modes, over an untagged and a tagged single NIC and bond, and a tagged bond with the XDP dispatcher. Fixes #1556
|
Same-node gateway delivery timed out on a tagged public side because a cluster CNI's tcx program ran ahead of Fixes #1556 Root cause
An untagged bond never hit this, because its members claim the packet and hold no address, so no CNI program sits on them. The earlier passing C4 smoke run claimed it on the members too, through a stale native Change
Tests
It runs in both host modes, on 5 topologies:
Results on the epic branch before this change: 2 of 10 pass, the untagged bond in each host mode. The other 8 time out. With this change, all 10 pass:
The Validation
The lab was not run. Row V10 in C4 is retested in #1405's final retest. |
IngressAttachedTo read the first tcx program's name to tell usid_ingress from another program, but opening a program by ID needs CAP_SYS_ADMIN, which galactic-gateway does not hold. The check would then fail with the head link in place, and the gateway would never report local delivery. Compare the first program's ID with the program of the head link galactic-cni pinned, which needs no more than CAP_BPF, and keep the name only as a fallback.
|
Both reviewers agreed on a second pass over head 0b74461: pr-rereviewer returned merge, and pr-conventions-reviewer returned merge. The remaining notes were a cosmetic commit-subject nit that the 72-character rule already satisfies, merge-order notes on #598, #1558, #1549 and #1559, and a reminder to wait for the CI root job, which was done. The first pass held on two points. The adversarial reviewer held on the name lookup that needed CAP_SYS_ADMIN, which commit 0b74461 fixed. The conventions reviewer held on the title and body, which were rewritten. No findings from the second pass needed applying. Each reviewer ran its own read of the diff against the base branch and the repository's conventions; the per-reviewer RAN lists were not carried into this hand-off, so they are not reproduced here. CI on 0b74461: all checks passed (26 passed, 2 skipped by design). The ruleset on the base branch has no pull-request rule, so there is no required review and auto-merge can complete without a human approval. The merge method was the default merge commit, and the PR merged as soon as it was marked ready. |
When the backend runs on the gateway's own node and the public side carries a VLAN tag, requests to the VIP time out. The cluster network plugin's program on the public VLAN interface ran before Galactic's decapsulation program, passed the packet on, and the kernel dropped it. Galactic's program now runs first on those interfaces and leaves other traffic to the plugin. The gateway reports same-node delivery only while that order holds.
Fixes #1556
Test plan
task lint,task build,task test:unit, and the affected root packages in a privileged container