#287 - Batch UDP socket receives and honor RX queue affinity - #280
Merged
Conversation
dleshchev
marked this pull request as ready for review
September 4, 2026 01:57
Contributor
|
| Filename | Overview |
|---|---|
| src/engines/socket/daqiri_socket_engine.cpp | Implements UDP batching, receive-thread affinity startup synchronization, configured-peer filtering, and safe single-packet fallback for dynamic peers. |
| src/engines/socket/daqiri_socket_engine.h | Adds endpoint state for UDP batching, receive affinity, configured-peer tracking, and thread-start synchronization. |
| examples/run_spark_bench.sh | Separates benchmark-worker and UDP I/O affinity controls and records observed burst and CPU-placement data. |
| scripts/gen_spark_netns_config.py | Adds structured queue batch and affinity overrides when generating per-role benchmark configurations. |
| examples/socket_bench.cpp | Records the maximum observed receive-burst size while preserving burst cleanup. |
| docs/api-reference/configuration.md | Documents UDP batching limits, RX affinity semantics, and configured versus dynamic server peers. |
Reviews (4): Last reviewed commit: "#287 - Correct UDP benchmark metadata" | Re-trigger Greptile
Coalesce the datagrams returned by one recvmmsg call into one DAQIRI receive burst before handing it to the application queue. The affinity experiment is intentionally excluded; this change only reduces per-datagram metadata allocation and queue handoff overhead. Signed-off-by: Denis Leshchev <dleshchev@nvidia.com>
Signed-off-by: Denis Leshchev <dleshchev@nvidia.com>
Signed-off-by: Denis Leshchev <dleshchev@nvidia.com>
dleshchev
force-pushed
the
fix/udp-socket-rx-batching
branch
from
September 4, 2026 15:43
06ddfcc to
589f97c
Compare
Signed-off-by: Denis Leshchev <dleshchev@nvidia.com>
cliffburdick
approved these changes
Sep 4, 2026
RamyaGuru
approved these changes
Sep 4, 2026
Signed-off-by: Denis Leshchev <dleshchev@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #287
Summary
recvmmsg()call into one DAQIRIreceive burst.
rx.queues[].batch_sizeselects a maximum of 1-32 datagrams,and
MSG_WAITFORONEreturns partial batches without waiting for all slots.rx.queues[].cpu_corefor the UDP receive I/O thread. Initializationfails if the requested affinity cannot be applied instead of continuing
unpinned.
socket_config.remote_addr. DAQIRI connects that socket to the configuredpeer, so other sources cannot claim the endpoint. For compatibility, servers
without
remote_addrretain single-active-peer behavior and are limited toone datagram per receive burst.
server RX queue now matches the batch recorded in the artifact name and CSV,
and
SOCKET_RX_IO_COREScan place UDP receive threads independently.core IDs in benchmark CSVs. Multi-pair socket CPU percentages are explicitly
pair-0 samples.
Validation
DAQIRI_ENGINE="dpdk ibverbs", examples,and Python bindings enabled.
and 1,024,000 bytes sent and received in each direction. The final focused
run observed
max_rx_burst=12, proving that a returned application burst heldmore than one datagram.
traffic: the configured server received zero packets from that source.
remote_addr: emitted the batch-size fallbackwarning and completed exactly 1,000 packets in each direction.
daqiri_initto fail, confirming affinityfailures are not silently ignored.
core, and benchmark-worker overrides.
clang-format,git diff --check,bash -n, Python syntax checks, andscripts/check_doc_refs.pypass.30-second paced TX, 70-second RX lifetime, and three repetitions per point.
With batching and explicit UDP I/O placement, all three repetitions were
counter-clean at 27.5 Gb/s with one RX worker, 40 Gb/s with two, and 75 Gb/s
with four. PHY TX/RX deltas matched;
NoPorts,RcvbufErrors, and NICreceive-buffer counters were flat.
maincommit263f4b5c3aedf25698c6404309fac6158359b6ef,with the same benchmark-worker topology but no batching or UDP I/O affinity,
those points were clean in 0/3, 2/3, and 0/3 runs respectively. Loss was
primarily accounted for by receiver
RcvbufErrors; four-worker runs alsorecorded NIC receive-buffer drops.
The physical throughput matrix was not rerun after the configured-peer or
benchmark-reporting follow-ups. Those earlier artifacts therefore do not contain
the new configured/observed batch and CPU-core columns.
Scope
This PR covers UDP receive batching, socket I/O-thread placement through the
existing RX queue configuration, deterministic point-to-point server peer
selection, and the benchmark/reporting changes needed to reproduce and audit
those settings. It does not add general multi-client UDP server support or
change receive-buffer sizing.