Skip to content

[2/3] Add CIBIR, XDP, and XSK maps support to the sample tools#5999

Open
ProjectsByJackHe wants to merge 19 commits into
mainfrom
jackhe/extend-sample-include-xdp-cibir
Open

[2/3] Add CIBIR, XDP, and XSK maps support to the sample tools#5999
ProjectsByJackHe wants to merge 19 commits into
mainfrom
jackhe/extend-sample-include-xdp-cibir

Conversation

@ProjectsByJackHe

@ProjectsByJackHe ProjectsByJackHe commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

Full E2E demo: DEMO

Adds 2 new sample tools to support changes in PR :

  • quicxdpsample.exe: quicsample.exe but with additional support for XDP/CIBIR/XSK maps.
  • quicxskmapcreator.exe: meant to replicate a trusted admin process that can create programs/rules. It gives a map handle to the consumer quicadvanced server.

Testing

Local testing on a VM with XDP

Documentation

No

@ProjectsByJackHe ProjectsByJackHe requested a review from a team as a code owner May 15, 2026 01:15
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.38%. Comparing base (176ec66) to head (981a902).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5999      +/-   ##
==========================================
+ Coverage   84.97%   85.38%   +0.41%     
==========================================
  Files          60       60              
  Lines       18792    18792              
==========================================
+ Hits        15968    16046      +78     
+ Misses       2824     2746      -78     

☔ View full report in Codecov by Sentry.
📢 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.

@guhetier

guhetier commented May 15, 2026

Copy link
Copy Markdown
Collaborator

It seems like a great idea to add those features in a sample. I have no problem with an incremental implementation.
One concern though: the MsQuic sample can be used as a test tool, but it is mainly documentation to help user getting started. It is already pretty complicated, with features that a basic use case doesn't need.

I'd consider having multiple samples instead, focused on demonstrating one way of using MsQuic, and avoid putting everything in a single one.

A sample focused on XDP / CIBIR / XDP maps could be a nice unit.

@ProjectsByJackHe ProjectsByJackHe changed the title Add CIBIR and XDP support to the quicsample tool Add CIBIR, XDP, and XSK maps support to the sample tools May 18, 2026
The new tools (quicxskmapcreator) require XdpMapCreate and
XDP_MAP_TYPE_XSKMAP which are available in the newer XDP SDK.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ProjectsByJackHe ProjectsByJackHe changed the title Add CIBIR, XDP, and XSK maps support to the sample tools [2/3] Add CIBIR, XDP, and XSK maps support to the sample tools May 19, 2026
Comment thread src/tools/quicxdpsample/quicxdpsample.c
Comment thread src/tools/CMakeLists.txt Outdated
add_subdirectory(etw)
add_subdirectory(recvfuzz)
add_subdirectory(quicxskmapcreator)
add_subdirectory(quicadvanced)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can come up with a better name.
This sample is about using XDP with maps, and potentially CIBIR? Let's call it something with XDP in the name.

I'd also consider making a subfolder to contain both quicxskmapcreator and quicadvanced, since they are meant to work together.


Usage:
1. Start the QUIC server:
quicsample -server -cert_hash:<hash> -xdp -xdp_map_ifindex:<N>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please update this doc

printf("\n");
printf("Press ENTER to detach the program and exit.\n");
fflush(stdout);
(void)getchar();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to wait? If this process is closed, the map stays open as long as the target process runs?

Comment thread src/tools/quicxdpsample/quicxdpsample.c Outdated

Abstract:

Provides a very simple MsQuic API sample server and client application.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please update this comment

// QUIC_PARAM_GLOBAL_XDP_MAP_CONFIG must be set before LazyInitComplete.
//
#ifdef _WIN32
if (GetFlag(argc, argv, "server") && GetFlag(argc, argv, "xdp")) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make this a helper function.

}

void
WriteSslKeyLogFile(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We probably don't need this in the XDP sample


printf("\n");

if (MapMode) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please extract this in a helper.
This is boilerplate code that is not helpful to a reader to understand what they need to do to implement a connection, let's not have it in the way.

MsQuic->ConnectionClose(Connection);
}
break;
case QUIC_CONNECTION_EVENT_RESUMPTION_TICKET_RECEIVED:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We probably don't need this in the xdp sample.

const char* CibirIdHex = GetValue(argc, argv, "cibir_id");
if (CibirIdHex != NULL) {
//
// CIBIR requires shared binding (so the connection uses source CIDs).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you sure of that? Wouldn't a client connection put the CIBIR id on the destination CID?

#ifdef QUIC_API_ENABLE_PREVIEW_FEATURES

void
RunMultiClient(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's remove this, there is nothing XDP specific to it.

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.

3 participants