Skip to content

[2/3] Integrate XSK maps into the core XDP datapath#6003

Merged
guhetier merged 68 commits into
mainfrom
jackhe/xdp_map_dp_int_pr_2_core
Jul 2, 2026
Merged

[2/3] Integrate XSK maps into the core XDP datapath#6003
guhetier merged 68 commits into
mainfrom
jackhe/xdp_map_dp_int_pr_2_core

Conversation

@ProjectsByJackHe

@ProjectsByJackHe ProjectsByJackHe commented May 18, 2026

Copy link
Copy Markdown
Contributor

Description

Full E2E demo using tools from this PR : DEMO

Part 2 of the plan: #5982
Fixes #5972

Adds the core msquic datapath integrations for the new API contract defined in #5983

Key design decisions:

  • If map mode is enabled, then we do not create the WinSock or Epoll or .... datapaths. No more best effort!
  • Init failures in map mode hard fails the datapath initialization. No silent failures!

Testing

Added datapath unit tests. See the E2E demo.

Additionally, the plan is to leverage some supporting PRs that included code to ingest the latest XDP version, and kicking off a couple of manual CI runs based on that: https://github.com/microsoft/msquic/actions/runs/27313685557/job/80690420168

Documentation

Will come as part 3 in the plan: #5982

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.56%. Comparing base (07bbcb7) to head (1d300d4).

