-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add APOB messages to host_sp_comms #2006
base: master
Are you sure you want to change the base?
Conversation
hf.bonus_sector_erase(offset) | ||
.map_err(|err| APOBError::EraseFailed { offset, err })?; | ||
} else { | ||
// Read back the page and confirm that it's all empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this fail if there's a blip in the IPCC path and the host resends an APOB
request? (I'm not sure what the expectations are for the offsets the host is providing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some mostly kind of annoying nitpicks.
// APOB is followed by a binary data blob, which should be written to flash | ||
APOB { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suuuper nitpicky, feel free to disregard me: I think the recommended Rust naming conventions for casing is that acronyms should be treated as a "word" in camel-case, and only the first letter should be uppercased, so this would be:
// APOB is followed by a binary data blob, which should be written to flash | |
APOB { | |
// APOB is followed by a binary data blob, which should be written to flash | |
Apob { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that other variants of this enum follow this convention (e.g. GetMacIdentity
rather than GetMACIdentity
; RotRequest
rather than ROTRequest
, and so on).
@@ -134,6 +134,11 @@ enum Trace { | |||
#[count(children)] | |||
message: SpToHost, | |||
}, | |||
APOBWriteError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly, i think this would be
APOBWriteError { | |
ApobWriteError { |
@@ -160,6 +165,31 @@ enum Timers { | |||
TxPeriodicZeroByte, | |||
} | |||
|
|||
#[derive(Copy, Clone, Debug, Eq, PartialEq, counters::Count)] | |||
enum APOBError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaaaand my stupid capitalization thing again:
enum APOBError { | |
enum ApobError { |
offset: u64, | ||
#[count(children)] | ||
err: APOBError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth leaving a comment here indicating that the offset
field in the ringbuf entry is the initial offset of the write, while the offset
fields in the APOBError
variant are the offset of the page we were writing when the error actually occurred? Having two fields with the same names but potentially differing values could be confusing.
Or, perhaps we should call the APOBError
field "page_offset" or something, to distinguish these?
See https://github.com/oxidecomputer/stlouis/issues/707, https://github.com/oxidecomputer/rfd/pull/855 , https://github.com/oxidecomputer/amd-host-image-builder/pull/222