fe252795 | 13-Mar-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Use system include directives for libpldm headers
libpldm is now an external dependency rather than an in-tree library. Adjust the includes accordingly.
Change-Id: Ib2590b823039d3127d65f66976b294a2
Use system include directives for libpldm headers
libpldm is now an external dependency rather than an in-tree library. Adjust the includes accordingly.
Change-Id: Ib2590b823039d3127d65f66976b294a2fb88e9c1 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
dd1f28b8 | 11-Mar-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Move dbus_to_terminus_effecter code to platform-mc
In the current state , pldm build breaks when attempting to perform a debug-optimized build (`-O2` optimization), leading to the following linker e
Move dbus_to_terminus_effecter code to platform-mc
In the current state , pldm build breaks when attempting to perform a debug-optimized build (`-O2` optimization), leading to the following linker error:
``` undefined reference to `pldm::platform_mc::TerminusManager::getActiveEidByName (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' ```
This issue is not encountered in the CI environment, as CI uses the `-Og` optimization flag, which does not aggressively inline functions. Consequently, the reference to `getActiveEidByName()` is resolved without issue. However, when building the project with default optimizations (debugoptimized [-O2]), the build fails because the linker cannot resolve the reference to `getActiveEidByName()`, which is inlined by the compiler.
To address this problem, there are three potential solutions:
1. Prevent Inlining of the Function: We could use `__attribute__((noinline))` to prevent the compiler from inlining `getActiveEidByName()`.
2. Move Source Files into `libpldmresponder`: We could move the `platform-mc/manager.cpp` and `platform-mc/terminus_manager.cpp` files into the `libpldmresponder` so the compiler can resolve the reference directly within the library.
3. Migrate `dbus_to_terminus_effecter.cpp` to the `platform-mc` folder:
The most appropriate solution appears to be migrating the `dbus_to_terminus_effecter.cpp` file into the `platform-mc` directory. This file is not inherently tied to `libpldmresponder` but functions as a requester. Additionally, there are existing community patches that allow the system to scale from a single host terminus to multiple terminii, further justifying this move. So, solution #3 is the most fitting at this stage. By relocating the `dbus_to_terminus_effecter` code to the `platform-mc` folder, we can ensure proper modularity, while also resolving the build issue in a clean and scalable manner.
Tested By: 1. meson build -Doptimization=2 works fine with the patchset.
Change-Id: I0ac8be58253bfb0394500f1d34e8431c6103c924 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
fdf61cc3 | 22-Jan-2025 |
Chaul Ly <chaul@amperecomputing.com> |
platform-mc: Defer adding sensor objects from PDRs
After all PDRs retrieved from the other terminus are parsed into pdr structs. They will be processed further to create sensor objects (e.g via `add
platform-mc: Defer adding sensor objects from PDRs
After all PDRs retrieved from the other terminus are parsed into pdr structs. They will be processed further to create sensor objects (e.g via `addNumericSensor` function for Numeric Sensors).
During this phase for one sensor, sensor name is achieved (may enlist Sensor Aux Name PDRs), and NumericSensor object is constructed. Sensor object construction involves parsing pdr struct elements into sensor class variables, D-Bus interface initialization and many calls to set D-Bus object properties.
They are actually not blocking actions, but as it continuously loops through sensor PDRs in `parseTerminusPDRs` to add sensors, they take too much time and prevent BMC from processing events coming from other termini. Not to mention the adding of new sensor types in the future and the increase in sensor numbers, the total time will be large, while this is not a primary task in the initialization phase of a terminus.
This commit defers `addNumericSensor` and `addCompactNumericSensor` calls using sdeventplus::source::Defer event source, instead of continuously calling them while looping through the sensor PDRs, to let events coming from other termini break in and be processed by BMC.
Tested:
While BMC is getting, parsing sensor PDRs and creating sensor objects from those PDRs, events can still be received from the other termini.
Change-Id: I4a3bacd4139b51c302e36614757fa1b5e5105f21 Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
38a09d25 | 04-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
platform-mc: Terminus: Add getSensorNames function
`addNumericSensor` and `addCompactNumericSensor` functions currently try to construct the sensor name it self. This causes code duplication.
This
platform-mc: Terminus: Add getSensorNames function
`addNumericSensor` and `addCompactNumericSensor` functions currently try to construct the sensor name it self. This causes code duplication.
This commit separates that work into `getSensorNames` function, which returns a vector of sensor name strings that might enlist Sensor Auxiliary Names PDRs. Depending on the existence of the mentioned PDR, and the sensor count that the PDR supports, the size of the returned vector might vary. At this time, callers only get the first element of the vector, but this function can cover future implementations of Compact Numeric Sensor.
Tested: There's no functional change applied, so the behavior is the same after this commit.
Change-Id: I02844f5d0820b0dea2d16d1695350e92ef0383d2 Signed-off-by: Chau Ly <chaul@amperecomputing.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 ...
|
36b36938 | 29-Jan-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
platform-mc : 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 prob
platform-mc : 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: I006bb4a5de9f7d0cef4dbc7507f63e1d6798ddfe Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
6baafe48 | 20-Jan-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
platform-mc: startSensorPolling post PDR init
Move startSensorPolling after confirming PDR initialization of pldm device to avoid missing the start sensor polling opportunity if GetPDR fails initial
platform-mc: startSensorPolling post PDR init
Move startSensorPolling after confirming PDR initialization of pldm device to avoid missing the start sensor polling opportunity if GetPDR fails initially and succeeds later.
Removed the redundant handling of addedTids for sensor polling, as initTerminus now ensures all necessary termini are processed.
Change-Id: I4e090a0f3c5b0a7ce85b56f9f3f2c585e42b638f Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
8fa40dbe | 02-Apr-2024 |
Chau Ly <chaul@amperecomputing.com> |
platform-mc: Call MCTP `.Recover` in the request timeout
In the current implementation, `pldmd` will register the request messages to sendRecvPldmMsg. This API will returns the return error code fro
platform-mc: Call MCTP `.Recover` in the request timeout
In the current implementation, `pldmd` will register the request messages to sendRecvPldmMsg. This API will returns the return error code from sendRecvPldmMsgOverMctp directly to the caller but not handle the timeout error code. From Mctp codeConstruct version 2.0 [1], the MCTP D-Bus interface `au.com.codeconstruct.MCTP.Endpoint1` supports `.Recover` method to recover the communication to one terminus. The `pldmd` should call this method in time out.
[1] https://github.com/CodeConstruct/mctp/blob/v2.0/docs/endpoint-recovery.md#recover-method-design-considerations
Supports handling the timeout error code by calling to the `.Recover` method under `au.com.codeconstruct.MCTP.Endpoint1` brought by mctpd. This action will check if the endpoint is still available. pldm will handle accordingly by continuing to communicate or removing the endpoint based on mctpd upcoming behaviors.
Signed-off-by: Chau Ly <chaul@amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I71cc33a3630b5adbd65c485fe98148669ce635f6
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 ...
|
efa00329 | 18-Jan-2025 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Change-Id: If4b5a8a8fea1b34f98604e810896becf22c0e6c4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
b6d3943d | 04-Jun-2024 |
Dung Cao <dung@os.amperecomputing.com> |
platform-mc: discovery FRU data from terminus
As [1], `pldmd` will host Fru D-Bus inventory object path and Fru `xyz.openbmc_project.Inventory.Decorator.*` D-Bus interfaces of one PLDM terminus. [1]
platform-mc: discovery FRU data from terminus
As [1], `pldmd` will host Fru D-Bus inventory object path and Fru `xyz.openbmc_project.Inventory.Decorator.*` D-Bus interfaces of one PLDM terminus. [1] https://github.com/openbmc/docs/blob/master/designs/pldm-stack.md#processing-pldm-fru-information-sent-down-by-the-host-firmware
Support getting FRU data from terminus in the terminus discovery phase and expose FRU data to the Fru D-Bus properties in `xyz.openbmc_project.Inventory.Decorator.Asset`, `xyz.openbmc_project.Inventory.Decorator.AssetTag`, `xyz.openbmc_project.Inventory.Decorator.Compatible` and `xyz.openbmc_project.Inventory.Decorator.Revision` interfaces of `xyz/openbmc_project/FruPldm/<Terminus_Name>` D-Bus object path which is created by `xyz.openbmc_project.PLDM` D-Bus service. The object path will be available until the endpoint EID is removed from the MCTP D-Bus.
``` busctl introspect xyz.openbmc_project.PLDM /xyz/openbmc_project/inventory/system/board/S0 NAME TYPE SIGNATURE RESULT/VALUE FLAGS org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - xyz.openbmc_project.Inventory.Decorator.Asset interface - - - .BuildDate property s "" emits-change writable .Manufacturer property s "" emits-change writable .Model property s "00014003" emits-change writable .PartNumber property s "" emits-change writable .SerialNumber property s "000000218" emits-change writable .SparePartNumber property s "" emits-change writable .SubModel property s "" emits-change writable xyz.openbmc_project.Inventory.Decorator.AssetTag interface - - - .AssetTag property s "" emits-change writable xyz.openbmc_project.Inventory.Decorator.Compatible interface - - - .Names property as 0 emits-change writable xyz.openbmc_project.Inventory.Decorator.Revision interface - - - .Version property s "x.x.00008.004" emits-change writable xyz.openbmc_project.Inventory.Item.Board interface - - -
``` Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I4f8869f8fee0fc0f8a5a5670d9a42fc7f48cc798
show more ...
|
5028734c | 21-Nov-2023 |
Dung Cao <dung@os.amperecomputing.com> |
platform-mc: Support register OEM mechanism to poll events
When the terminus only supports the `Poll-based message` type as `Table 17 - EventMessageSupported command format` in DSP0248 V1.3.0, BMC n
platform-mc: Support register OEM mechanism to poll events
When the terminus only supports the `Poll-based message` type as `Table 17 - EventMessageSupported command format` in DSP0248 V1.3.0, BMC needs polling the events from the terminus. Add method to register OEM mechanism to poll the event from terminus.
Change-Id: I9c10d66ce076de3ddb38c9a391c3784b57ebb934 Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Dung Cao <dung@os.amperecomputing.com>
show more ...
|
0469b568 | 06-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Replace all isnan calls with isfinite
In most of the numeric sensor code, the code uses isnan as an analog for "Can be used sanely in a math equation" Unfortunately, isnan will return false for thi
Replace all isnan calls with isfinite
In most of the numeric sensor code, the code uses isnan as an analog for "Can be used sanely in a math equation" Unfortunately, isnan will return false for things like infinity, negative infinity, large values, etc that aren't usable in math, but are not nan.
This commit replaces all calls in the codebase from isnan to isfinite[1]
Testing: Need help here from maintainers to understand what they'd like to see in terms of tests. This is a pretty isolated and mechanical change.
[1] https://en.cppreference.com/w/cpp/numeric/math/isfinite
Change-Id: I4995ea319c058869c3f7d010ae8b5a08c68b10e5 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
7c14fc47 | 17-Dec-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Tested: Build verified
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Tested: Build verified
Change-Id: If9e6c34c48821a7cf8577a2166727ce7db06fadc Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
a1871174 | 19-Dec-2024 |
Amithash Prasad <amithash@meta.com> |
platform-mc: Refactor units and range field PDR decode
The conversion based on range_field_format and sensor_data_size was duplicated across each of the fields. This change adds helper functions and
platform-mc: Refactor units and range field PDR decode
The conversion based on range_field_format and sensor_data_size was duplicated across each of the fields. This change adds helper functions and thus helping with reducing some of the duplicated code.
Change-Id: I70a5477d6743b250aea55249ccb27d2459f044e5 Signed-off-by: Amithash Prasad <amithash@meta.com>
show more ...
|
9825660e | 19-Dec-2024 |
Amithash Prasad <amithash@meta.com> |
platform-mc: Refactor unit conversion out of constructor
This is a mostly non-functional refactor which moves code duplicated across the two constructors to a common private method which can be used
platform-mc: Refactor unit conversion out of constructor
This is a mostly non-functional refactor which moves code duplicated across the two constructors to a common private method which can be used by the constructors.
A minor side-effect introduced here is adding a new sensorUnit member which could be used in the future.
Change-Id: I62ad69f843f1283a0695ff2ace814e454851fcf7 Signed-off-by: Amithash Prasad <amithash@meta.com>
show more ...
|
6dce7d11 | 18-Nov-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform-mc: Support multi-handlers for polled events
platform-mc only supports one event handler for the polled events. Update the code to allow multiple event handlers.
Change-Id: Icfb531ce89a49b
platform-mc: Support multi-handlers for polled events
platform-mc only supports one event handler for the polled events. Update the code to allow multiple event handlers.
Change-Id: Icfb531ce89a49bb417ca94bd608442f9323810b4 Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
6e615622 | 21-Jun-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform-mc: Support GetPLDMVersion
`GetPLDMCommands` in DSP0240 v1.1.0 requires the PLDM supported type version. In the current implementation, when detecting new MCTP endpoint, `pldmd` always send
platform-mc: Support GetPLDMVersion
`GetPLDMCommands` in DSP0240 v1.1.0 requires the PLDM supported type version. In the current implementation, when detecting new MCTP endpoint, `pldmd` always send `0xff 0xff 0xff 0xff` version to `GetPLDMCommand` in discovery steps with the assumption that the terminus will response for the request with any version of PLDM type.
Some termini don't accept `0xff 0xff 0xff 0xff` as input version to `GetPLDMCommands` command because value `0xff` only has meaning `A value of 0xFF in the "update" field indicates that the field to be ignored.` in the `Section 12.6.1 Version field encoding` in `MCTP Base spec` DSP0236 v1.3.1 but not in `PLDM base spec` DSP0240 v1.1.0 where `GetPLDMCommand` is detailed.
Support sending `GetPLDMVersion` from the supported PLDM types of one terminus in the `discovery step` to get the PLDM version. And use that version as input for `GetPLDMCommands` of that PLDM types to get the supported PLDM commands.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: Ia33c6722603801431e411eaf0647b74d8a1639d8
show more ...
|
6894e90f | 22-Oct-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform-mc: Support register OEM CPER Event class(0xFA)
The CPER Event class (0x07) is only introduced in DMTF DSP0248 V1.3.0. Before that spec version, Ampere SoC uses Ampere OEM CPER Event class(
platform-mc: Support register OEM CPER Event class(0xFA)
The CPER Event class (0x07) is only introduced in DMTF DSP0248 V1.3.0. Before that spec version, Ampere SoC uses Ampere OEM CPER Event class(0xFA) to report the CPER event to BMC. Update `platform-mc` code to support registers the OEM CPER Event class.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: Iab2f1e1f7e711ce6072c180ac133a68cb20e40ba
show more ...
|
d197f09e | 06-Nov-2023 |
Chau Ly <chaul@amperecomputing.com> |
platform-mc: Add pldm entity inventory path
This commit exposes inventory path of each sensor to under the entity's inventory path that it belongs to. In each path, the xyz.openbmc_project.Inventory
platform-mc: Add pldm entity inventory path
This commit exposes inventory path of each sensor to under the entity's inventory path that it belongs to. In each path, the xyz.openbmc_project.Inventory.Source.PLDM.Entity interface is implemented with ContainerID, EntityInstanceNumber and EntityType properties.
Signed-off-by: Chau Ly <chaul@amperecomputing.com> Change-Id: Icf10349b7d272c6b050259151d71f21efedb0162
show more ...
|
1be20729 | 28-Oct-2024 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
platform-mc: Unmap TID on get PLDM Type failure
Ensure the TID is unmapped when retrieving the PLDM Type and creating a terminus manager for TID failure, preventing the corresponding terminus from f
platform-mc: Unmap TID on get PLDM Type failure
Ensure the TID is unmapped when retrieving the PLDM Type and creating a terminus manager for TID failure, preventing the corresponding terminus from failing to reinitialize.
Change-Id: I15c5981d6813899039d35d9d05b6b873b6118e34 Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
f00fd432 | 26-Oct-2024 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
platform-mc: Set initialized true post-init
Ensures TID is only marked initialized after successful getPDRs init, preventing premature initialization flagging even if PLDM_ERROR occurs.
According t
platform-mc: Set initialized true post-init
Ensures TID is only marked initialized after successful getPDRs init, preventing premature initialization flagging even if PLDM_ERROR occurs.
According to DSP0248 V1.3.0, lines 1555 and 1538 The Init Agent will response for Get PRDs and Set Event Receiver so the initialized should be set after those steps.
Change-Id: Ide8d691ae312bcd2dbf061e945f673ef755a5b2b Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
dd6f36cb | 22-Oct-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform-mc: Correct the discovered terminus condition
When the terminus is discovered, the terminus shared pointer will be added to `termini` list. So `termini[tid]` will not be `nullptr`. Correct
platform-mc: Correct the discovered terminus condition
When the terminus is discovered, the terminus shared pointer will be added to `termini` list. So `termini[tid]` will not be `nullptr`. Correct the discovered terminus condition.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I070e927d34a49d0fdbc02fcd9dbbcd4be2f897a7
show more ...
|
f48015b3 | 20-Nov-2023 |
Dung Cao <dung@os.amperecomputing.com> |
platform-mc: Support pollForPlatFormEventMessage
Supports polling all events synchronously when the terminus sends `pldmMessagePollEvent` with the event id. BMC will use the received event id as inp
platform-mc: Support pollForPlatFormEventMessage
Supports polling all events synchronously when the terminus sends `pldmMessagePollEvent` with the event id. BMC will use the received event id as input for `pollForPlatformEventMessage` command to retrieve the event data.
Change-Id: If01f63f30d3f57f8423c863ec776e83dda8e3042 Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|