pldm: Add the IPC client crate - #510
Merged
Merged
Conversation
chrysh
force-pushed
the
pldm-ipc-client
branch
from
September 27, 2026 07:16
06c3dae to
863dbcb
Compare
This was referenced Sep 27, 2026
chrysh
force-pushed
the
pldm-ipc-client
branch
from
September 29, 2026 13:55
863dbcb to
402c42d
Compare
FdIpcServer and FdIpcHandler, matching FlashIpcServer and the client on the other end. Fd says which peer, Ipc says which channel: the FD also answers the update agent over MCTP, and that side is not this one. Assisted-by: Claude
chrysh
force-pushed
the
pldm-ipc-client
branch
2 times, most recently
from
September 29, 2026 14:40
86ad45a to
9695b78
Compare
The FD stores a grant until the UA asks to activate, so a later deny has something to take back. The doc only named the refusal case. Assisted-by: Claude
chrysh
force-pushed
the
pldm-ipc-client
branch
from
September 30, 2026 09:22
9695b78 to
7d113b1
Compare
One typed method per operation the firmware device answers, each encoding a request and starting a round-trip, with the reply collected by poll(). Split-phase because the orchestrator runs the same loop it supervises boots on, and the FD answers on its own schedule: it shares its loop with MCTP traffic from the update agent. The client records what it asked. The response frame carries a code and a payload but not the opcode it answers, so the pending operation is what says whether the payload is a status. One round-trip at a time, which the transport already enforces. Refusals come back as ClientError::Refused with the FD's code: a decision by the device, not a fault in the channel, and it ends the round-trip like any other answer. WireError gains a core::error::Error impl so it can be the source of a client error. Assisted-by: Claude
It was put there for the orchestrator's client layer, which now reports a refusal as ClientError::Refused carrying the same ResponseCode. Nothing wrapped it. Assisted-by: Claude
chrysh
force-pushed
the
pldm-ipc-client
branch
from
September 30, 2026 09:35
7d113b1 to
3d978de
Compare
chrysh
marked this pull request as ready for review
September 30, 2026 09:36
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.
TL;DR: Add the API that makes the orchestrator give out grants through the interface PldmOps.
Independent of the update-pump stack: the new code is one crate, based directly on
ocp-global-demo-wip. It also edits five files that already exist (services/pldm/api/src/{error,lib,wire}.rs,services/pldm/server/src/lib.rsanddocs/src/design/ipc-service-stack.md), none of which #504-#513 touch.FdIpcClient<T: AsyncTransport>is the orchestrator's side of the PLDM IPC channel, one typed method per operation the firmware device answers. Each encodes a request and starts a round-trip;poll()collects the reply. Split-phase because the orchestrator runs the same loop it supervises boots on, and the FD answers on its own schedule: it shares its loop with MCTP traffic from the update agent.The client records what it asked. The response frame carries a code and a payload but not the opcode it answers, so the pending operation is what says whether the payload is a status. One round-trip at a time, which the transport already enforces.
A refusal comes back as
ClientError::Refusedwith the FD's code: the device's decision, not a fault in the channel, and it ends the round-trip like any other answer. That is the jobPldmIpcErrorwas written for and nothing ever wrapped it, so the last commit drops it.14 host tests over
util_service::Loopbackagainst the realFdIpcServer, so the same encode and decode paths are exercised end to end with no kernel. One usesDelayedfor the not-ready path, which the loopback alone cannot reach: that was the open coverage gap from the #482 review. Three stub transports cover what the loopback cannot produce either: a poll that fails, a frame too short to decode, and a cancel the channel refuses. Each one ends the round-trip and leaves the client free to send again.WireErrorgains acore::error::Errorimpl so it can be thesource()of a client error.A grant's reply is
Reply::Acked: the FD took the request, not a verdict on the work it starts.QueryStatusis what reports how that went.Commits:
FdServerandFdHandlertoFdIpcServerandFdIpcHandler, matchingFlashIpcServerand the client this PR adds.DenyActivaterevokes a stored grant, which the op doc left out.PldmIpcError.Next on this seam: wiring the client into the orchestrator event loop, where the FD's
QueryStatusphases meet the update pump.