Repository navigation
feat: Let operators force the host-wide XDP attach mode - #1535
Conversation
Add GALACTIC_XDP_MODE (--xdp-mode), one name that galactic-gateway and galactic-nat both read: auto (the default) keeps the driver-based choice, native or generic forces that mode for every Galactic XDP attachment on the host. Any other value fails validation. Each process logs the decision's source, forced or driver, next to its mode and reason, and warns when native is forced over bnxt_en NICs (#673). Before attaching, each process claims the host's mode under /sys/fs/bpf/galactic-xdp/modes/<component>/ and holds a flock on the claim for its lifetime. A live claim from the other component in a different mode fails startup with ErrHostModeConflict, whatever either decision came from, so a host never attaches in mixed modes. A stale claim, and a peer from a release that writes none, block nothing. The containerlab lab gains XDP_MODE for deploy, lab:xdp-mode to switch a running lab, and verify:xdp-mode to check every Galactic attachment's mode. Fixes #1534
|
Evidence for 9180e0f. Lab checks are deferred to the end-of-epic lab pass in #1405, as the PR body says. Unit tests ( Root test on a real bpffs (a privileged throwaway container with its own bpffs mount; This test caught a real bug that tmpfs could not: bpffs refuses any name containing a dot, so the first record format ( Upgrade safety. A pod from a release without claims writes none, so a new pod beside it starts. The dispatcher's existing Mixed-mode hole, before and after. Before, the later process migrated the dispatcher links it covers, and the earlier one went not-ready, so interfaces only the earlier one covered, such as the gateway's internal interfaces, stayed in the old mode until it restarted. After, the later process fails at startup with Other checks.
Lab, partial and not acceptance evidence. A native-mode lab deploy of an earlier revision confirmed that every Kind node has its own bpffs mount, distinct from the host's and from every other node's. Each edge node's claim directory held only its own gateway and shard, recorded |
|
Verdicts from the first review pass, both VERDICT: merge. I found no correctness defects. Claim runs once per process on exclusive code paths, the config resolves GALACTIC_XDP_MODE and --xdp-mode correctly, and the build, vet and tests pass locally. The remaining condition is green CI. VERDICT: merge. No reach or convention problems. The lab checks are deferred to the end-of-epic pass (#1405), as the PR body states. The PR has no Flux, Kustomize or patch-target changes. A merge-tree against #1532 (same containerlab README, Taskfile and lib.sh) is clean. No findings were applied, so this run made no commits. The adversary's only item, the wait for green CI, was handled here. CI on head 9180e0f: every check passed (Build, Lint, Unit Tests, Unit Tests (root), ci / Build and test, E2E Tests, Manifests, Documentation, Alerts, Service API bundle, bundle-is-current, platforms, publish-kustomize-bundles, and the image publish jobs), with the debug and service-api publish jobs skipped by design. The PR was marked ready after CI passed. Auto-merge was enabled with the merge method (--merge) that the base ruleset allows. The base branch ruleset carries no review requirement, so auto-merge completed on CI alone and the PR merged before any human approval. No human reviewer was requested beyond the code owners, since the repository sets none. |
feat: Let operators force the host-wide XDP attach mode
Summary
Operators had no way to run Galactic's XDP programs in generic mode on a host without bnxt_en NICs, so the lab never exercised the generic-mode paths the tagged-transport work needs.
A new host-wide setting, read by both the edge gateway and the egress shard, forces native or generic mode, and left unset it keeps today's driver-based choice and logs which one decided.
Each process now claims the host's mode before it attaches and fails at startup beside a live peer in the other mode, whatever either decision came from, where before the later process left the earlier one's interfaces in the old mode until that pod restarted.
Deferred to the end-of-epic lab pass (#1405)
Test plan
Fixes #1534