Open arun-pm opened 1 year ago
Sorry, but I don't think that's what we want at all. Rather, the problem is that the libpldm APIs are conflating errors that it must signal via its APIs with errors defined by the protocol specifications. These are distinct problems and need to be treated as such. For instance, there's no need for a concept of signalling a failure to allocate dynamic memory at the protocol level, but this is something that's likely necessary for the library.
libpldm should not be constrained to returning errors defined in the protocol types through its APIs. We lift that constraint by defining a set of libpldm-specific error codes to return from its APIs that are distinct from the PLDM protocol error codes.
libpldm uses PLDM spec defined completion codes as return codes for encode/decode APIs. Eg:- https://github.com/openbmc/libpldm/blob/main/src/firmware_update.c#L622
Which are confusing.
Proposal: Define a new set of return codes as below
Reference to previous discussions: https://github.com/openbmc/openbmc/wiki/OpenBMC-PMCI-WG#minutes-82420 https://gerrit.openbmc.org/c/openbmc/pldm/+/51443/comments/e7ed8335_4e144ce0