Files with missing lines Patch % Lines
src/core/library.c 11.11% 16 Missing ⚠️
src/core/settings.c 33.33% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (14.28%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6003      +/-   ##
==========================================
- Coverage   86.03%   85.56%   -0.48%     
==========================================
  Files          60       60              
  Lines       18911    18929      +18     
==========================================
- Hits        16271    16196      -75     
- Misses       2640     2733      +93     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread submodules/xdp-for-windows
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/platform/datapath_raw_win.c Outdated
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/platform_internal.h
Comment thread src/platform/platform_internal.h Outdated
@ProjectsByJackHe

Copy link
Copy Markdown
Contributor Author

Planning on waiting until #6006 gets resolved to address the next wave of feedback.

Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
@mtfriesen

Copy link
Copy Markdown
Contributor

It's not clear to me why we don't have end-to-end tests exercising everything from providing the XSKMAP before creating a registration through actual XDP data paths flowing? Since we intend to officially support this feature, it is risky for both us and our partners to supply/depend on an API that does not have regression test coverage and a paved pattern to follow.

@ProjectsByJackHe

ProjectsByJackHe commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

It's not clear to me why we don't have end-to-end tests exercising everything from providing the XSKMAP before creating a registration through actual XDP data paths flowing? Since we intend to officially support this feature, it is risky for both us and our partners to supply/depend on an API that does not have regression test coverage and a paved pattern to follow.

That's in the works. I took the approach of building up an E2E flow manually first to see the shape of how the datapath integration would look like. There's likely going to be some limitations in the CI environment that prevents some scenarios from being exercised, but I am currently adding coverage for the parts that can be automated now that the skeleton of the general changes is mapped out in the current PR iteration.

@mtfriesen

Copy link
Copy Markdown
Contributor

Let's ensure we add tests with each chunk of work we do. I understand it may be a lot of work to add tests, but the best time to protect the code with automation and review the coverage is when making the change.

Comment thread src/core/settings.c Outdated
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/platform/datapath_raw_dummy.c Outdated
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/datapath_winuser.c Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/platform_internal.h Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/datapath_xplat.c Outdated
@ProjectsByJackHe

Copy link
Copy Markdown
Contributor Author

Let's ensure we add tests with each chunk of work we do. I understand it may be a lot of work to add tests, but the best time to protect the code with automation and review the coverage is when making the change.

XDP needs to release a new driver version consumable by MsQuic in the CI before I can push my tests.

I have them right now working over a local VM with the latest xdp drivers installed, and find that everything is working.

@ProjectsByJackHe

ProjectsByJackHe commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Either we merge #6034 (or wait until the next XDP release) to add automated coverage, or having a one-off manual dispatch for the tests + manual local VM runs is good enough to give confidence to merge this integration. Let's decide on this first and align timelines. Currently, the map tests are pushed for review, but disabled.

Comment thread .github/workflows/test.yml Outdated
Comment thread src/test/lib/precomp.h Outdated
Comment thread src/test/lib/TestListener.h Outdated
Comment thread src/test/bin/quic_gtest.cpp Outdated
Comment thread src/core/settings.c Outdated
Comment thread scripts/test.ps1
Comment thread src/test/lib/HandshakeTest.cpp Outdated
Comment thread src/test/lib/HandshakeTest.cpp Outdated
Comment thread src/test/lib/DataTest.cpp Outdated
Comment thread src/test/bin/quic_gtest.cpp Outdated
Comment thread src/test/bin/quic_gtest.cpp
Comment thread scripts/run-gtest.ps1
Comment thread src/platform/unittest/DataPathTest.cpp Outdated
Comment thread src/platform/datapath_raw.h Outdated
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/datapath_xplat.c
Comment thread src/test/bin/quic_gtest.cpp Outdated
Comment thread src/test/bin/quic_gtest.cpp Outdated
Comment thread .github/workflows/test.yml Outdated
Comment thread src/platform/unittest/DataPathTest.cpp Outdated

@mtfriesen mtfriesen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to solve the testing problem - map mode should run all existing MsQuic tests that are not intrinsically incompatible with an XDP map.

Nearly all MsQuic protocol level tests should be compatible with XDP maps, so getting those exercised is a min bar.

Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/core/settings.c Outdated
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/inc/quic_datapath.h Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/datapath_xplat.c Outdated
Comment thread src/platform/datapath_winuser.c
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
@mtfriesen

Copy link
Copy Markdown
Contributor

Before merging this PR taking a dependency on a prerelease feature, we need to merge the upstream PR that automates prerelease publishing.

@microsoft microsoft deleted a comment from github-actions Bot Jun 22, 2026
@microsoft microsoft deleted a comment from github-actions Bot Jun 22, 2026
ProjectsByJackHe and others added 18 commits July 1, 2026 10:14
test.ps1 declared -UseXdp as [switch] with a string default of "", which
fails PowerShell argument transformation on every invocation that does not
pass -UseXdp, and mis-binds -UseXdp <version> as a positional argument when
it does (landing on -IsolationMode). UseXdp carries an XDP version string
(e.g. 'xdp-v1.1'), so declare it as [string] to match its usage and the
other scripts (prepare-machine.ps1, spin.ps1, recvfuzz.ps1).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Now that #6125 changed ServerAcceptContext to take a UniquePtr<TestConnection>*,
pass &Server directly instead of casting to TestConnection**.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@guhetier guhetier force-pushed the jackhe/xdp_map_dp_int_pr_2_core branch from 6700f46 to db094cc Compare July 1, 2026 19:12
Comment thread src/platform/datapath_raw_xdp_win.c Outdated
Comment thread src/platform/datapath_raw_xdp_win.c
Comment thread src/platform/datapath_xplat.c
guhetier and others added 2 commits July 1, 2026 14:25
Add the failing HRESULT to the XdpMapInsertFailed trace and log a new
XdpMapDeleteFailed trace when best-effort XSK map deletes fail (both in the
insert cleanup path and in CxPlatDpRawRemoveXskFromMap). Regenerate the CLOG
sidecar and generated files for the updated/added traces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@guhetier guhetier enabled auto-merge (squash) July 1, 2026 22:01
@guhetier guhetier dismissed mtfriesen’s stale review July 1, 2026 22:02

Comment addressed and multiple iteration since review.

@guhetier guhetier merged commit b632469 into main Jul 2, 2026
500 of 501 checks passed
@guhetier guhetier deleted the jackhe/xdp_map_dp_int_pr_2_core branch July 2, 2026 01:26
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.

The XDP datapath must use XDP maps instead of XDP programs when maps are provided

5 participants