platform-mc: Add entity-type-specific D-Bus inventory interfaces

PldmEntityReq unconditionally inherits Inventory.Item.Board
regardless of the actual PLDM entity type. A GPU terminus therefore
exposes an Inventory.Item.Board interface, making it
indistinguishable from an actual board when bmcweb enumerates the
Redfish Chassis collection via the object mapper.

bmcweb's Chassis aggregation queries the mapper for objects
implementing specific Inventory.Item.* interfaces, and emits the
corresponding Redfish @odata.type (Chassis, Accelerator, Processor,
etc.) based on which interface is found. Today, all PLDM termini
show up as generic Board because that is the only interface
PldmEntityReq implements, regardless of what the device actually
is.

Refactor PldmEntityReq into a class template parameterized by the
sdbusplus Item server type, with a PldmEntityBase abstract base
providing the property setters via the Decorator interfaces
(Asset, AssetTag, Revision, Compatible). A createPldmEntity()
factory function selects the correct template instantiation based
on the PLDM entity type reported by the Entity Auxiliary Names
PDR:

  System Chassis      -> Inventory.Item.Chassis
  Processor           -> Inventory.Item.Cpu
  Memory Module       -> Inventory.Item.Dimm
  Fan                 -> Inventory.Item.Fan
  Power Supply        -> Inventory.Item.PowerSupply
  GPU / Accelerator   -> Inventory.Item.Accelerator
  Board / SysBoard / Card / default -> Inventory.Item.Board

This change deliberately does NOT touch the D-Bus object path
convention. Per OpenBMC conventions (as followed by entity-manager
and other services), D-Bus object paths are opaque identifiers
and should not be parsed or treated as semantic by consumers.
All meaning is carried by the interfaces the object implements,
which is exactly what this change corrects.

The existing /system/board/<name> path prefix is a historical
namespace label matching entity-manager's convention, not a type
claim about the underlying device. A GPU terminus after this
change implements Inventory.Item.Accelerator while living at
/system/board/GPU0, which looks odd in busctl tree but is
correct by the established convention.

Tested: Unit test createPldmEntityTest exercises all 10 entity
type mappings (System Chassis, Processor, Memory Module, Fan,
Power Supply, GPU, Accelerator, Board, SysBoard, Card) plus
unknown-type fallback, verifying each produces a non-null entity
with working property setters through the PldmEntityBase
abstract interface. Docker CI passes (format, build, all unit
tests, 50.6% line coverage). End-to-end on Renode evb-ast2600
with PldmFirmwareDevice (entity type 152/GPU) over MCTP serial
confirms the terminus object at /xyz/openbmc_project/inventory/
system/board/GPU0 implements Inventory.Item.Accelerator (Robot
Framework test ASPEED_PLDM_Inventory: 2/2 passed).

PS7 review feedback (Brad Bishop):
  - Default-construct the move ctor/assignment for PldmEntityBase
    and PldmEntityReq instead of deleting them. Class users should
    be in control of ownership semantics rather than getting the
    deleted-by-default behavior baked in by the inventory layer.
  - Rename the lowercase server-type aliases to CamelCase
    (assetserver -> AssetServer, etc.) per OpenBMC style.

Change-Id: Ia143edef5083a58dbe65864e63f7ede37e5e7594
Signed-off-by: Gary Beihl <garybeihl@microsoft.com>
7 files changed
tree: 953de5d69658544fbbb73c28c3ac5c5514a887a8
  1. common/
  2. configurations/
  3. docs/
  4. fw-update/
  5. host-bmc/
  6. libpldmresponder/
  7. oem/
  8. platform-mc/
  9. pldmd/
  10. pldmtool/
  11. requester/
  12. softoff/
  13. subprojects/
  14. test/
  15. tools/
  16. utilities/
  17. .clang-format
  18. .clang-tidy
  19. .eslintignore
  20. .gitignore
  21. .linter-ignore
  22. LICENSE
  23. meson.build
  24. meson.options
  25. OWNERS
  26. README.md
README.md

PLDM - Platform Level Data Model

License

Overview

PLDM (Platform Level Data Model) is a key component of the OpenBMC project, providing a standardized data model and message formats for various platform management functionalities. It defines a method to manage, monitor, and control the firmware and hardware of a system.

The OpenBMC PLDM project aims to implement the specifications defined by the Distributed Management Task Force (DMTF), allowing for interoperable management interfaces across different hardware and firmware components.

Features

  • Standardized Messaging: Adheres to the DMTF's PLDM specifications, enabling consistent and interoperable communication between different components.
  • Modularity: Supports multiple PLDM types, including base, FRU,Firmware update, Platform Monitoring and Control, and BIOS Control and Configuration.
  • Extensibility: Easily extendable to support new PLDM types and custom OEM commands.
  • Integration: Seamlessly integrates with other OpenBMC components for comprehensive system management.

Getting Started

Prerequisites

To build and run PLDM, you need the following dependencies:

  • Meson
  • Ninja

Alternatively, source an OpenBMC ARM/x86 SDK.

Building

To build the PLDM project, follow these steps:

meson setup build && meson compile -C build

To run unit tests

The simplest way of running the tests is as described by the meson man page:

meson test -C build

Alternatively, tests can be run in the OpenBMC CI docker container using these steps.

To enable pldm verbosity

pldm daemon accepts a command line argument --verbose or --v or -v to enable the daemon to run in verbose mode. It can be done via adding this option to the environment file that pldm service consumes.

echo 'PLDMD_ARGS="--verbose"' > /etc/default/pldmd
systemctl restart pldmd

To disable pldm verbosity

rm /etc/default/pldmd
systemctl restart pldmd

Documentation

For complete documentation on the functionality and usage of this repository, please refer to the docs folder.