Skip to content

pldm: Add IPC API crate (wire format, types, transport seam) - #483

Draft
chrysh wants to merge 1 commit into
OpenPRoT:ocp-global-demo-wipfrom
9elements:pldm-ipc-api
Draft

chrysh wants to merge 1 commit into
OpenPRoT:ocp-global-demo-wipfrom
9elements:pldm-ipc-api

Conversation

@chrysh

@chrysh chrysh commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Shared types and wire protocol for the orchestrator-to-FD IPC channel.
Both the server (FD side) and client (orchestrator side) crates will
depend on this for opcodes, headers, status encoding, error types, and
the Transport trait. Same split as services/i2c/api and services/mctp/api.

Twelve operations covering the full DSP0267 update lifecycle. Fixed
8-byte headers for request and response with manual byte encoding
(no zerocopy, no_std). The FdStatus enum carries the FD's current
condition as a QueryStatus response payload, including the SVN delayed
flag from the UA's UpdateComponent request.

Rebased onto #479 (util-ipc-abstraction). Review the last commit only;
everything below it is #479. #484 stacks the server crate on top.

Transport is split-phase (start/poll/cancel) rather than one blocking
round-trip, because the orchestrator client runs in the event loop and
must not block. In production it is backed by util/ipc's
AsyncTransaction. This is where the seam differs from i2c and mctp,
whose transports are still blocking.

Three deviations from the design doc on PR #464:

  • Response header: the doc's diagram adds to 6 bytes but the prose
    says "Fixed 8-byte header." Padded to 8 with 2 reserved bytes.
    The doc diagram should be updated to match.
  • gen renamed to generation because gen is a reserved keyword
    in Rust 2024 edition.
  • All four Deny* ops carry a DenyReason byte for uniform decoding.
    The doc pins DenySvnCommit to PolicyViolation, but sending the
    reason on the wire keeps the server dispatch identical.

Host-buildable, no kernel dependencies. All encode/decode paths have
roundtrip tests.

Part of #464.

Assisted-by: Claude Code

@chrysh
chrysh changed the base branch from main to ocp-global-demo-wip September 24, 2026 21:11
@chrysh
chrysh force-pushed the pldm-ipc-api branch 2 times, most recently from b6e1f60 to f8a7249 Compare September 25, 2026 08:27
Defines the binary protocol the orchestrator uses to talk to the PLDM
Firmware Device over IPC. Twelve operations covering the full update
lifecycle: offer accept/reject, verify/apply grant/deny, activation,
SVN commit, cancel ack, and status query.

Wire format: fixed 8-byte headers for both request and response, with
manual byte encoding (no zerocopy dep) for no_std compatibility. The
doc's response diagram adds to 6 bytes; the prose says "Fixed 8-byte
header," so we pad 2 reserved bytes to match the stated intent. The
doc field `gen` is renamed to `generation` because `gen` is a reserved
keyword in Rust 2024 edition.

All four Deny* ops carry a DenyReason byte for uniformity (the doc
pins DenySvnCommit to PolicyViolation, but sending the reason on the
wire keeps the decode path identical to the other denials).

The FdStatus enum encodes the FD's current condition as a QueryStatus
response payload, covering all DSP0267 states plus pending decisions.
OfferPending carries target, total, transfer mode, and the SVN delayed
flag from the UA's UpdateComponent request, so the orchestrator can
validate against the floor.

The Transport trait is the seam the client crate will be generic over,
split into start/poll/cancel rather than one blocking round-trip: the
orchestrator client runs in the event loop, which must not block. In
production it is backed by util/ipc's AsyncTransaction; host tests use
LoopbackTransport.

Host-buildable with no kernel dependencies. All encode/decode paths
have roundtrip tests.

Assisted-by: Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant