fix(srv6): rewrite tenant localsid decap VRF after an agent restart#21
Merged
Merged
Conversation
The per-tenant VRF table id comes from an in-memory vrfAllocator that is not persisted or seeded from VPP. On an agent-only restart the End.DT6 localsid persists in VPP with its decap VRF baked into SwIfIndex from the previous process, but installTenantDataPath merely skipped the re-add and installed ::/0 in the freshly-allocated VRF. When the ids differ, traffic decapped into the old VRF (no egress route -> blackhole) or another tenant's VRF (cross-wire). findLocalsid now returns the persisted entry so its decap VRF can be compared; on mismatch the localsid is rewritten (del+add) to decap into this process's VRF. Steady state (matching VRF) stays a no-op, so there is no per-reconcile churn.
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.
What
The per-tenant VRF table id comes from an in-memory
vrfAllocatorthat is not persisted or seeded from VPP. On an agent-only restart the End.DT6 localsid persists in VPP with its decap VRF baked intoSwIfIndexfrom the previous process, butinstallTenantDataPathmerely skipped the re-add and installed::/0in the freshly-allocated VRF. When the ids differ, traffic decapped into the old VRF (no egress route → blackhole) or another tenant's VRF (cross-wire).Fix
findLocalsidreturns the persisted entry (the dump mapsxconnect_iface_or_vrf_table→SwIfIndex) so its decap VRF can be compared; on mismatch the localsid is rewritten (del+add) to decap into this process's VRF. Steady state (matching VRF) stays a no-op — no per-reconcile churn.Review finding
Medium #8, corroborated by dp-gateway (2/3). Builds on #20 (VRF alloc/free symmetry).
Test
GOOS=linux go build/vetgreen;go test ./calico-vpp-agent/srv6egress/...green. Data-path behavior can't be exercised on darwin (no VPP).