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
Decouple transceivers
server from Front IO readiness
#1588
Conversation
This came together a bit late in the day for me to test this with remote hands, but I think its coming together. I could test some of the easy failure modes where the FPGA rejects the attempt to contact a module which proves out the path for the FPGA-in-the-loop On the host:
The successful read is less interesting in terms of its Hubris
|
c197051
to
562a65c
Compare
This branch depends on oxidecomputer/transceiver-control#200 |
562a65c
to
0a2ab73
Compare
This PR also addresses #1572 |
dd1962b
to
42661e8
Compare
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 minor code style suggestions --- I hope they're useful!
@hawkw they were, thank you!! |
525a1a3
to
08a5a77
Compare
We were able to arrange some hardware in the office to test the case of a missing Front IO board:
So this is good to go once we land oxidecomputer/transceiver-control#200 and do the requisite |
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.
Since you replaced all the unwrap()
in the UDP module with unwrap_lite()
you may want to do the same in main.rs
. I think that'll shrink the size of the executable as less formatting code will be pulled in.
let result = | ||
if self.front_io_board_present == FrontIOStatus::Ready { | ||
self.transceivers.clear_power_fault(mask) | ||
} else { | ||
ModuleResultNoFailure::new(LogicalPortMask(0), mask) | ||
.unwrap_lite() | ||
}; |
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.
This is totally fine and functional. If you'd want to improve the readability of the
if self.front_io_board_present == FrontIOStatus::Ready {
... no front IO board error response
} else {
... actual operation
}
in every handler function a little bit you could consider making a static, pre canned MessageBody::SpResponse(..)
for this case and change the handlers to
if self.front_io_board_present == FrontIOStatus::Ready {
return sp_response_no_front_io_board;
}
... actual operation
That would remove this common check from the parse tree for anyone reading this code.
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.
I DM'd Arjen a bit about this and I'm not going to make any changes here. Given every request type has a corresponding response type (e.g. HostRequest::Status
-> SpResponse::Status
) there's really not a nice way to clean this up. I could make a separate code path that checks front_io_board_present
prior to dropping into the message handler, but that just duplicats the same match structure elsewhere.
22bae15
to
2285533
Compare
Currently the
transceivers
server will loop and await the Front IO board to be ready before entering is service loop. This means that in the case where the Front IO board is not present (or ready),transceivers
server cannot handle any incoming requests, making the host software that is sending those requests unhappy. This change addresses that.This is intended to address #1562