[cli] drive the AF_XDP node path through the vtep.Datapath seam (APO-795)#5
Merged
dilyevsky merged 1 commit intoJun 16, 2026
Conversation
…795) The cli built the forwarder and called forwarder.Start directly, so the per-node VTEP was the one consumer still bypassing the vtep.Datapath seam that the tun and netstack drivers already run behind. Wrap the forwarder with afxdp.Wrap and drive dp.Run -- the last open APO-795 sub-item. afxdp.Datapath is a pure lifecycle adapter: Run delegates to forwarder.Start (which self-closes on return) and Close to the idempotent forwarder.Close, so the in-place shared-UMEM hot loop and minInPlaceHeadroom are untouched and the node data path stays byte-identical (guarded by forwarder_rxheadroom_test + cp_wire_test). The forwarder is still constructed via forwarder.NewForwarder, exactly as afxdp.Wrap documents.
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.
Closes the last open APO-795 sub-item: repoint
cli/main.goonto thevtep.Datapathseam.The seam, the
afxdpwrapper, and thenetstack/tundrivers all landed in#3. But the node path still constructed
forwarder.NewForwarder(...)and calledforwarder.Startdirectly, so the per-node / tunnelproxy VTEP was the oneconsumer bypassing the seam every other driver runs behind.
Change
Build the forwarder exactly as before (as
afxdp.Wrapdocuments), then wrap itand drive
dp.Run(gctx)instead offwd.Start(gctx):Why this stays byte-identical
afxdp.Datapathis a pure lifecycle adapter --Rundelegates straight toforwarder.Start(which self-closes viacloseOnceon return) andClosetothe idempotent
forwarder.Close. The in-place, shared-UMEM hot loop,processFrames, andminInPlaceHeadroomlive entirely insideforwarderandare not touched.
RunreturnsStart's error verbatim, so theerrors.Is(context.Canceled)shutdown handling is unchanged. Theforwarder_rxheadroom_test+cp_wire_testguards continue to hold thebyte-identical contract.
Verification
GOOS=linux GOARCH={arm64,amd64} go buildof the cli (mirrors thebuild-clijob) -- green.
go vetof both modules for linux, andgo build ./...for the root module -- green.forwarder, rooticx) compile against this tree.TestInPlaceRoundTrip,TestControlPlanePerDirectionGeneveRoundTrip, and thevtep/netstackDatapathround-trip tests. The live AF_XDP path needs a real kernel +NET_ADMIN, so the kernel-level guards run in CI.