| commit | 6121773c62669476e706d0415ad8e5808c4dae08 | [log] [tgz] |
|---|---|---|
| author | Chau Ly <chaul@amperecomputing.com> | Fri Aug 15 14:03:43 2025 +0000 |
| committer | Andrew Jeffery <andrew@codeconstruct.com.au> | Fri Sep 05 02:03:27 2025 +0000 |
| tree | de4cb3d04f2f9f17f24ba459c295027eba471af0 | |
| parent | fdf065b50a498b4581ee39ed5b90b23136916378 [diff] |
dsp: base: Don't extract MultipartReceive resp's CRC once complete According to DSP0240 v1.2.0 - Table 17 MultipartReceive Request and Response Message Format, `DataIntegrityChecksum` field: - Shall be included with all part transfers. - Shall be omitted in response to a request message where TransferOperation was set to XFER_COMPLETE or XFER_ABORT. The only possible TransferFlag in a response for a request, where TransferOperation was set to `XFER_COMPLETE` or `XFER_ABORT`, is `ACKNOWLEDGE_COMPLETION`. So this is the only condition to ignore the `DataIntegrityChecksum` field. In the current implementation, `DataIntegrityChecksum` field is only extracted when `TransferOperation` is `END` or `START_AND_END` and this is incorrect. Therefore, this commit updates `decode_pldm_base_multipart_receive_resp` function to not extract `DataIntegrityChecksum` only when `TransferFlag` field is `ACKNOWLEDGE_COMPLETION`. This also adds 2 more unit tests for the API, which are respectively decoding an `ACKNOWLEDGE_COMPLETION` response with a redundant checksum field and decoding a non-`ACKNOWLEDGE_COMPLETION` response without a checksum field. Change-Id: I325a6393eaabfecc08f758dcae417470dde65efb Fixes: 8836784f1e06 ("dsp: base: Add encode req & decode resp for MultipartReceive command") Signed-off-by: Chau Ly <chaul@amperecomputing.com>
This is a library which deals with the encoding and decoding of PLDM messages. It should be possible to use this library by projects other than OpenBMC, and hence certain constraints apply to it:
Source files are named according to the PLDM Type, for eg base.[h/c], fru.[h/c], etc.
Given a PLDM command "foo", the library will provide the following API: For the Requester function:
encode_foo_req() - encode a foo request decode_foo_resp() - decode a response to foo
For the Responder function:
decode_foo_req() - decode a foo request encode_foo_resp() - encode a response to foo
The library also provides API to pack and unpack PLDM headers.
libpldm is configured and built using meson. Python's pip or pipx can be used to install a recent version on your machine:
pipx install meson
Once meson is installed:
meson setup build && meson compile -C build
meson test -C build
libpldmComponents of the library ABI[^1] (loosely, functions) are separated into three categories:
[^1]: "library API + compiler ABI = library ABI"
Applications depending on libpldm should aim to only use functions from the stable category. However, this may not always be possible. What to do when required functions fall into the deprecated or testing categories is discussed in CONTRIBUTING.
libpldm is maintained with the expectation that users move between successive releases when upgrading. This constraint allows the library to reintroduce types and functions of the same name in subsequent releases in the knowledge that there are no remaining users of previous definitions. While strategies are employed to avoid breaking existing APIs unnecessarily, the library is still to reach maturity, and we must allow for improvements to be made in the design.