Skip to content

[cli] drive the AF_XDP node path through the vtep.Datapath seam (APO-795)#5

Merged
dilyevsky merged 1 commit into
mainfrom
dsky/apo-795-icx-vtepdatapath-enginexfrm-seam-pluggable-vtep-io-drivers
Jun 16, 2026
Merged

[cli] drive the AF_XDP node path through the vtep.Datapath seam (APO-795)#5
dilyevsky merged 1 commit into
mainfrom
dsky/apo-795-icx-vtepdatapath-enginexfrm-seam-pluggable-vtep-io-drivers

Conversation

@dilyevsky

Copy link
Copy Markdown
Contributor

Closes the last open APO-795 sub-item: repoint cli/main.go onto the
vtep.Datapath seam.

The seam, the afxdp wrapper, and the netstack/tun drivers all landed in
#3. But the node path still constructed forwarder.NewForwarder(...) and called
forwarder.Start directly, so the per-node / tunnelproxy VTEP was the one
consumer bypassing the seam every other driver runs behind.

Change

Build the forwarder exactly as before (as afxdp.Wrap documents), then wrap it
and drive dp.Run(gctx) instead of fwd.Start(gctx):

dp := afxdp.Wrap(fwd)
...
g.Go(func() error {
    if err := dp.Run(gctx); err != nil && !errors.Is(err, context.Canceled) {
        return fmt.Errorf("datapath: %w", err)
    }
    return nil
})

Why this stays byte-identical

afxdp.Datapath is a pure lifecycle adapter -- Run delegates straight to
forwarder.Start (which self-closes via closeOnce on return) and Close to
the idempotent forwarder.Close. The in-place, shared-UMEM hot loop,
processFrames, and minInPlaceHeadroom live entirely inside forwarder and
are not touched. Run returns Start's error verbatim, so the
errors.Is(context.Canceled) shutdown handling is unchanged. The
forwarder_rxheadroom_test + cp_wire_test guards continue to hold the
byte-identical contract.

Verification

  • GOOS=linux GOARCH={arm64,amd64} go build of the cli (mirrors the build-cli
    job) -- green.
  • go vet of both modules for linux, and go build ./... for the root module -- green.
  • Linux-only guard test binaries (forwarder, root icx) compile against this tree.
  • OS-agnostic seam/engine guards pass on the dev host: TestInPlaceRoundTrip,
    TestControlPlanePerDirectionGeneveRoundTrip, and the vtep/netstack
    Datapath round-trip tests. The live AF_XDP path needs a real kernel +
    NET_ADMIN, so the kernel-level guards run in CI.

…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.
@linear-code

linear-code Bot commented Jun 16, 2026

Copy link
Copy Markdown

APO-795

@dilyevsky dilyevsky merged commit cd84e47 into main Jun 16, 2026
3 of 4 checks passed
@dilyevsky dilyevsky deleted the dsky/apo-795-icx-vtepdatapath-enginexfrm-seam-pluggable-vtep-io-drivers branch June 16, 2026 21:28
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