util/ipc: Add AsyncChannelTransport, the kernel side of the service seam - #497
Merged
chrysh merged 1 commit intoSep 25, 2026
Merged
Conversation
chrysh
force-pushed
the
async-channel-transport
branch
2 times, most recently
from
September 25, 2026 13:33
c766437 to
f831a93
Compare
AsyncTransaction lends the kernel 'static buffers, which a caller holding an ordinary &[u8] request cannot satisfy. AsyncChannelTransport owns that pair, copies each request in and each response out, and implements util_service::AsyncTransport so every service shares one client seam instead of writing its own. Buffer sizes are the wiring's choice: a request longer than the send buffer, or a response longer than the caller's, is TooLarge rather than a truncated frame. Every failure path re-stows the buffers the transaction hands back, so the transport is idle again and the next call is start. The QEMU test covers the round-trip, a request that does not fit, cancel then reuse, and the not-ready-then-ready sequence that a loopback cannot produce because its response is always ready on the first poll. Assisted-by: Claude Opus 5
chrysh
force-pushed
the
async-channel-transport
branch
from
September 25, 2026 13:43
f831a93 to
671064e
Compare
chrysh
marked this pull request as ready for review
September 25, 2026 13:44
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.
The client seam from #464 made real: "every cross-process request goes through ServiceCall, and no process ever blocks on another."
AsyncTransactionlends the kernel'staticbuffers for the life of a transaction, which a caller holding an ordinary&[u8]request cannot satisfy.AsyncChannelTransportowns that pair, copies each request in and each response out, and implementsutil_service::AsyncTransport. One type, every service: registeras_raw()with a WaitGroup,starta request,pollonce per wake.Buffer sizes are the wiring's choice. A request longer than the send buffer, or a response longer than the caller's, is
TooLargerather than a truncated frame. Every failure path re-stows the buffers the transaction hands back, so the transport returns to idle and the next call isstart.One change to the layer below, in the first commit:
AsyncTransaction::startnow takes the request length. The kernel transmitted the whole send buffer, so a transport sized for its largest request also sent the slack behind a short one, and a transport that owns one&'static mutbuffer cannot express the subslice any other way.The QEMU test covers the round-trip, a request that does not fit, cancel then reuse, and the not-ready-then-ready sequence. That last one is the case #484 called out as untestable against a loopback, whose response is always ready on the first poll.
Not in here: the generic
Loopback<D: Dispatch>, the blockingChannelTransport(nothing on the #464 path blocks), and the typed PLDM client. Those follow, then the i2c and pldm migrations onto the shared seam.Review the last commit only; below it are #482 and #485.
Progress toward 9elements#13.