a386348c | 05-Apr-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
utils: Rename crc32() to pldm_edac_crc32()
Chip away at transitioning the library API surface to a consistent symbol prefix.
Change-Id: I1abd96407867ddf8390cb9fbba9a8085478f08dd Signed-off-by: Andr
utils: Rename crc32() to pldm_edac_crc32()
Chip away at transitioning the library API surface to a consistent symbol prefix.
Change-Id: I1abd96407867ddf8390cb9fbba9a8085478f08dd Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
59dce78e | 01-Apr-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: base: Add encode req & decode resp for NegotiateTransferParameters
Added encode/decode APIs for NegotiateTransferParameters command (0x07) which is defined in DSP0240 Version 1.2.0 section 9.6.
dsp: base: Add encode req & decode resp for NegotiateTransferParameters
Added encode/decode APIs for NegotiateTransferParameters command (0x07) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I9920e1c9c9e6d9e5999d568d8d20b4c80a1d8726 Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
58273fb7 | 26-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfHeartbeat command
Added encode/decode APIs for DfHeartbeat command(0x03) which is defined in DSP0242 Version 1.0.0 Section: 9.6.
Change-Id: Icf8ccbb57d
dsp: file: Add encode req & decode resp for DfHeartbeat command
Added encode/decode APIs for DfHeartbeat command(0x03) which is defined in DSP0242 Version 1.0.0 Section: 9.6.
Change-Id: Icf8ccbb57da74182f4fd0cc0cf49a49861abfbc1 Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
7286ca64 | 26-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfClose command
Added encode/decode APIs for DfClose command(0x02) which is defined in DSP0242 Version 1.0.0 Section: 9.3.
Change-Id: Ie4e82781497a0c1251
dsp: file: Add encode req & decode resp for DfClose command
Added encode/decode APIs for DfClose command(0x02) which is defined in DSP0242 Version 1.0.0 Section: 9.3.
Change-Id: Ie4e82781497a0c1251d7e64b83a6f88a99dfad4e Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
cf26f2a3 | 18-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfOpen command
Added encode/decode APIs for DfOpen command(0x01) which is defined in DSP0242 Version 1.0.0 Section: 9.2.
Change-Id: I5a975a7ae2bbd4115898
dsp: file: Add encode req & decode resp for DfOpen command
Added encode/decode APIs for DfOpen command(0x01) which is defined in DSP0242 Version 1.0.0 Section: 9.2.
Change-Id: I5a975a7ae2bbd4115898486984ad96016590b04b Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
ed4ad707 | 12-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
platform: Add decode API for File Descriptor PDR
Add decode API to decode File Descriptor PDR raw data to `pldm_file_descriptor_pdr` struct. The referred File Descriptor PDR is based on DSP0248 1.3.
platform: Add decode API for File Descriptor PDR
Add decode API to decode File Descriptor PDR raw data to `pldm_file_descriptor_pdr` struct. The referred File Descriptor PDR is based on DSP0248 1.3.0 Section 28.30 Table 108.
Change-Id: Ifcfae68d8bf6a723cf132b851621b068e2118d0e Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
8836784f | 16-Oct-2024 |
Dung Cao <dung@os.amperecomputing.com> |
dsp: base: Add encode req & decode resp for MultipartReceive command
Added encode/decode APIs for MultipartReceive command(0x09) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I5
dsp: base: Add encode req & decode resp for MultipartReceive command
Added encode/decode APIs for MultipartReceive command(0x09) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I577997978728cbaa9132e0685cdd85e277427554 Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
a1896967 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Rework error handling to improve soundness
Design the implementation to uphold the invariant that a non-negative remaining value implies the cursor pointer is valid, and that under other con
msgbuf: Rework error handling to improve soundness
Design the implementation to uphold the invariant that a non-negative remaining value implies the cursor pointer is valid, and that under other conditions error values must be observed by the msgbuf user. The former is tested with assertions in the implementation. The latter is enforced by construction.
With this change, all msgbuf instances for which pldm_msgbuf_init_errno() succeeds must be either completed or discarded by calls to the pldm_msgbuf_complete*() or pldm_msgbuf_discard() APIs respectively.
We then build on the properties that:
- pldm_msgbuf_init_errno() is marked with the warn_unused_result function attribute
- pldm_msgbuf_init_errno() returns errors for invalid buffer configurations
- The complete and discard APIs are marked with the warn_unused_result function attribute
- The complete APIs test for negative remaining values and return an error if encountered.
- The discard API propagates the provided error code
Together these provide the foundation to ensure that buffer access errors are (eventually) detected.
A msgbuf object is always in one of the uninitialized, valid, invalid, or completed states. The states are defined as follows:
- Uninitialized: Undefined values for remaining and cursor
- Valid: cursor points to a valid object, remaining is both non-negative and describes a range contained within the object pointed to by cursor
- Invalid: The value of remaining is negative. The value of cursor is unspecified.
- Completed: the value of remaining is INTMAX_MIN and cursor is NULL
msgbuf instances must always be in the completed state by the time their storage is reclaimed. To enforce this, PLDM_MSGBUF_DEFINE_P() is introduced both to simplify definition of related variables, and to exploit the compiler's 'cleanup' attribute. The cleanup function associated with the msgbuf object asserts that the referenced object is in the completed state.
From there, update the implementations of the msgbuf APIs such that exceeding implementation type limits forces the msgbuf object to the invalid state (in addition to returning an error value) to relieve the caller from testing the result of all API invocations.
Change-Id: I4d78ddc5f567d4148f2f6d8f3e7570e97c316bbb Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
70d21c97 | 04-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Rename 'destroy' APIs to 'complete'
Change the language to better reflect the intent, with the impending introduction of the ability to 'discard' a msgbuf instance.
Change-Id: Idbb79dcc2587
msgbuf: Rename 'destroy' APIs to 'complete'
Change the language to better reflect the intent, with the impending introduction of the ability to 'discard' a msgbuf instance.
Change-Id: Idbb79dcc2587a8baef67ffd405e0bc77e66fe995 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
53b08675 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Initialize msgbuf after argument tests
The msgbuf APIs are being reworked to improve soundness and error reporting. Prior to introducing some new requirements on its users, ens
dsp: firmware_update: Initialize msgbuf after argument tests
The msgbuf APIs are being reworked to improve soundness and error reporting. Prior to introducing some new requirements on its users, ensure its init/destroy sequences have minimal code spans.
This effort surfaced a problem with a test configuration for encode_get_downstream_firmware_parameters_req() which was passing an invalid transfer operation flag. Previously this was masked by a buffer-length validation failure.
Change-Id: I7259ac86d696da425ac9d919e6864dfb238d8996 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
5192e2e2 | 26-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Add pldm_pdr_delete_by_record_handle() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the record handle of the PDR record.
Change-Id: I44f5568aa024660f7d370d9a2
pdr: Add pldm_pdr_delete_by_record_handle() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the record handle of the PDR record.
Change-Id: I44f5568aa024660f7d370d9a2c6b3f9286d96ed8 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
bc40dd5a | 02-Aug-2024 |
Archana Kakani <archana.kakani@ibm.com> |
pdr: Fix for Entity Association PDR looping
While normalizing the Entity association PDR, record handle is passed to the library function. Considering PDR contains logical and physical contained ent
pdr: Fix for Entity Association PDR looping
While normalizing the Entity association PDR, record handle is passed to the library function. Considering PDR contains logical and physical contained entities, two pdrs with same record handle are created.
To fix the issue, we are propagating the recently used record handle from the pldm_pdr_add to entity_association_pdr_add. Then incrementing the record handle before creating next PDR.
gitlint-ignore: B1, UC1 Fixes: 25ddbccfae0e ("pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle()") Change-Id: Ifaa5694cabe7ad38d8881f0b7be0a79d9d3e06c0 Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
show more ...
|
779e9dbd | 20-Feb-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Wrap static errno variants of package APIs
Begin the process of migrating package parsing APIs away from using PLDM protocol completion codes for signaling errors.
For now kee
dsp: firmware_update: Wrap static errno variants of package APIs
Begin the process of migrating package parsing APIs away from using PLDM protocol completion codes for signaling errors.
For now keep the new symbols internal. They will eventually be exposed and the current stable APIs deprecated.
Change-Id: Ieb67c43ebb0782b9da530c52de99b59edca4a648 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
e5c3f148 | 13-Dec-2024 |
Unive Tien <unive.tien.wiwynn@gmail.com> |
dsp: firmware_update: Stabilize downstream devices related ABI
These ABIs are now required by PLDM to query information from downstream devices[1]. Mark them as stable to make the symbols visible.
dsp: firmware_update: Stabilize downstream devices related ABI
These ABIs are now required by PLDM to query information from downstream devices[1]. Mark them as stable to make the symbols visible.
[1]: https://gerrit.openbmc.org/c/openbmc/pldm/+/75390
Change-Id: I6892fb6ffa878b8530e57ce338fe02048d9b08f7 Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
show more ...
|
94e2d754 | 12-Dec-2024 |
Archana Kakani <archana.kakani@ibm.com> |
pdr: Handle removal of the last contained entity from EA PDR
After removing the contained entity from the entity association PDR, if there is no other contained entity present, we need to remove the
pdr: Handle removal of the last contained entity from EA PDR
After removing the contained entity from the entity association PDR, if there is no other contained entity present, we need to remove the entity association PDR. Also modified the testcase to delete all the entities from the entity association PDR.
Fixes: b31e4c6c4663 ("pdr: Remove contained entity from PDR repo") Change-Id: If426314a571e91d178e8ae802a49bb7a3746080e Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
show more ...
|
c4d1c8bc | 17-Dec-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
dsp: firmware_update: Avoid integer overflow
A large fw_device_pkg_data_length could cause uint16_t calc_min_record_length to wrap around. Instead use a size_t.
Change-Id: I1e0ee5a350d82cb477fd0955
dsp: firmware_update: Avoid integer overflow
A large fw_device_pkg_data_length could cause uint16_t calc_min_record_length to wrap around. Instead use a size_t.
Change-Id: I1e0ee5a350d82cb477fd0955a11ded659a5c5933 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
cf9a2df3 | 07-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
dsp: Add FD side firmware_update encode/decode
This implements FD counterparts for firmware update (type 5) encoding/decoding.
In tests after encoding a message, a subsequent decode is performed an
dsp: Add FD side firmware_update encode/decode
This implements FD counterparts for firmware update (type 5) encoding/decoding.
In tests after encoding a message, a subsequent decode is performed and the outputs are compared. This tests the FD portion of the message decoding.
Change-Id: I5454acee19588b0679a9b0218588fc4c0a66b01d Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
5a5129b0 | 03-Dec-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Add iterator for downstream device parameters
The previous attempt where we invented a struct that made it possible to hold full-sized version strings was awkward on several fr
dsp: firmware_update: Add iterator for downstream device parameters
The previous attempt where we invented a struct that made it possible to hold full-sized version strings was awkward on several fronts. Replace it with an iterator in the style of the downstream device descriptors.
Change-Id: If9b83f4704b3068de9113af7451051c086f39969 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
6a97b79e | 08-Dec-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Expand "params" in symbol names
Try to keep the names aligned with the spec so that they're more easily searched for. We can abbreviate other words such as request, response, l
dsp: firmware_update: Expand "params" in symbol names
Try to keep the names aligned with the spec so that they're more easily searched for. We can abbreviate other words such as request, response, length etc as necessary.
Change-Id: Ia5a2c93c153c70107be0fcddb1043b2e08cdd026 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
d2f8a7e3 | 26-Nov-2024 |
Unive Tien <unive.tien.wiwynn@gmail.com> |
dsp: firmware_update: pack decomposed parameters to struct
There're two APIs that have decomposed parameters: `encode_query_downstream_identifiers_req()` and `encode_get_downstream_firmware_params_r
dsp: firmware_update: pack decomposed parameters to struct
There're two APIs that have decomposed parameters: `encode_query_downstream_identifiers_req()` and `encode_get_downstream_firmware_params_req(), which against the checklist of API/ABI stabilization, squashed those parameters to a struct to meet the request.
Change-Id: Ia952251cf8dcaeba060985e759e1d7aadf7b5b4d Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
show more ...
|
71e935cf | 25-Nov-2024 |
Unive Tien <unive.tien.wiwynn@gmail.com> |
dsp: firmware_update: Change return type of downstream device ABI/APIs
So far all of the downstream device related ABI/APIs were marked as `TESTING`, before stabilize them, any deprecated code shoul
dsp: firmware_update: Change return type of downstream device ABI/APIs
So far all of the downstream device related ABI/APIs were marked as `TESTING`, before stabilize them, any deprecated code should be removed, including PLDM Completion Code, therefore, change all of the return type of these to `ERRNO`.
Change-Id: Ie6b390fcc1c91a425f9181ec4ce4495729baab51 Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
show more ...
|
eb8bb17f | 25-Nov-2024 |
Unive Tien <unive.tien.wiwynn@gmail.com> |
dsp: base: add encode_pldm_header_only_errno()
Currently, `encode_pldm_header_only()` returns PLDM Completion Code, which is deprecated, but most of this API's use case were internally inside libpld
dsp: base: add encode_pldm_header_only_errno()
Currently, `encode_pldm_header_only()` returns PLDM Completion Code, which is deprecated, but most of this API's use case were internally inside libpldm itself, therefore, add `encode_pldm_header_only_errno()` as an internal API.
Change-Id: I87822a4f6afe8aa8eb87034179c37341d7ca4190 Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
show more ...
|
ae05d5e5 | 11-Oct-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
dsp: pdr: Replace ENOKEY with ENOENT
Make pldm_pdr_find_child_container_id_index_range_exclude() return ENOENT, since that is a standard errno. ENOKEY is Linux specific.
pldm_pdr_find_child_contain
dsp: pdr: Replace ENOKEY with ENOENT
Make pldm_pdr_find_child_container_id_index_range_exclude() return ENOENT, since that is a standard errno. ENOKEY is Linux specific.
pldm_pdr_find_child_container_id_index_range_exclude() is marked as TESTING ABI, so the change in error code should be OK.
Change-Id: I3fb3076b236e4e3b1c31f13d819dcaca38076a5d Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
3a2c6589 | 07-Nov-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Iterators for downstream device descriptors
Provide an ergonomic and safe means to iterate through downstream devices and their descriptors while avoiding the need to allocate.
dsp: firmware_update: Iterators for downstream device descriptors
Provide an ergonomic and safe means to iterate through downstream devices and their descriptors while avoiding the need to allocate. The strategy leaves the library user to make their own choices about how the data is handled.
The user-facing portion of the change takes the form of two new macros, to be nested inside one another:
``` foreach_pldm_downstream_device(...) { foreach_pldm_downstream_device_descriptor(...) { // Do something with the device-specific descriptor } } ```
Examples uses are provided in the documentation and in changes to the test suite.
Change-Id: I6e79454b94868da73f318635bcaae57cd51fbf97 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
56ef86a0 | 12-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
dsp: platform: Fix extra parentheses
No functionality change, avoids a warning.
gitlint-ignore: UC1 Fixes: 98e137dede32 ("dsp: platform: Fix decode_set_event_receiver_req()") Change-Id: I38eae0d5e9
dsp: platform: Fix extra parentheses
No functionality change, avoids a warning.
gitlint-ignore: UC1 Fixes: 98e137dede32 ("dsp: platform: Fix decode_set_event_receiver_req()") Change-Id: I38eae0d5e91c79e545b5bcca3a93bd4634435b62 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|