-
Notifications
You must be signed in to change notification settings - Fork 3
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 MeasurementKind::Dimensionless
#291
Conversation
This commit adds a `Dimensionless` variant to the `MeasurementKind` enum to represent measurements without units. This is intended to be used to represent AMD CPU T<sub>ctl</sub> thermal values, which are a unitless value from 0-100 representing a kind of "abstract thermal throttling danger level" --- see oxidecomputer/hubris#1881 for details on why we need to differentiate this from other temperature measurements. I wasn't totally sure as to the best approach for naming this variant. I note that the name of the enum is "measurement kind", not "measurement unit", so it doesn't directly represent the unit of the measurement but rather, the kind of quantity being measured. So, perhaps this ought to be a `CpuTctl` variant or similar, to *specifically* represent T<sub>ctl</sub> measurements. If other dimensionless values show up in future, they would then have their own variant. I'm open to being convicned either way --- what do others think?
I think I'd vote for But this is an area well outside where I've been any time recently, so I'm happy to defer to others too. @mkeeter might have opinions too; he worked on the SP <-> IPCC <-> host inventory path with @rmustacc. |
I'm also weakly in favor of Because this is a change to the SP-MGS protocol, you should also
This ensures that we get helpful error reporting if there's a mismatch between SP and MGS; specifically, MGS can report "I failed to serialize this message, but it's on v16 while I'm only on v15, so that's not totally surprising". |
Okay, I think y'all have convinced me that this should be Tctl-specific. And, thanks @mkeeter for the instructions on how to update the protocol! I'll make those changes shortly. |
Okay, I changed the variant to be just for Tctl, bumped the version, and added a test. |
|
||
#[test] | ||
fn measurement_kinds() { | ||
let mut out = [0; SpResponse::MAX_SIZE]; |
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.
Nit: this could be MeasurementKind::MAX_SIZE
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.
Normally, I open a Hubris PR staged against the MGS branch before merging it (to make sure the Hubris integration doesn't require further changes in MGS).
In this case, the change is simple enough that doesn't seem necessary.
Yeah, I would be quite happy to leave this open until the Hubris-side change is done. But, in this case, I also feel like, well...if fixing this in Hubris actually requires more protocol changes, I'll eat a ST-Link live at Oxcon. :) |
This commit adds a
CpuTctl
variant to theMeasurementKind
enum. Thisis intended to be used to represent AMD CPU Tctl thermal
values, which are a unitless value from 0-100 representing a kind of
"abstract thermal throttling danger level" --- see
oxidecomputer/hubris#1881 for details on why we need to differentiate
this from other temperature measurements.