Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel Platform Worker Support #4605

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Conversation

nibanks
Copy link
Member

@nibanks nibanks commented Oct 9, 2024

Description

Extracts/refactors some of the code in #4023 to support platform worker threads, which is a prereq for kernel xdp support.

Testing

CI/CD

Documentation

N/A

@nibanks nibanks requested a review from a team as a code owner October 9, 2024 13:28
@nibanks nibanks added OS: Windows (Kernel) Area: Core Related to the shared, core protocol logic labels Oct 9, 2024
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.52%. Comparing base (ba795e0) to head (fd58cee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4605      +/-   ##
==========================================
- Coverage   87.38%   85.52%   -1.86%     
==========================================
  Files          56       56              
  Lines       17400    17400              
==========================================
- Hits        15205    14882     -323     
- Misses       2195     2518     +323     

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

@nibanks
Copy link
Member Author

nibanks commented Oct 9, 2024

Looks like the kernel BVTs are crashing. I will try to investigate later.

nigriMSFT
nigriMSFT previously approved these changes Oct 11, 2024
ami-GS
ami-GS previously approved these changes Nov 14, 2024
@nibanks
Copy link
Member Author

nibanks commented Nov 14, 2024

Something seems broken in netperf runs. I can't tell if it's because of this or not. Needs to be investigated before merging.

@ami-GS
Copy link
Contributor

ami-GS commented Nov 15, 2024

Is the netperf result reliable? wsk related failure is really few. others are more

@nibanks nibanks marked this pull request as draft November 21, 2024 15:12
@nibanks
Copy link
Member Author

nibanks commented Nov 21, 2024

Converted this back to draft, because we need to switch to using NtCreateIoCompletion, NtSetIoCompletion, and NtRemoveIoCompletionEx.

@mtfriesen
Copy link
Contributor

Converted this back to draft, because we need to switch to using NtCreateIoCompletion, NtSetIoCompletion, and NtRemoveIoCompletionEx.

I suggest using the Zw variants for KM, unless QUIC is calling on behalf of the user mode thread calling QUIC, and all in the same thread context.

@@ -847,6 +846,11 @@ CxPlatDataPathInitialize(
}
}

if (!CxPlatWorkerPoolLazyStart(WorkerPool, Config)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Launching threads here can be waste of resources? because pure winkernel doesn't use them.
Should be put in raw datapath initialization? but no need to fix in this PR I think.

src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
src/inc/quic_platform_winkernel.h Outdated Show resolved Hide resolved
@ami-GS
Copy link
Contributor

ami-GS commented Jan 16, 2025

Because platform_winkernel.c copies from zwapi.h, quic_platform_winkernel.h does same.

@ami-GS
Copy link
Contributor

ami-GS commented Jan 17, 2025

CxPlatEventWaitForever(Worker->Done);

RegistrationClose doesn't return by here

Edit:
QuicWorkerLoop is not called for some reason

@nibanks
Copy link
Member Author

nibanks commented Jan 17, 2025

CxPlatEventWaitForever(Worker->Done);

RegistrationClose doesn't return by here
Edit: QuicWorkerLoop is not called for some reason

Likely means the worker thread isn't actually woken to clean up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core Related to the shared, core protocol logic OS: Windows (Kernel)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants