Conversation
d116c1e to
54b42af
Compare
|
Marking this a ready-for-review now that oxidecomputer/humility#616 is out |
54b42af to
b95a834
Compare
lzrd
left a comment
There was a problem hiding this comment.
I would fix the repeated literal constants.
It would be nice to see all of the loop timing and retry constants be together.
| sleeps = 0; | ||
| // Exponentially backoff our sleep value, but no more than 250ms | ||
| if sleeps == 10 { | ||
| sleep_ms = core::cmp::min(sleep_ms * 10, 250); |
There was a problem hiding this comment.
Same literal constant repeated. Make it symbolic.
There was a problem hiding this comment.
Can you suggest names for these constants? The first 10 is "number of iterations to run between updates to sleep_ms", the second 10 is "scale factor between updates"; neither of them have a good pithy name.
(This is also unchanged from the previous code, just indented)
| rstack, | ||
| &mut *HIFFY_SCRATCH.borrow_mut(), | ||
| check, | ||
| ); |
There was a problem hiding this comment.
We're in an intentional insecure mode. But, do we at least get an integrity check on the network transport? There isn't one at this layer. This is debug/YOLO mode, but a light check to scope a data corruption error would be good.
Maybe just a comment on data integrity for now.
There was a problem hiding this comment.
We use IPv6 UDP, which has a 16-bit checksum. This is true for all Hubris network activity, so calling out Hiffy as uniquely bad doesn't make sense to me.
b95a834 to
1dc7422
Compare
1dc7422 to
9dfe770
Compare
For too long, a network-attached Humility has only been able to run a subset of
hiffyprograms (ones that exclusively use theSendoperations, using theudprpchack). This PR adds anetfeature to thehiffytask, restoring it to full usefulness when network-attached.hiffyaccepts three messages:For simplicity, these messages only write to RAM. Even the
HiffyKickmessage doesn't actually start execution itself; it just sets theHIFFY_KICKvariable, which is checked the main loop. This mimics the behavior of the debugger.Interestingly, we don't need any new infrastructure to read the results; we can use the existing RAM-reading infrastructure.
Unfortunately, Github is butchering the diff here. The existing code (look for kick, run program) is unchanged but for indentation, because we have two notifications (timer and
netactivity). If the newnetnotification fires, then we handle the packet in a newnet::Stateobject.I'm opening this as a draft while I polish up the Humility side, but it's ready for review now.