Skip to content

fix(srv6): rewrite tenant localsid decap VRF after an agent restart#21

Merged
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-gateway-vrf-restart-rewrite
Jul 3, 2026
Merged

fix(srv6): rewrite tenant localsid decap VRF after an agent restart#21
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-gateway-vrf-restart-rewrite

Conversation

@ryskn

@ryskn ryskn commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

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).

Fix

findLocalsid returns the persisted entry (the dump maps xconnect_iface_or_vrf_tableSwIfIndex) 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/vet green; go test ./calico-vpp-agent/srv6egress/... green. Data-path behavior can't be exercised on darwin (no VPP).

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.
@ryskn ryskn merged commit 1b1168f into dev/srv6egress-v1 Jul 3, 2026
1 check passed
@ryskn ryskn deleted the fix/srv6-gateway-vrf-restart-rewrite branch July 3, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant