Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
258 commits
Select commit Hold shift + click to select a range
614472a
Fix false-positive Debug.Fail in lifecycle map and add teardown drain
benaadams Feb 13, 2026
afd4382
Extract TryRemoveTrackedOperationCore helper, add late-CQE diagnostic…
benaadams Feb 13, 2026
b604a73
Add SocketsTelemetry late-CQE counter, atomic tracked-map removal, an…
benaadams Feb 13, 2026
d9f8b22
Add structured counter capture, late-CQE envelope automation, and tel…
benaadams Feb 13, 2026
7125c68
Add operation-level buffer pinning, perf comparison report, and evide…
benaadams Feb 13, 2026
1ce5515
Add non-pinnable prepare fallback telemetry, accept addrlen field, an…
benaadams Feb 13, 2026
126bc27
Add non-pinnable prepare fallback envelope evaluation and evidence to…
benaadams Feb 13, 2026
2bcf1c9
Add CQE completion dispatch with per-operation processing, queue remo…
benaadams Feb 13, 2026
db7d079
Wire native io_uring SQE preparation for send/recv/accept/connect, ad…
benaadams Feb 13, 2026
c2c7f02
Fix IORING_OP_CONNECT SQE field mapping and add IoUringCompletion lay…
benaadams Feb 13, 2026
0aa8181
Add native diagnostics for async-cancel CQEs and wait-buffer saturation
benaadams Feb 13, 2026
5adb3ca
Add native diagnostics snapshot export to managed telemetry and fix m…
benaadams Feb 13, 2026
c07a8ac
Add native io_uring vectored message operation support (IORING_OP_SEN…
benaadams Feb 13, 2026
cbd3bf0
Add recvmsg completion writeback, MessageHeader ABI guards, and Socke…
benaadams Feb 13, 2026
817643d
Add runtime per-opcode support gating via IORING_REGISTER_PROBE
benaadams Feb 13, 2026
ac76e3f
Add managed interop surface, requeue failure fallback, telemetry coun…
benaadams Feb 13, 2026
f7d4630
Add CI archive variants for io_uring enabled/disabled test execution
benaadams Feb 13, 2026
9bb0c38
Update PR evidence template for completion-path counters and current …
benaadams Feb 13, 2026
96f280c
Suppress unused-macro and unused-parameter warnings when io_uring is …
benaadams Feb 13, 2026
cc02a53
Fix AllocateIoUringUserDataToken zero-skip to loop instead of single …
benaadams Feb 13, 2026
43a8f2d
Add missing sys/mman.h include for io_uring ring mmap/munmap
benaadams Feb 13, 2026
9a4e545
Add explicit casts for MAP_FAILED and mmap on io_uring_sqe pointer
benaadams Feb 13, 2026
050def1
Fix CS8602 null dereference warning and CA2020 unchecked UIntPtr cast
benaadams Feb 13, 2026
672b49f
Add live cancellation via IORING_OP_ASYNC_CANCEL on TryCancel and fix…
benaadams Feb 13, 2026
21722d9
Mask user_data tokens to 56-bit payload range and increase RemoteExec…
benaadams Feb 13, 2026
9492b84
Raise minimum kernel to 5.13, coalesce cancel submits via worker, de-…
benaadams Feb 13, 2026
aa1f25f
Add buffer-list vectored send/receive for io_uring completion mode vi…
benaadams Feb 13, 2026
17b2693
Add ReceiveMessageFrom completion path, extract SocketPal io_uring he…
benaadams Feb 13, 2026
096cbdd
Add async-cancel probe-disable test hook and accept/connect/cancel-fa…
benaadams Feb 13, 2026
4be890c
Add per-opcode disable test hook, inline non-Linux stubs, and expand …
benaadams Feb 13, 2026
7989adf
Add deterministic forced-result test hooks for io_uring completion CQ…
benaadams Feb 13, 2026
d4f7c0d
Refactor CreateSocketEngineOptions to use SetOrRemoveEnvironmentVaria…
benaadams Feb 13, 2026
d129cd1
Add teardown, non-pinnable fallback, mixed-mode, and GC-pressure tests
benaadams Feb 13, 2026
d7089e5
Add pinning-lifecycle, non-pinnable telemetry, and tracking memory tests
benaadams Feb 13, 2026
d9e0d32
Add configurable event buffer count, call-site platform guards, and b…
benaadams Feb 13, 2026
01d21bb
Add cancellation-submit contention, same-socket backlog fairness, and…
benaadams Feb 13, 2026
c6deac2
Add bounded wait-buffer and invalid override scenarios to evidence to…
benaadams Feb 13, 2026
f22cff1
Fix forced-result test races, complete diagnostic snapshot, and refin…
benaadams Feb 14, 2026
339d6ad
Harden forced-result follow-up receives and simplify buffer-count test
benaadams Feb 14, 2026
0966c99
Simplify forced-result tests and reduce invalid buffer-count test to …
benaadams Feb 14, 2026
5cb52ee
Split io_uring code into Linux-only partial class files
benaadams Feb 14, 2026
eca7fa3
Replace #if TARGET_LINUX blocks with partial method hooks and move co…
benaadams Feb 14, 2026
22fcdb1
Move io_uring fields, types, and methods from shared .Unix.cs files t…
benaadams Feb 14, 2026
f8a9baa
Fix Linux build errors, add cold-helper caller guards, extract throw …
benaadams Feb 14, 2026
586e272
Extract sync precondition helper, add PREPARE_CLEANUP_RETURN macro, c…
benaadams Feb 14, 2026
47b3f23
Fix native bugs, harden platform gating, remove dead code, and expand…
benaadams Feb 14, 2026
f3a0dc2
Fix errno bug, hoist connect userData check, add CQ overflow monitori…
benaadams Feb 14, 2026
18c0c17
remove
benaadams Feb 14, 2026
4407aaa
Define TARGET_LINUX in System.Net.Sockets.csproj to fix CS0426 build …
benaadams Feb 14, 2026
186c46e
Add canonical mode state machine, centralized env parsing, unified ca…
benaadams Feb 14, 2026
a81d257
Fix TARGET_LINUX define to exclude Android builds
benaadams Feb 14, 2026
722ed53
Fix test
benaadams Feb 14, 2026
5c64550
Consolidate io_uring env vars into single DOTNET_SYSTEM_NET_SOCKETS_I…
benaadams Feb 14, 2026
1b4d0c0
Replace #if TARGET_LINUX with partial method hooks and split Interop.…
benaadams Feb 14, 2026
f5a4382
Fix completion resource use-after-free: defer ClearIoUringUserData un…
benaadams Feb 14, 2026
045241c
Gate test event buffer count env var behind #if DEBUG
benaadams Feb 14, 2026
fc92e1f
Unify io_uring operation registry, lifecycle assertions, and completi…
benaadams Feb 14, 2026
0d02e51
Extract ProcessIoUringCompletionSuccess/Error virtual dispatch from m…
benaadams Feb 14, 2026
ffb49ff
Fix TelemetryTest TypeLoadException on non-Linux and consolidate nati…
benaadams Feb 14, 2026
89b1bb0
Extract generic StartSocketAsyncEventArgsOperation helper and central…
benaadams Feb 14, 2026
748a513
Fix disconnect-before-reconnect scoping in IoUringOptIn_DisconnectRec…
benaadams Feb 14, 2026
f2c8d7d
Simplify partial-send theory dispatch and adopt AcceptConnectedTcpPai…
benaadams Feb 14, 2026
b73fa27
Make LinuxTryStageIoUringOperation static partial to fix CA1822
benaadams Feb 14, 2026
86d7be8
Extract WithIoUringNativeDiagnosticsSnapshotDeltaAsync wrapper and me…
benaadams Feb 14, 2026
04ef2d7
Remove unused using System.Net.Sockets from Interop.SocketEvent.cs
benaadams Feb 14, 2026
2caed63
Merge non-pinnable fallback and packet-info IPv4/IPv6 test pairs into…
benaadams Feb 14, 2026
ae5b538
Fix connect-with-initial-data ErrorCode and callback dispatch on sync…
benaadams Feb 14, 2026
6f1553d
Widen _ioUringPrepareSequence to long and make resource release idemp…
benaadams Feb 15, 2026
03134ed
Add bounded prepare-queue capacity with overflow telemetry
benaadams Feb 15, 2026
bd05441
Add prepare-queue depth gauge and merge ReceiveMessageFrom buffer-lis…
benaadams Feb 15, 2026
aa22238
ArrayPool for buffer-list GCHandle[]/IOVector[] and dynamic hash buck…
benaadams Feb 15, 2026
2f076ea
Extract shared SQE initialization helpers for io_uring prep functions
benaadams Feb 15, 2026
b2af995
Pool native completion-operation state and split IoUringTrace into no…
benaadams Feb 15, 2026
23538d7
Reuse pinned buffers on EAGAIN requeue, consolidate message-op allocs…
benaadams Feb 15, 2026
9eb60c8
Add inline fast-path storage for message-op iovec/sockaddr/control bu…
benaadams Feb 15, 2026
7c0be0d
Extend pin reuse to buffer-list ops, fix partial-send handle leak, ad…
benaadams Feb 15, 2026
5f7fd7b
Add full pin reuse to ReceiveMessageFromOperation with shape-transiti…
benaadams Feb 15, 2026
62b011f
Defer canceled-op resource release until terminal CQE and gate test e…
benaadams Feb 15, 2026
fb38ea1
Fix completion resource use-after-free: defer ClearIoUringUserData un…
benaadams Feb 15, 2026
4320c66
Guard ClearIoUringUserData on untrack-mismatch to prevent cross-opera…
benaadams Feb 15, 2026
bce40f8
Prune io_uring telemetry to 8 core counters and add SocketEngineBacke…
benaadams Feb 15, 2026
e692ae6
Batch CQE drain loop with deferred CqHead publish and fix mid-batch e…
benaadams Feb 15, 2026
e79ef6f
Defer poll rearms to post-batch pass after CqHead publish
benaadams Feb 15, 2026
7c257db
Add IORING_SETUP_CQSIZE for 4x CQ capacity and pre-init SqArray
benaadams Feb 15, 2026
231a849
Add IORING_SETUP_SUBMIT_ALL with two-flag peel-based setup probe
benaadams Feb 15, 2026
f07b94e
O(1) request-ID unlink, skip duplicate lookups on 64-bit hot paths
benaadams Feb 15, 2026
77935cc
Dynamic registration bucket sizing and effective-queue-depth pool sca…
benaadams Feb 15, 2026
8401348
Raise completion bucket cap, targeted pool-return reset, fix registra…
benaadams Feb 15, 2026
8929ac6
Merge submit into idle-path io_uring_enter wait call
benaadams Feb 15, 2026
1e40e91
Reduce lock hold time: release across submit syscall, defer completio…
benaadams Feb 15, 2026
8ca39be
Narrow deferred completion to recvmsg-only, revert submit lock releas…
benaadams Feb 15, 2026
62a2e49
Merge PrepareIoUringConnectOperation into shared PrepareIoUringComple…
benaadams Feb 15, 2026
d7e805d
Hoist canRecordCompletions check, remove dead post-drain branch, drop…
benaadams Feb 15, 2026
7cee005
Replace redundant inner-loop bounds checks with asserts guarded by bu…
benaadams Feb 15, 2026
b24b69c
Remove redundant error-code filter from poll-rearm condition
benaadams Feb 15, 2026
c541474
Fast-gate forced-result test hooks and mark RestoreIoUringForcedCompl…
benaadams Feb 15, 2026
e1abe9e
Split FindRegistrationLocked into dedicated by-socket and by-request-…
benaadams Feb 15, 2026
91f1221
Cache PollEvents at registration time, remove hash mix for monotonic …
benaadams Feb 15, 2026
276140e
Coalesce duplicate poll-rearms within CQE drain batch via generation …
benaadams Feb 15, 2026
7e162d6
Skip SubmitIoUringPendingEntriesLocked call when PendingSubmissions i…
benaadams Feb 15, 2026
9e2f8ca
Extract io_uring engine from pal_networking.c into pal_io_uring.c
benaadams Feb 15, 2026
6b22245
Decompose CQE drain loop into focused helpers and fix Min macro CI error
benaadams Feb 15, 2026
3020b20
Restore lost socket functions from file split, extract shared socket …
benaadams Feb 15, 2026
e372594
Implement P4.1 single-writer submission queue: route cancellation thr…
benaadams Feb 15, 2026
7b18cf3
Use positive-form preprocessor guards for readability
benaadams Feb 15, 2026
87b33c6
Guard event-loop thread assert macros with HAVE_LINUX_IO_URING_SOCKET…
benaadams Feb 15, 2026
634817f
Replace memset with targeted field init in InitializeIoUringDrainBatc…
benaadams Feb 15, 2026
5823d46
Fix bugs #21-#23 and apply C# null-check style convention
benaadams Feb 15, 2026
6b91f1c
Skip no-op callback dispatch when connect-with-data callback ownershi…
benaadams Feb 15, 2026
6716e23
Add IORING_SETUP_SINGLE_ISSUER support and clear ConnectOperation Buf…
benaadams Feb 15, 2026
be6ffa3
Add IORING_SETUP_NO_SQARRAY support and fix peel-chain guard bug #25
benaadams Feb 15, 2026
2d59ee2
Add COOP_TASKRUN and DEFER_TASKRUN setup flags with local ABI enum
benaadams Feb 15, 2026
60b637e
Add IORING_REGISTER_RING_FD support to eliminate fget/fput on io_urin…
benaadams Feb 15, 2026
13203e3
Add SYS_io_uring_* fallback for syscall number portability
benaadams Feb 15, 2026
27c5384
Add local opcode/probe definitions and table-driven setup flag peel
benaadams Feb 15, 2026
45cff10
Add IORING_ENTER_EXT_ARG bounded wait and fix ETIME handling
benaadams Feb 15, 2026
41f4caf
Localize poll multishot and GETEVENTS constants, add DEFER_TASKRUN gate
benaadams Feb 15, 2026
9eaddda
Add registered file descriptors and fix register return value checks
benaadams Feb 15, 2026
592d682
Add registered-file hot cache, teardown skip, and resolve double lookup
benaadams Feb 15, 2026
d53fbfc
Fix ARM 32-bit build: move IO_URING_REGISTER_OFFSET_AUTO to #define
benaadams Feb 15, 2026
f4a57e9
Token-indexed slot array for O(1) completion lookup and fix rw_flags …
benaadams Feb 15, 2026
d458c8c
Remove unused HAVE_IO_URING_COMPLETION_OPERATION_STATE macro and reve…
benaadams Feb 15, 2026
1c8718a
Fix rw_flags sign conversion with __typeof__ cast for cross-header co…
benaadams Feb 15, 2026
41bda64
Use local variable for unsafe out-param and ThrowIfNegativeOrZero for…
benaadams Feb 15, 2026
8dbe2db
test diverge
benaadams Feb 15, 2026
5fbd3e2
Direct SQE writes from managed via mmap'd ring access and fix IoUring…
benaadams Feb 15, 2026
2efc1a0
M0: Native shim + managed interop foundation for io_uring migration
benaadams Feb 15, 2026
1677584
M1.1+M1.4: Managed kernel version check and opcode probe support
benaadams Feb 15, 2026
a2429d9
M1.2: Managed setup flag peel loop for io_uring initialization
benaadams Feb 15, 2026
ab0383a
M1.3: Managed ring mmap and pointer derivation
benaadams Feb 15, 2026
535afa8
M1.5: Wire managed io_uring init into engine startup
benaadams Feb 15, 2026
8590f74
M2.1: Managed CQE reading helpers
benaadams Feb 15, 2026
b6fb765
M2.2: Managed CQE dispatch loop with tag-based routing
benaadams Feb 16, 2026
a3b1ef8
M2.3: Replace native wait+drain with managed CQE drain path
benaadams Feb 16, 2026
6bfe09c
M7.1: Managed submit path and wakeup via io_uring_enter
benaadams Feb 16, 2026
167121f
M3.1: Managed socket registration tracking for poll dispatch
benaadams Feb 16, 2026
094df89
Wire DispatchManagedPollReadinessCqe into CQE drain loop
benaadams Feb 16, 2026
52dea49
M3.2+M3.3: Managed registration change protocol and poll SQE writes
benaadams Feb 16, 2026
cc47d39
M4.1: Managed completion slot array and free-list
benaadams Feb 16, 2026
e6976ef
M5.1: Managed registered-file table
benaadams Feb 16, 2026
d4afefd
Fix build errors: CA2020 checked conversions, IDE0074, CS0649/CA1823
benaadams Feb 16, 2026
bb32bd0
M4.2: Replace native slot allocation P/Invokes with managed alloc in …
benaadams Feb 16, 2026
14cd318
M4.3+M6.1+M6.2: Test hook forced-result injection and managed message…
benaadams Feb 16, 2026
33ec743
M8.1: Managed teardown orchestration for io_uring resources
benaadams Feb 16, 2026
ec31c20
M9.1+M9.2: Delete thick native io_uring code and remove dead managed …
benaadams Feb 16, 2026
b566e6d
Fix IDE0060: remove unused 'origin' parameter from TryQueueIoUringAsy…
benaadams Feb 16, 2026
823bbaf
Fix IDE0060: remove unused 'origin' parameter from DrainIoUringCancel…
benaadams Feb 16, 2026
3a666b7
Minimize native file changes: restore to main + only shim additions
benaadams Feb 16, 2026
38da487
Revert orphaned native changes from earlier io_uring branch work
benaadams Feb 16, 2026
476a94e
Remove dead WaitForSocketEventsAndCompletions and IoUringCompletion n…
benaadams Feb 16, 2026
6a6c365
Address API design review findings across io_uring managed code
benaadams Feb 16, 2026
9bd10c3
Check completion.UserData == 0 directly instead of casting to UIntPtr…
benaadams Feb 16, 2026
144a346
Replace UIntPtr with ulong for io_uring userData throughout managed code
benaadams Feb 16, 2026
d3de9f8
Add XML doc summaries to all undocumented io_uring types
benaadams Feb 16, 2026
1306a5e
Add XML doc summaries to all io_uring methods, properties, and enums
benaadams Feb 16, 2026
dfb733e
Add missing pal_errno.h include to pal_io_uring_shim.c
benaadams Feb 16, 2026
1897037
Retry eventfd read/write on EINTR in io_uring shim
benaadams Feb 16, 2026
2b5a5c5
Eliminate completion buffer and dual dispatch; pure completion mode f…
benaadams Feb 16, 2026
2e4f507
Rename managed init terminology to io_uring enabled; consolidate env var
benaadams Feb 16, 2026
4e288e1
Fix CI failures: emit fallback telemetry, null-safe reflection helper…
benaadams Feb 16, 2026
4df3564
Add SINGLE_ISSUER debug assertions and replace ConcurrentQueue with M…
benaadams Feb 16, 2026
3b907e6
Align MpscQueue padding with runtime PaddingHelpers conventions
benaadams Feb 16, 2026
25ecdd8
Add multishot recv feature detection and kernel version check infrast…
benaadams Feb 16, 2026
7cfd503
Add multishot recv SQE preparation and completion dispatch infrastruc…
benaadams Feb 16, 2026
294ab37
Add provided buffer ring infrastructure and multishot recv operation …
benaadams Feb 16, 2026
0ff46ca
Wire provided buffer completion materialization, one-shot buffer-sele…
benaadams Feb 16, 2026
ea054eb
Add multishot recv test scenarios for basic iteration, cancellation, …
benaadams Feb 16, 2026
b47c361
Rework multishot dispatch to inline processing with TryGet and deferr…
benaadams Feb 16, 2026
6caf220
Explicit switch on all multishot completion result variants with Debu…
benaadams Feb 16, 2026
bbcab6e
Rename unused client socket variable to _client in multishot cancella…
benaadams Feb 16, 2026
a5a1835
Validate eventfd short reads and writes in io_uring shim
benaadams Feb 16, 2026
85441e1
Fix ProcessCancellation skipping callback for ConnectOperation with p…
benaadams Feb 16, 2026
1020614
Fix raw errno to PAL error conversion and lost-wakeup race in io_urin…
benaadams Feb 16, 2026
1d47e97
Fix completion slot leak, CQ overflow detection, and harden io_uring …
benaadams Feb 16, 2026
2196f75
Fix CS1656 build error from assigning to using variable in multishot …
benaadams Feb 16, 2026
5195c37
Replace generic Padded<T> with non-generic padding structs in MpscQueue
benaadams Feb 16, 2026
bd80590
Add readiness fallback and slot exhaustion recovery for io_uring prep…
benaadams Feb 16, 2026
735e8ae
Add adaptive provided-buffer ring sizing for io_uring recv operations
benaadams Feb 16, 2026
5b95fa8
Assert event-loop thread for adaptive provided-buffer utilization tra…
benaadams Feb 16, 2026
5e7b32e
Add transitional multishot accept for io_uring on kernels >= 5.19
benaadams Feb 16, 2026
7c4c35d
Add persistent multishot recv for io_uring with early data buffering
benaadams Feb 16, 2026
de3a4fe
Add zero-copy send (SEND_ZC/SENDMSG_ZC) for io_uring on kernels >= 6.0
benaadams Feb 17, 2026
27693e6
Centralize zero-copy send eligibility policy and extract diagnostic l…
benaadams Feb 17, 2026
df8278f
Rename using variable discard to named listener in zero-copy send tests
benaadams Feb 17, 2026
b72eb31
Add registered buffers and fixed-buffer receive for io_uring
benaadams Feb 17, 2026
a9cd9bf
Add missing io_uring telemetry counter names to expected list in Tele…
benaadams Feb 17, 2026
495c91f
Consolidate buffer registration lifecycle and recycle patterns
benaadams Feb 17, 2026
3d1aec2
Merge provided-buffer and fixed-recv materialization into unified path
benaadams Feb 17, 2026
9809ce0
Guard io_uring_enter ext arg size on null check
benaadams Feb 17, 2026
ff4f1d9
Increase multishot accept queue capacity from 64 to 256
benaadams Feb 17, 2026
3273c01
Dispose accepted socket in SocketEngineBackendSelected telemetry test
benaadams Feb 17, 2026
e2290d0
Add SQPOLL support behind opt-in switch and normalize config to AppCo…
benaadams Feb 17, 2026
85e8b5f
Address review findings: harden multishot lifecycle, reduce config su…
benaadams Feb 17, 2026
2713900
Remove hardcoded ErrnoEAGAIN in favor of PAL conversion and guard Ass…
benaadams Feb 17, 2026
a233663
Remove redundant #if DEBUG from AssertSingleThreadAccess; [Conditiona…
benaadams Feb 17, 2026
f7b0367
Skip SQPOLL fallback test gracefully when io_uring port is unavailable
benaadams Feb 17, 2026
fb6a5c7
Simplify io_uring kernel gating to a single 6.1 cutoff and remove cus…
benaadams Feb 17, 2026
fbc4ba9
Guard io_uring test-only environment variables with #if DEBUG consist…
benaadams Feb 18, 2026
ba22533
Make multishot accept one-shot fallback test deterministic via reflec…
benaadams Feb 18, 2026
e63c4df
Remove poll-readiness test helpers and update SQPOLL test for static …
benaadams Feb 18, 2026
092ad8a
Remove poll-readiness engine code, apply NativeMsghdr explicit layout…
benaadams Feb 18, 2026
839b2b6
Widen generation field to 43 bits, drain CQ before SQ retry, fix regi…
benaadams Feb 18, 2026
cb750b0
Add CQ overflow recovery scaffolding and fix partial-submit accounting
benaadams Feb 18, 2026
6d58512
Implement CQ overflow recovery branch actions and add five-test overf…
benaadams Feb 18, 2026
66d6abb
Add NativeMsghdr layout contract test verifying explicit field offset…
benaadams Feb 18, 2026
6618a07
Apply explicit 32-byte IoUringCompletionSlot layout with packed state…
benaadams Feb 18, 2026
0769ca3
Unify completion slot and storage arrays into IoUringCompletionEntry …
benaadams Feb 18, 2026
8a193bb
Extract completion entry reflection field names into shared constants
benaadams Feb 18, 2026
d960321
Avoid Nullable wrapper for SocketEventHandler struct in SQE retry dra…
benaadams Feb 18, 2026
ba985b2
Replace SQPOLL static disable with JIT-eliminable FeatureSwitchDefini…
benaadams Feb 18, 2026
7cdb5d0
Guard ErrnoECANCELED constant with #if DEBUG to match its only consumers
benaadams Feb 18, 2026
f86468d
Fix lost wakeup race, eliminate completion lambda allocation, harden …
benaadams Feb 18, 2026
b49e231
Fix SEND_ZC NOTIF slot leak on teardown, add pending-notification gau…
benaadams Feb 18, 2026
8fdef39
Apply review findings: merge dual tracking, eliminate virtual dispatc…
benaadams Feb 18, 2026
b67acad
Merge tracked-operation fields into slot storage, standardize config …
benaadams Feb 18, 2026
f93027d
Fix tracked-operation generation reset to use merged slot storage field
benaadams Feb 18, 2026
f3031f7
Replace linear accept slot scan with O(1) counter, rebalance slot lif…
benaadams Feb 18, 2026
fc990e6
Document config precedence, fix cancellation retry spin, add contradi…
benaadams Feb 18, 2026
ed9e5ce
Fix MPSC dequeue ordering, add CLOEXEC setup flag, precompute dispatc…
benaadams Feb 18, 2026
a0187d7
Add IORING_SETUP_CLOEXEC static assert, ring fd CLOEXEC verification …
benaadams Feb 18, 2026
92c13ae
Strengthen provided-buffer resize quiescence check, add adaptive sizi…
benaadams Feb 18, 2026
be81ea7
Add ARM64 MPSC and generation-transition stress tests, concurrent res…
benaadams Feb 18, 2026
c320926
Replace reflection-based test access with InternalsVisibleTo and stro…
benaadams Feb 18, 2026
decfe0d
Move dispatch kind enum to shared Unix partial for cross-TFM compilat…
benaadams Feb 18, 2026
2d65562
fix trimming
benaadams Feb 18, 2026
c655ede
Replace InternalsVisibleTo with centralized reflection shim in test p…
benaadams Feb 18, 2026
ee9fdde
Update SocketAsyncEngine.IoUringTestAccessors.Linux.cs
benaadams Feb 18, 2026
982e478
Harden reflection shim for trimmer/AOT with DynamicDependency annotat…
benaadams Feb 19, 2026
32adeca
Fix silent hang in ConnectOperation when connect-with-data fails
benaadams Feb 19, 2026
f6abf41
Move DynamicDependency attributes from class declarations to construc…
benaadams Feb 19, 2026
4549b7b
Fix SEND_ZC reattach CAS, ARM64 generation store ordering, and inline…
benaadams Feb 19, 2026
e783044
Initialize out parameters in io_uring shim stubs when io_uring is una…
benaadams Feb 19, 2026
b96a121
Batch review fixes: POH buffers, CQ head batching, teardown safety, a…
benaadams Feb 19, 2026
7772a5a
Skip io_uring test class on Mono runtime
benaadams Feb 19, 2026
80c3723
Defensive hardening, native shim guards, SQPOLL telemetry, and docume…
benaadams Feb 19, 2026
2ee06e9
Perf optimizations: SQE zeroing, pre-encoded user_data, cached thread…
benaadams Feb 19, 2026
97938fe
Buffer ring bitset search, deferred tail publish, packed multishot ac…
benaadams Feb 19, 2026
51951b2
Extract partial classes, sweep stale tracked ops after CQ overflow, r…
benaadams Feb 19, 2026
47b6f59
Formatting
benaadams Feb 19, 2026
5e0b124
Make provided-buffer test exhaustion/recycle helpers static
benaadams Feb 19, 2026
c95353e
Unwrap TargetInvocationException in MpscQueue reflection shim constru…
benaadams Feb 19, 2026
dc8ed8f
Use do-while for SpinWait retry loops to guarantee at least one itera…
benaadams Feb 19, 2026
74ce6e8
SOCK_CLOEXEC on accept, EPERM graceful drain, SEND_ZC recovery, telem…
benaadams Feb 19, 2026
d313604
MpscQueue bounded retry and co-located entries, SQE writer collapse, …
benaadams Feb 19, 2026
d66bb64
Per-engine counters, ManagedRingState struct, TrackedOperationState S…
benaadams Feb 19, 2026
cccc6ce
Use IThreadPoolWorkItem for cancellation callback worker to avoid del…
benaadams Feb 19, 2026
0551311
Move io_uring test hooks and accessors from src/ to test project with…
benaadams Feb 19, 2026
ead115c
Defer io_uring initialization to event loop thread for DEFER_TASKRUN …
benaadams Feb 19, 2026
0e3c3b5
Use IORING_SETUP_R_DISABLED to defer submitter_task, drain all non-EF…
benaadams Feb 19, 2026
e3f1b71
MpscQueue incarnation guard to prevent fast-path use-after-recycle on…
benaadams Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ internal static partial class Fcntl
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError = true)]
internal static partial int SetFD(SafeHandle fd, int flags);

