-
Notifications
You must be signed in to change notification settings - Fork 208
Description
IPCC inventory lookups return the following error codes:
hubris/lib/host-sp-messages/src/lib.rs
Lines 261 to 271 in e744ccf
pub enum InventoryDataResult { | |
Ok, | |
/// The given index is larger than our device count | |
InvalidIndex, | |
/// Communication with the device failed in a way that suggests its absence | |
DeviceAbsent, | |
/// Communication with the device failed in some other way | |
DeviceFailed, | |
/// Failed to serialize data | |
SerializationError, | |
} |
Presently, DeviceFailed
is what the SP will return when reading VPD from a device if the device returns an error, or if the data read from the device is malformed or corrupted. For example:
hubris/task/host-sp-comms/src/inventory/compute_sled_common.rs
Lines 133 to 136 in e744ccf
// extract barcode! | |
let identity = oxide_barcode::VpdIdentity::parse(&barcode[..n]) | |
.map_err(|_| InventoryDataResult::DeviceFailed)?; | |
Ok(identity) |
While testing #2229, @citrus-it and I saw that the host software will map the DeviceFailed
result (code 3) to EIO
, so it gets presented as an "I/O error":
gimlet-sn06 # ipcc inventory 0x48
metadata:
version: 0x0
entries: 0x49
J180/ID (72) -- Result: 3 [I/O error]
This doesn't feel quite right to me. I think we should introduce a new error code to represent "we read something from the device, but it didn't parse, had an invalid checksum, or an expected TLV-c tag was not present". Of course, adding new messages to the protocol will require coordination with the host side.