Pldm improvement - #379
Open
CourtneyDrant wants to merge 4 commits into
Open
Conversation
CourtneyDrant
force-pushed
the
pldm-improvement
branch
2 times, most recently
from
July 28, 2026 22:10
f487f1c to
d16c6b8
Compare
CourtneyDrant
force-pushed
the
pldm-improvement
branch
from
July 28, 2026 22:31
d16c6b8 to
539fea4
Compare
CourtneyDrant
requested review from
FerralCoder,
cfrantz,
leongross,
rusty1968 and
wmaroneAMD
July 30, 2026 01:36
leongross
reviewed
Jul 30, 2026
| if initiator_active { | ||
| let pldm_len = self | ||
| .cmd_interface | ||
| .generate_initiator_request(&mut fw_buf) |
Member
There was a problem hiding this comment.
So what is the state when generate_initiator_request generates a buf len of 0? Does that imply an error? This would then be handled with the ? and we could get rid of the pldm_len > 0?
| resp_len.checked_add(1).ok_or(PldmServiceError::Overflow)?; | ||
| let resp = fw_buf | ||
| .get_mut(..resp_total_len) | ||
| .ok_or(PldmServiceError::Overflow)?; |
Member
There was a problem hiding this comment.
Is Overflow an accurate error to use here?
| //! ▼ ▼ | ||
| //! ┌──────────────────────────────────────────┐ | ||
| //! │ openprot-mctp-api │ Stack<C: MctpClient> | ||
| //! └───────────┬───────────────────────────────┘ |
Comment on lines
+18
to
+19
| //! ┌──────────────────────────────────────────┐ | ||
| //! │ openprot-pldm-service │◄── this crate |
| loop { | ||
| // Fragmenter requires the output buffer to be at least the payload | ||
| // MTU (255) plus the 4-byte MCTP transport header. | ||
| let mut buf = [0u8; 255 + 4]; |
Member
There was a problem hiding this comment.
Suggested change
| let mut buf = [0u8; 255 + 4]; | |
| let mut buf = [0u8; MTU + 4]; |
| activated: Cell<bool>, | ||
| } | ||
|
|
||
| impl FdOps for FakeFdOps { |
Member
There was a problem hiding this comment.
nit: just my opinion, use Mock* instead of Fake*
| } | ||
|
|
||
| fn get_mtu(&self) -> usize { | ||
| 255 |
Member
There was a problem hiding this comment.
It seems as if base_host and firmware_update_hosts share quite a lot of mock and setup code. Can this somehow be unified to reduce code duplication?
| │ | ||
| ▼ | ||
| ┌──────────────────────────────────────────┐ | ||
| │ openprot-pldm-service │◄── this crate |
| ▼ ▼ | ||
| ┌──────────────────────────────────────────┐ | ||
| │ openprot-mctp-api │ Stack<C: MctpClient> | ||
| └───────────┬───────────────────────────────┘ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request was done to improve on a previous design of the pldm-service. It has one process which is the Firmware Device. Firmware Device is the OpenProt Pldm terminus for FW update. It will loop to receive messages from the UA and when ready, will request data from the UA. The loop insures that between each request the terminus will check for UA requests to receive status or cancel an update.