[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError = true)]
internal static partial int SetFD(IntPtr fd, int flags);

[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError = true)]
internal static partial int GetFD(SafeHandle fd);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class Sys
{
/// <summary>Wraps io_uring_setup(2): creates an io_uring instance.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimSetup")]
internal static unsafe partial Error IoUringShimSetup(
uint entries, void* parms, int* ringFd);

/// <summary>Wraps io_uring_enter(2): submits SQEs and/or waits for CQEs.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimEnter")]
internal static unsafe partial Error IoUringShimEnter(
int ringFd, uint toSubmit, uint minComplete, uint flags, int* result);

/// <summary>Wraps io_uring_enter2(2) with IORING_ENTER_EXT_ARG for bounded waits.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimEnterExt")]
internal static unsafe partial Error IoUringShimEnterExt(
int ringFd, uint toSubmit, uint minComplete, uint flags, void* arg, int* result);

/// <summary>Wraps io_uring_register(2): registers resources (files, buffers, ring fds).</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimRegister")]
internal static unsafe partial Error IoUringShimRegister(
int ringFd, uint opcode, void* arg, uint nrArgs, int* result);

/// <summary>Wraps mmap(2): maps io_uring SQ/CQ ring memory.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimMmap")]
internal static unsafe partial Error IoUringShimMmap(
int ringFd, ulong size, ulong offset, void** mappedPtr);

/// <summary>Wraps munmap(2): unmaps io_uring ring memory.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimMunmap")]
internal static unsafe partial Error IoUringShimMunmap(
void* addr, ulong size);

/// <summary>Creates an eventfd for io_uring wakeup signaling.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimCreateEventFd")]
internal static unsafe partial Error IoUringShimCreateEventFd(
int* eventFd);

/// <summary>Writes to an eventfd to wake the io_uring event loop.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimWriteEventFd")]
internal static partial Error IoUringShimWriteEventFd(int eventFd);

/// <summary>Reads from an eventfd to consume a wakeup signal.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimReadEventFd")]
internal static unsafe partial Error IoUringShimReadEventFd(
int eventFd, ulong* value);

/// <summary>Wraps close(2): closes a file descriptor.</summary>
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IoUringShimCloseFd")]
internal static partial Error IoUringShimCloseFd(int fd);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Net.Sockets;
using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class Sys
{
/// <summary>Derived SQ ring state computed after mmap, used by the managed submission path.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct IoUringSqRingInfo
{
public IntPtr SqeBase;
public IntPtr SqTailPtr;
public IntPtr SqHeadPtr;
public uint SqMask;
public uint SqEntries;
public uint SqeSize;
public byte UsesNoSqArray;
public int RingFd;
public int RegisteredRingFd;
public byte UsesEnterExtArg;
public byte UsesRegisteredFiles;
}

/// <summary>Mirrors kernel <c>struct io_sqring_offsets</c> (40 bytes). Fields at offset 28+ (resv1, user_addr) are unused.</summary>
[StructLayout(LayoutKind.Explicit, Size = 40)]
internal struct IoUringSqOffsets
{
[FieldOffset(0)] public uint Head;
[FieldOffset(4)] public uint Tail;
[FieldOffset(8)] public uint RingMask;
[FieldOffset(12)] public uint RingEntries;
[FieldOffset(16)] public uint Flags;
[FieldOffset(20)] public uint Dropped;
[FieldOffset(24)] public uint Array;
// resv1 at 28, user_addr at 32 - not needed by managed code
}

/// <summary>Mirrors kernel <c>struct io_cqring_offsets</c> (40 bytes). Fields at offset 28+ (resv1, user_addr) are unused.</summary>
[StructLayout(LayoutKind.Explicit, Size = 40)]
internal struct IoUringCqOffsets
{
[FieldOffset(0)] public uint Head;
[FieldOffset(4)] public uint Tail;
[FieldOffset(8)] public uint RingMask;
[FieldOffset(12)] public uint RingEntries;
[FieldOffset(16)] public uint Overflow;
[FieldOffset(20)] public uint Cqes;
[FieldOffset(24)] public uint Flags;
// resv1 at 28, user_addr at 32 - not needed by managed code
}

/// <summary>Mirrors kernel <c>struct io_uring_params</c> (120 bytes), passed to io_uring_setup.</summary>
[StructLayout(LayoutKind.Explicit, Size = 120)]
internal struct IoUringParams
{
[FieldOffset(0)] public uint SqEntries;
[FieldOffset(4)] public uint CqEntries;
[FieldOffset(8)] public uint Flags;
[FieldOffset(12)] public uint SqThreadCpu;
[FieldOffset(16)] public uint SqThreadIdle;
[FieldOffset(20)] public uint Features;
[FieldOffset(24)] public uint WqFd;
// resv[3] at 28-39
[FieldOffset(40)] public IoUringSqOffsets SqOff;
[FieldOffset(80)] public IoUringCqOffsets CqOff;
}

/// <summary>Mirrors kernel <c>struct io_uring_cqe</c> (16 bytes), read from the CQ ring.</summary>
[StructLayout(LayoutKind.Explicit, Size = 16)]
internal struct IoUringCqe
{
[FieldOffset(0)] public ulong UserData;
[FieldOffset(8)] public int Result;
[FieldOffset(12)] public uint Flags;
}

/// <summary>Mirrors kernel <c>struct io_uring_buf</c> (16 bytes), used by provided-buffer rings.</summary>
[StructLayout(LayoutKind.Explicit, Size = 16)]
internal struct IoUringBuf
{
[FieldOffset(0)] public ulong Address;
[FieldOffset(8)] public uint Length;
[FieldOffset(12)] public ushort BufferId;
[FieldOffset(14)] public ushort Reserved;
}

/// <summary>
/// Mirrors the header overlay of kernel <c>struct io_uring_buf_ring</c> (16 bytes).
/// In UAPI this shares offset 0 with the first <c>io_uring_buf</c> entry via a union.
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 16)]
internal struct IoUringBufRingHeader
{
[FieldOffset(0)] public ulong Reserved1;
[FieldOffset(8)] public uint Reserved2;
[FieldOffset(12)] public ushort Reserved3;
[FieldOffset(14)] public ushort Tail;
}

