| f9090f37 | 15-Jul-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
pldm: Use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. With this change, errors are no lon
pldm: Use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. With this change, errors are no longer thrown by default. Instead, the caller can inspect allocation errors as values, extract the error message or code as needed, or explicitly throw the error further up the stack if appropriate. This approach allows for more flexible and explicit error handling, and reduces reliance on exception-based control flow.
Motivation: This change aims to improve robustness by enabling explicit error handling and reducing the risk of uncaught exceptions that could lead to a pldmd core dump if an instance ID allocation fails for a single EID. Such a core dump could disrupt ongoing operations such as sensor polling or firmware updates for other EIDs
Note: Currently, some call sites are still void-returning functions and cannot propagate errors via return values. As a result, errors from InstanceIdDb::next() are thrown as InstanceIdError at these locations to avoid silent failures. Ideally, it would be preferable for these functions to propagate errors by value (for example, using std::expected), so that errors can always be handled explicitly without relying on exceptions.
Change-Id: I7189e97f206bae1eed5c8db44ebbbcd4393c8f8d Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| b249a645 | 02-Dec-2025 |
Luka Strizic <lstrz@google.com> |
requester: Adds a missing try-catch
A try-catch in propertiesChangedCb was missing. Now it's added.
Tested: Successfully restarted pldmd on a machine. Change-Id: Ic7f3d210dddaa9857841a6f53c9e26db7f
requester: Adds a missing try-catch
A try-catch in propertiesChangedCb was missing. Now it's added.
Tested: Successfully restarted pldmd on a machine. Change-Id: Ic7f3d210dddaa9857841a6f53c9e26db7fae3e92 Signed-off-by: Luka Strizic <lstrz@google.com>
show more ...
|
| d20f0ac4 | 26-Nov-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
mctp_endpoint_discovery: use PDI definitions
Use PDI symbols instead of string literals for the interface name of `xyz.openbmc_project.Common.UUID`.
Tested: Inspection only.
Change-Id: Ia608e7ead5
mctp_endpoint_discovery: use PDI definitions
Use PDI symbols instead of string literals for the interface name of `xyz.openbmc_project.Common.UUID`.
Tested: Inspection only.
Change-Id: Ia608e7ead5d4b165df03e1bcc14c94d1cbd05ecf Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| 1f2794d0 | 11-Nov-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
MCTP.Endpoint: use PDI constants
Use PDI constants for `xyz.openbmc_project.MCTP.Endpoint` interface instead of defining them locally.
Tested: Inspection only.
Change-Id: I047069a493143564e938b726
MCTP.Endpoint: use PDI constants
Use PDI constants for `xyz.openbmc_project.MCTP.Endpoint` interface instead of defining them locally.
Tested: Inspection only.
Change-Id: I047069a493143564e938b72658e1af4a2927f6e9 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| a6046a7b | 11-Nov-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
fix ci: move to stdexec::inline_scheduler
Move from `exec::inline_scheduler` to `stdexec::inline_scheduler`.
Looks like the definition has been deprecated and is pointing to `stdexec::inline_schedu
fix ci: move to stdexec::inline_scheduler
Move from `exec::inline_scheduler` to `stdexec::inline_scheduler`.
Looks like the definition has been deprecated and is pointing to `stdexec::inline_scheduler` anyways.
the relevant header ```
namespace exec { // A simple scheduler that executes its continuation inline, on the // thread of the caller of start(). using inline_scheduler [[deprecated("Use stdexec::inline_scheduler instead")]] = stdexec::inline_scheduler; } // namespace exec ```
Tested: Inspection only.
Fixes: 10d0b4b7d1498cfd5c3d37edea271a54d1984e41 Change-Id: I1d23cb624e8902c541eeb31bd31155a3207a2da9 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| 6449a3b0 | 08-Oct-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
requester: check NetworkId when removing configs
Update removeConfigs() to match entries by both EID and NetworkId, rather than EID alone.
Motivation: Avoid deleting configurations belonging to end
requester: check NetworkId when removing configs
Update removeConfigs() to match entries by both EID and NetworkId, rather than EID alone.
Motivation: Avoid deleting configurations belonging to endpoints on other networks that share the same EID.
Change-Id: I9125993dd932405b439430976661c52e4b4b3c70 Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 22bcb07d | 11-Jul-2025 |
ManojKiran Eda <manojkiran.eda@gmail.com> |
Revert "pldm: use std::expected for instance ID allocation"
This reverts commit 70262ed7bf854b25d4b65628bc3c892ddfe9380f.
Change-Id: I1f54d6b60bf3cfa9f00764140eec6167e1e182d6 Signed-off-by: Manojki
Revert "pldm: use std::expected for instance ID allocation"
This reverts commit 70262ed7bf854b25d4b65628bc3c892ddfe9380f.
Change-Id: I1f54d6b60bf3cfa9f00764140eec6167e1e182d6 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| 70262ed7 | 02-Jul-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
pldm: use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. This change enables callers to expl
pldm: use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. This change enables callers to explicitly handle allocation errors via value inspection, rather than relying on exception handling.
This approach prevents core dumps from uncaught exceptions and eliminates the need for pervasive try-catch blocks. Callers can now access the error code and message directly, improving clarity and control of error propagation.
Note: Errors from InstanceIdDb::next() are currently handled via early return, which may silently discard failures. This is a temporary solution; APIs and callers will need to be updated in the future to propagate and handle errors explicitly.
Change-Id: Ibf2e0034b0ee725cb59adfd93b74e48db8c42cba Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 70eca96b | 10-May-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
Fix build issues after migrating to Clang 20
With the recent migration to Clang 20 in openbmc-build-scripts, the current PLDM codebase fails to compile due to stricter type checking and unused field
Fix build issues after migrating to Clang 20
With the recent migration to Clang 20 in openbmc-build-scripts, the current PLDM codebase fails to compile due to stricter type checking and unused field warnings introduced by the updated compiler.
This commit addresses the following issues to restore build stability:
1. Callback compatibility: Replaced std::bind_front with lambda expressions that explicitly capture this, resolving type mismatch errors when assigning member function callbacks to std::function. 2. Unused field warning: Removed the unused `bus` member variable from the `SoftPowerOff` class and updated its constructor accordingly to eliminate `-Wunused-private-field` warnings.
These changes are required to allow successful CI builds under the Clang 20 toolchain.
Change-Id: I8eb909c2b1263bf7b2dbf53cdfc0424d425d352b Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| c40d4a68 | 11-Mar-2025 |
Unive Tien <unive.tien.wiwynn@gmail.com> |
requester: associate Entity Manager configs with MCTP endpoints
Currently, pldmd listens for new MCTP endpoint exposed by mctpd, but they only shows their EID, Network Id, and SupportedMessageTypes,
requester: associate Entity Manager configs with MCTP endpoints
Currently, pldmd listens for new MCTP endpoint exposed by mctpd, but they only shows their EID, Network Id, and SupportedMessageTypes, which cannot fulfill some requirements, e.g., get the device's name or which board it belongs to.
In openbmc, the additional information are exposed by Entity Manager[1][2], so add this ability to `MctpDiscovery, it queries the association between MCTP endpoints and Entity Manager configurations from MCTP Reactor, when a new MCTP endpoint has been register by mctpd.
Added unit test for this commit to validate the association does work, passed.
[1]: https://github.com/openbmc/entity-manager/blob/master/schemas/mctp.json [2]: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/69111
Change-Id: Ibf1717f1840e527f21bd8397e747ae121e2dcd25 Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
show more ...
|
| 059fc892 | 15-Apr-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Avoid freeing instance IDs acquired by other apps
With all applications now utilizing the transport APIs built on top of libpldm, instance ID allocation and management are consistently handled throu
Avoid freeing instance IDs acquired by other apps
With all applications now utilizing the transport APIs built on top of libpldm, instance ID allocation and management are consistently handled through a shared mechanism. These updated APIs also allow applications to explicitly free their own instance IDs once they're done using them.
As a result, pldmd no longer needs to free instance IDs on behalf of other applications. Furthermore, when pldmd is operating over AF_MCTP, it cannot observe or intercept PLDM traffic initiated by other applications. In such cases, any attempt by pldmd to manage instance IDs for external requests becomes redundant and effectively dead code.
Change-Id: I5226cc4fa24030583ddbd000ff944a16c5b2e7a6 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| 4bf3ed84 | 14-Mar-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
requester: Fix error handling in registerRequest
Add error handling for pollEndpointQueue in registerRequest to prevent incorrect PLDM_SUCCESS returns. This ensures SendRecvMsgSender can handle send
requester: Fix error handling in registerRequest
Add error handling for pollEndpointQueue in registerRequest to prevent incorrect PLDM_SUCCESS returns. This ensures SendRecvMsgSender can handle send failures, preventing discoverMctpTerminusTask from stalling and remaining incomplete.
Change-Id: I153934490ee848166e7dce5892136bbbdeeacdd9 Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 5ea72377 | 04-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
tests: Migrate to placement_new from reinterpret casting
reinterpret_cast is prohibited by the C++ core guidelines because it takes the behavior outside the language definition and gives problems wi
tests: Migrate to placement_new from reinterpret casting
reinterpret_cast is prohibited by the C++ core guidelines because it takes the behavior outside the language definition and gives problems with type safety. Placement-new on the other-hand allows to control the object storage while still properly instantiating an object,keeping the behavior inside the C++ language specification.
Change-Id: Ifab9ea58b932db11d7af0b9def119bed1bfdc44d Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
| 38e12aa2 | 21-Jan-2025 |
Thu Nguyen <thu@os.amperecomputing.com> |
Support `terminus_name` option in `dbus_to_terminus_effecter`
Support `terminus_name` configuration option in `dbus_to_terminus_effecter` to allow setting the destination terminus beside `mctp_eid`.
Support `terminus_name` option in `dbus_to_terminus_effecter`
Support `terminus_name` configuration option in `dbus_to_terminus_effecter` to allow setting the destination terminus beside `mctp_eid`. This is helpful when the mctp endpoint Eid is not static.
Change-Id: I8b1ed15741807086254146017c99c13ae667dac1 Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
| 75e00422 | 19-Mar-2024 |
Chau Ly <chaul@amperecomputing.com> |
platform-mc: Handle `Connectivity` propertiesChanged signal
From Mctp codeConstruct version 2.0 [1], mctpd supports `.Connectivity` property under `au.com.CodeConstruct.MCTP.Endpoint` interface of t
platform-mc: Handle `Connectivity` propertiesChanged signal
From Mctp codeConstruct version 2.0 [1], mctpd supports `.Connectivity` property under `au.com.CodeConstruct.MCTP.Endpoint` interface of the endpoint. This commit handles the propertiesChanged signal from this interface, and updates the Availability of the MCTP Endpoint accordingly in the source to enable or disable message sending/receiving via that endpoint of the terminus.
[1] https://github.com/CodeConstruct/mctp/blob/v2.0/docs/endpoint-recovery.md#proposed-design
When the discovery process first starts, it will only handle the endpoints that have `Available` `.Connectivity`. It lets the propertiesChanged signal trigger the adding of the endpoints when they are back to` Available`.
On interfaceAdded signal, it assumes that mctpd only publishes available endpoints to D-Bus, so it adds the endpoints to the terminus anyway.
Tested: 1. Enable `unsafe-writable-connectivity` option in PACKAGECONFIG of mctp recipe. 2. After PLDM discovers all the endpoints, write `Degraded` to `.Connectivity` of one of the endpoint. 3. Write it back to `Available` to see how message is stopped from being sent/received via the endpoint.
Signed-off-by: Chau Ly <chaul@amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I5b7a38ae72e655b60d71396a1118f2809aaa3838
show more ...
|
| 366507c8 | 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I95f756bab7f403af49a94011bbb1fe4e51f985ad Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I95f756bab7f403af49a94011bbb1fe4e51f985ad Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| ef16cdec | 09-Jul-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
Update MCTP D-Bus interface sources
The MCTP D-Bus interface sources are changed as [1] https://codeconstruct.com.au/docs/mctp-utils-v2-0-release/ The `pldmd` should be updated to follow that change
Update MCTP D-Bus interface sources
The MCTP D-Bus interface sources are changed as [1] https://codeconstruct.com.au/docs/mctp-utils-v2-0-release/ The `pldmd` should be updated to follow that change.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I5bdc8b82f7b8341a06d0a78ca790092b5488ecc9
show more ...
|
| 9027497f | 17-Jul-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
mctp-discovery: Get endpoint UUID from D-Bus
Getting the MCTP endpoint UUID from `UUID` D-Bus property in `xyz.openbmc_project.Common.UUID` D-Bus interface of MCTP Endpoint object. Update the endpoi
mctp-discovery: Get endpoint UUID from D-Bus
Getting the MCTP endpoint UUID from `UUID` D-Bus property in `xyz.openbmc_project.Common.UUID` D-Bus interface of MCTP Endpoint object. Update the endpoint MCTPInfo with that UUID.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I35e83eac11fafafdad57cdc0285b344650caefbd
show more ...
|
| f7d249ed | 02-Sep-2024 |
SeanCChuang <sean.chuang.wiwynn@gmail.com> |
requester: Fix pldmd crash
Add a check to see if the key is exist in the queue of remove request , to prevent calling the response handler twice after the request has timed out.
Change-Id: Iafe061d
requester: Fix pldmd crash
Add a check to see if the key is exist in the queue of remove request , to prevent calling the response handler twice after the request has timed out.
Change-Id: Iafe061d71a6ae7e04a11f462acf00423bd52f4b6 Signed-off-by: SeanCChuang <sean.chuang.wiwynn@gmail.com>
show more ...
|
| 3012b632 | 22-Aug-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Format meson files with meson.format
Meson 1.5.0 introduced a new feature to format all the meson files. Formatting all the meson files is now as simple as running `meson format -i -r` command in th
Format meson files with meson.format
Meson 1.5.0 introduced a new feature to format all the meson files. Formatting all the meson files is now as simple as running `meson format -i -r` command in the repository root folder.
more details : https://mesonbuild.com/Commands.html#format
Change-Id: I9c5468cc502ae78b7a055e2de2a10296930cb9ec Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| 16c2a0a0 | 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I8c84201cb2343a8c8a5507a49de0721a1bee7063 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 61be7347 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: pass scheduler to default_task_context
The latest version of stdexec[1] does not allow a default constructed `default_task_context` but requires a scheduler to be passed in. The previous d
stdexec: pass scheduler to default_task_context
The latest version of stdexec[1] does not allow a default constructed `default_task_context` but requires a scheduler to be passed in. The previous default was to use an `inline_scheduler` so explicitly pass that in.
[1]: https://github.com/openbmc/sdbusplus/commit/5cee91570368554a7fcbbd9418f65efda449fa70
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib210b42ba5272e0176cd4423b156ca6372115a55
show more ...
|
| c14fb4bd | 25-Jul-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
pldm: Drop pessimizing moves
Fixes issues such as:
``` ../host-bmc/host_pdr_handler.cpp:684:9: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 684 | st
pldm: Drop pessimizing moves
Fixes issues such as:
``` ../host-bmc/host_pdr_handler.cpp:684:9: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 684 | std::move(std::vector<uint8_t>(1, PLDM_PDR_ENTITY_ASSOCIATION)), | ^ ../host-bmc/host_pdr_handler.cpp:684:9: note: remove std::move call here 684 | std::move(std::vector<uint8_t>(1, PLDM_PDR_ENTITY_ASSOCIATION)), | ^~~~~~~~~~ ~ ```
Change-Id: Id26f0d6fc21837e1eb76ae3c294c222782a4e69f Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 6b901e4a | 10-Jul-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
requester: Use return code instead of throwing exception
The coroutine API should only forward error code and response data to the caller when sends/receives PLDM message instead check the response
requester: Use return code instead of throwing exception
The coroutine API should only forward error code and response data to the caller when sends/receives PLDM message instead check the response and thrown exception.
The `sendRecvMsg` API will response tuple of error code, response and response length as below:
+ [error_code, _, _] if registerRequest fails with `error_code`. + [PLDM_ERROR_NOT_READY, nullptr, 0] if the request is timed out. + [PLDM_SUCCESS, resp, len] if succeeded.
Signed-off-by: Khang Nguyen Duy <khangng@amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: Id8262d147e9fed50af8f55f1c611a3a3b153b6e3
show more ...
|
| e3596384 | 21-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
fix markdownlint issues reported in CI
There are a lot of warnings reported by markdownlint in the CI, this commit aims at fixing all of them.
Tested :
No more warnings reported by markdownlint in
fix markdownlint issues reported in CI
There are a lot of warnings reported by markdownlint in the CI, this commit aims at fixing all of them.
Tested :
No more warnings reported by markdownlint in the CI.
Change-Id: I92d24bc0efd230dd0974ff49853ef928caf1febd Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|