io_uring: thread cqe->flags through CompletionCb#44667
Open
aburan28 wants to merge 1 commit into
Open
Conversation
This is a no-behavior-change preparation step for multishot recv. The ``CompletionCb`` callback type now takes a ``uint32_t flags`` argument that carries the raw ``cqe->flags`` value from the kernel. For multishot completions a follow-up change will inspect: * ``IORING_CQE_F_BUFFER`` — a buffer was selected from a buf-ring; the buffer ID is encoded in the upper bits. * ``IORING_CQE_F_MORE`` — the SQE will produce further completions. The worker callback ignores ``flags`` for now. Injected completions are defined to always carry ``flags == 0``. All ``forEveryCompletion`` callers (worker, impl tests) updated. ``IoUringSocket::on*`` virtual methods are intentionally unchanged in this commit; only ``onRead`` will need flags, in the multishot recv change. Signed-off-by: Adam Buran <a.buran28@gmail.com> Signed-off-by: Adam Buran <aburan28@gmail.com>
|
Hi @aburan28, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
This was referenced Apr 27, 2026
Member
|
Please add the fields from the pull request template to your PR description and review CONTRIBUTING.md, especially the section on AI use. |
Member
|
/wait |
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.
Commit Message:
io_uring: thread cqe->flags through CompletionCb
No-behavior-change refactor in preparation for multishot recv.
CompletionCbgains a
uint32_t flagsargument carrying the rawcqe->flagsvalue from thekernel. Kernel completions forward
cqe->flags; injected completions pass0.The worker callback ignores it for now. A follow-up will introduce a buf-ring
plus
prepareRecvMultishotand start observingIORING_CQE_F_BUFFERandIORING_CQE_F_MORE.Additional Description:
The full multishot-recv change touches the buf-ring lifecycle in
IoUringImpl,the read path in
IoUringServerSocket, and the proto config. Threadingflagsthrough the existing callback is mechanical and easy to review on its own;
landing it first lets the rest of the stack be a behavioral change rather than
a behavioral + signature change.
Files touched:
envoy/common/io/io_uring.h—CompletionCbtypedef + doc.source/common/io/io_uring_impl.cc— passcqe->flagsfor kernelcompletions,
0for injected.source/common/io/io_uring_worker_impl.cc— accept the new arg in theworker lambda (unused for now).
test/common/io/io_uring_impl_test.cc,test/common/io/io_uring_worker_impl_test.cc— update test lambdas.IoUringSocket::on*virtual methods are intentionally unchanged here; onlyonReadwill need flags, in the multishot recv change.AI usage disclosure: Portions of the code and/or PR description were drafted
with the assistance of Claude (Anthropic). I reviewed and understand all
submitted code.
Risk Level: Low
(No behavior change; mechanical signature change to an internal callback.
Worker still discards the new argument.)
Testing: Existing
io_uringunit and integration tests on Linux CI.Docs Changes: N/A
Release Notes: N/A (internal refactor, no user-visible or extension-developer-
visible change.)
Platform Specific Features: N/A. io_uring is Linux-only and the affected code
already lives behind the existing io_uring build gating; this PR does not
change platform support or introduce new platform-specific surface.
Runtime guard: N/A (no behavioral change).