fix(usid): Deliver inbound traffic to tap and veth Instances that share a VPC on one node - #534
Merged
Merged
Conversation
Inbound SRv6 traffic chose its redirect helper from a value shared by every attachment in a VPC on a node, so whichever attachment type registered last decided delivery for all of them. A general-purpose Instance (tap) sharing a VPC and node with a unikernel Instance (veth) was silently black-holed once the veth attached. The redirect choice now comes from a new per-interface map keyed by the resolved egress interface, written at CNI ADD, removed at DEL, and verified by CHECK. Existing pinned maps keep their layout, so a rollout does not wipe routing state. An interface without an entry uses plain bpf_redirect, which delivers to taps and, through the host-side veth's transmit path, into a veth's peer namespace. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
privateip
approved these changes
Sep 13, 2026
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.
Summary
A general-purpose Instance could become unreachable as soon as a unikernel Instance joined the same VPC on the same node. Inbound connections to it timed out, and no drop counter recorded the loss. With this change, both kinds of Instance receive inbound traffic, whatever order they attach in.
Cause
The datapath picks one of two kernel redirect methods to deliver decapsulated traffic. Veth attachments (unikernel Instances) use a method that crosses into the Instance's network namespace. Tap attachments (general-purpose Instances) need the plain method. That choice was stored once per VPC per node, so the last attachment to register decided it for every attachment in the VPC. When a veth registered after a tap, the kernel silently discarded every packet sent to the tap. The staging outage on
eris-giunein VPCbfollowed exactly that order.Fix
Testing
A new datapath test sends real SRv6 frames through the program into tap and veth devices. Against the current main datapath, it reproduces the outage: the tap attachment is black-holed when the veth registers last. With this change, both attachments receive traffic in both registration orders, each through the expected redirect method. Other tests cover the no-entry fallback, deletion of one attachment's entry, and loading a pin set from the previous build without losing routing state.
Related
🤖 Generated with Claude Code