-
Notifications
You must be signed in to change notification settings - Fork 62
Add support for the hiffy network backend
#616
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
Changes from all commits
068eaf6
bf77dec
998f3e1
4eb6436
8ec8d0e
372ab5e
0d0069d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,7 @@ pub trait Core { | |
| pub enum NetAgent { | ||
| UdpRpc, | ||
| DumpAgent, | ||
| Hiffy, | ||
| } | ||
|
|
||
| pub fn attach_dump( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ use humility::reflect::{self, Base, Load, Ptr, Value}; | |
| use indexmap::IndexMap; | ||
| use std::convert::TryInto; | ||
| use std::fmt; | ||
| use zerocopy::{AsBytes, LittleEndian, U16, U64}; | ||
| use zerocopy::{AsBytes, LittleEndian, U16, U32, U64}; | ||
|
|
||
| #[derive(Copy, Clone, Debug, Eq, PartialEq, Load)] | ||
| pub struct TaskDesc { | ||
|
|
@@ -430,6 +430,20 @@ pub struct RpcHeader { | |
| pub nbytes: U16<LittleEndian>, | ||
| } | ||
|
|
||
| /// Double of the RPC types from `hiffy` (with the `net` feature enabled) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth it to extract this into a shared crate somehow to avoid the risk of unsync'd changes?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory, that would be the most robust option – but in practice, we've got a few of these internal message types and they're primitive enough to never change. There's also the fact that if they did change, we'd want to support both versions in Humility, because Humility wants to talk to every Hubris image. |
||
| pub mod hiffy { | ||
| use super::*; | ||
|
|
||
| #[derive(Copy, Clone, Debug, AsBytes)] | ||
| #[repr(C)] | ||
| pub struct RpcHeader { | ||
| pub image_id: U64<LittleEndian>, | ||
| pub version: U16<LittleEndian>, | ||
| pub operation: U16<LittleEndian>, | ||
| pub arg: U32<LittleEndian>, | ||
| } | ||
| } | ||
|
|
||
| impl humility::reflect::Load for CountedRingbuf { | ||
| fn from_value(v: &Value) -> Result<Self> { | ||
| let rb_struct = v.as_struct()?; | ||
|
|
||
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.
Should we make this
non_exhaustiveto make additions like this not a breaking change (after this one)? Do we care about breaking changes?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 don't think so – this is only ever used as an input, so it would be weird for outside the net core to match on it.
In general, we (Hubris / Humility) don't care much about breaking changes to quasi-internal Rust APIs, where no one is consuming them besides us and blast radius is a single repository (no one is using
NetAgentoutside of thehumilityrepo). This could change as Humility gets library-ified, but even then I suspect we'll err on the side of breaking things freely.