/// <summary>Mirrors kernel <c>struct io_uring_buf_reg</c> (40 bytes), used for pbuf ring registration.</summary>
[StructLayout(LayoutKind.Explicit, Size = 40)]
internal struct IoUringBufReg
{
[FieldOffset(0)] public ulong RingAddress;
[FieldOffset(8)] public uint RingEntries;
[FieldOffset(12)] public ushort BufferGroupId;
[FieldOffset(14)] public ushort Padding;
[FieldOffset(16)] public ulong Reserved0;
[FieldOffset(24)] public ulong Reserved1;
[FieldOffset(32)] public ulong Reserved2;
}

/// <summary>Derived CQ ring state computed after mmap, used by the managed completion drain path.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct IoUringCqRingInfo
{
public IntPtr CqeBase; // io_uring_cqe* base of CQE array
public IntPtr CqTailPtr; // uint32_t* kernel writes CQ tail
public IntPtr CqHeadPtr; // uint32_t* managed advances CQ head
public uint CqMask; // CqEntries - 1
public uint CqEntries; // number of CQ slots
public uint CqeSize; // sizeof(io_uring_cqe) = 16
public IntPtr CqOverflowPtr; // uint32_t* kernel CQ overflow counter
}

/// <summary>Mirrors kernel <c>struct io_uring_getevents_arg</c>, used with IORING_ENTER_EXT_ARG.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct IoUringGeteventsArg
{
public ulong Sigmask;
public uint SigmaskSize;
public uint MinWaitUsec;
public ulong Ts;
}

