Skip to content

pldm: Add the pldm-notify IPC channel (PoC) - #457

Draft
chrysh wants to merge 4 commits into
OpenPRoT:mainfrom
9elements:pldm-update-request-ipc
Draft

pldm: Add the pldm-notify IPC channel (PoC)#457
chrysh wants to merge 4 commits into
OpenPRoT:mainfrom
9elements:pldm-update-request-ipc

Conversation

@chrysh

@chrysh chrysh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wire protocol (services/pldm/notify-api) for PLDM-to-orchestrator notifications. One opcode today (UpdateRequested), two responses (Accepted, Rejected) so the orchestrator can veto before the FD accepts the UA's request.
  • Orchestrator adapter (services/orchestrator/adapters/pldm) translates wire vocabulary to orchestrator-side Notification and encodes the caller's accept/reject verdict.
  • QEMU integration test (target/ast10x0/tests/pldm_notify) wires two pw_kernel processes on a real channel, always accepting for the PoC.
  • Host test counter in firmware_update_host.rs tracks how many times the FD fires a notification callback.

Header is [op/code:1B][len:1B][reserved:2B] each way, 4 bytes per frame. Both enums are #[non_exhaustive] (the two sides are separate processes). The opcode space is flat, not update-specific.

The PoC always accepts. Veto logic, starvation mitigation, and PLDM FD integration come later.

Test plan

  • bazel test //services/pldm/notify-api:pldm_notify_api_test
  • bazel test //services/orchestrator/adapters/pldm:orchestrator_pldm_adapter_test
  • bazel test //services/pldm:firmware_update_host_test
  • bazel test --config=virt_ast10x0 //target/ast10x0/tests/pldm_notify:pldm_notify_qemu_test

Assisted-by: Claude

The test drove the orchestrator's UpdateRequestLatch, which put both
orchestrator crates in a PLDM test's deps. A local counting sink asserts the
same thing: an accepted RequestUpdate notifies once, a rejected one does not,
and nothing later does.

Absolute counts rather than a drain, so each assertion says how many
notifications have happened at that point in the session.
@chrysh
chrysh force-pushed the pldm-update-request-ipc branch from 183121d to 5333788 Compare September 3, 2026 17:28
Wire protocol for the PLDM-to-orchestrator notification channel. PLDM
initiates, the orchestrator handles. One opcode today (UpdateRequested),
two responses (Accepted, Rejected) so the orchestrator can veto before
the transfer starts.

Header is [op/code:1B][len:1B][reserved:2B] each way. Both enums are
non_exhaustive because the two sides are separate processes that may be
built from different revisions. Builds and tests on the host, no kernel
dependency.

Assisted-by: Claude
dispatch() decodes one notification from the PLDM service, encodes an
accept or reject based on the caller's verdict, and returns the
notification in orchestrator-side vocabulary. The caller decides the
verdict; the adapter translates both ways.

Returns Notification, not a state-machine Event: the notification
arrives before the FD has accepted, so there is nothing to authenticate
yet. The state machine hears about the update later, at complete-time
on the intake seam.

Depends on the wire crate only, not on orchestrator-sm.

Assisted-by: Claude
@chrysh
chrysh force-pushed the pldm-update-request-ipc branch 2 times, most recently from 2d820a1 to 3f2628a Compare September 3, 2026 18:12
Two pw_kernel processes on a real channel under QEMU. The PLDM side
sends Request::UpdateRequested via channel_transact, the orchestrator
side waits, reads, runs dispatch (always accepting for the PoC), and
answers. The PLDM side checks for Response::Accepted and shuts down
with PASS.

Asserts Notification::UpdateRequested on the handler side, consistent
with the adapter returning orchestrator-side vocabulary rather than a
state-machine event.

Assisted-by: Claude
@chrysh
chrysh force-pushed the pldm-update-request-ipc branch from 3f2628a to b091e19 Compare September 3, 2026 18:14
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