The pldm-softpoweroff application provides graceful host shutdown functionality using the Platform Level Data Model (PLDM) protocol. It coordinates with the remote pldm endpoint to perform a controlled shutdown by sending PLDM Set State Effecter States commands and monitoring the shutdown completion through state sensor events.
This application is responsible for:
The graceful shutdown flow is modelled using standard PLDM Platform Monitoring and Control state effecters and state sensors.
A remote PLDM terminus is expected to:
The implementation uses the standard PLDM state set:
PLDM_STATE_SET_SW_TERMINATION_STATUS (129)
To support soft power off, the remote endpoint must expose matching State Effecter and State Sensor PDRs for the software termination state set.
Example State Effecter PDR
The effecter is used by OpenBMC to request a graceful shutdown through the PLDM SetStateEffecterStates command.
Example State Sensor PDR
The sensor is used by the remote endpoint to report software termination status through PLDM state sensor events.
Location: configurations/softoff/softoff_config.json
The configuration file defines the PLDM terminus and entity information for soft power off:
{ "entries": [ { "tid": 208, "entityType": 32801, "stateSetId": 129 }, { "tid": 2, "entityType": 45, "stateSetId": 129 } ] }
Parameters:
tid: PLDM Terminus ID of the remote endpointentityType: PLDM entity type hosting the soft power off effecterstateSetId: State set ID for the software termination status (typically 129 for PLDM_STATE_SET_SW_TERMINATION_STATUS)The application tries each entry in order until it finds matching PDRs.
SOFTOFF_TIMEOUT_SECONDS: Timeout duration for remote endpoint shutdown completion (default: implementation-defined)SOFTOFF_CONFIG_JSON: Path to the configuration directory (default: set at build time)sequenceDiagram participant BMC as pldm-softpoweroff participant T as Remote PLDM Terminus Note over BMC: Read softoff configuration<br/>(tid, entityType, stateSetId) BMC->>T: Discover State Effecter and State Sensor PDRs T-->>BMC: PDR responses Note over BMC: Locate matching Effecter/Sensor PDRs BMC->>BMC: Verify current endpoint state BMC->>BMC: Start shutdown timeout timer BMC->>T: SetStateEffecterStates<br/>(Graceful Shutdown Request) Note over T: Begin graceful shutdown sequence T-->>BMC: PlatformEventMessage<br/>(State Sensor Event - In Progress) Note over T: Complete shutdown activities T-->>BMC: PlatformEventMessage<br/>(State Sensor Event - Completed) BMC->>BMC: Verify completion state BMC->>BMC: Exit successfully
File: services/pldmSoftPowerOff.service
The service is configured as:
pldmd.service (PLDM daemon must be available)pldmd.service (starts after PLDM daemon)obmc-host-stop-pre@0.target (runs before host stop sequence)obmc-host-startmin@0.target (prevents running during host start)The service is typically triggered by the host shutdown sequence in OpenBMC.