/// <summary>Mirrors kernel <c>struct __kernel_timespec</c>, used for io_uring timeout arguments.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct IoUringKernelTimespec
{
public long TvSec;
public long TvNsec;
}

}
}
25 changes: 25 additions & 0 deletions src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,34 @@

<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix' or '$(TargetPlatformIdentifier)' == 'osx' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos'">
<Compile Include="System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs"/>
<Compile Include="System\Net\Sockets\SocketAsyncEngine.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringConfiguration.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringSqeWriters.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringCompletionDispatch.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringSlots.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringRings.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringDiagnostics.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="..\tests\FunctionalTests\IoUringTestInfrastructure\SocketAsyncEngine.IoUringTestHooks.Linux.cs"
Link="System\Net\Sockets\SocketAsyncEngine.IoUringTestHooks.Linux.cs"
Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux' and '$(Configuration)' == 'Debug'" />
<Compile Include="..\tests\FunctionalTests\IoUringTestInfrastructure\SocketAsyncEngine.IoUringTestAccessors.Linux.cs"
Link="System\Net\Sockets\SocketAsyncEngine.IoUringTestAccessors.Linux.cs"
Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux' and '$(Configuration)' == 'Debug'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.IoUringTestHooks.Stubs.Linux.cs"
Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux' and '$(Configuration)' != 'Debug'" />
<Compile Include="System\Net\Sockets\MpscQueue.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\IoUringProvidedBufferRing.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketPal.IoUring.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncContext.IoUring.Linux.cs" Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="System\Net\Sockets\SocketAsyncEngine.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketEvent.cs"
Link="Common\Interop\Unix\System.Native\Interop.SocketEvent.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketEvent.Linux.cs"
Link="Common\Interop\Unix\System.Native\Interop.SocketEvent.Linux.cs"
Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.IoUringShim.cs"
Link="Common\Interop\Unix\System.Native\Interop.IoUringShim.cs"
Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(TargetOS)' == 'linux'" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix' or '$(TargetPlatformIdentifier)' == 'wasi' or '$(TargetPlatformIdentifier)' == 'osx' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos'">
Expand Down
Loading
Loading