io_uring: thread cqe->flags through CompletionCb#44667
Draft
aburan28 wants to merge 1 commit intoenvoyproxy:mainfrom
Draft
io_uring: thread cqe->flags through CompletionCb#44667aburan28 wants to merge 1 commit intoenvoyproxy:mainfrom
aburan28 wants to merge 1 commit intoenvoyproxy:mainfrom
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
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.
Summary
No-behavior-change refactor in preparation for multishot recv support.
CompletionCbgains auint32_t flagsargument carrying the rawcqe->flagsvalue from the kernel. The worker callback ignores it for now.A follow-up change will introduce a buf-ring +
prepareRecvMultishotand start observing:IORING_CQE_F_BUFFER— a buffer was selected from a buf-ring; the buffer ID is in the upper bits.IORING_CQE_F_MORE— the SQE will produce further completions.Injected completions are defined to always carry
flags == 0.Why split this out
The full multishot-recv change touches the buf-ring lifecycle in
IoUringImpl, the read path inIoUringServerSocket, 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.What changed
envoy/common/io/io_uring.h—CompletionCbtypedef + doc.source/common/io/io_uring_impl.cc— passcqe->flagsfor kernel completions,0for injected.source/common/io/io_uring_worker_impl.cc— accept the new arg in the worker 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.Test plan
io_uringunit tests pass on Linux CI.io_uringintegration tests pass on Linux CI.