From c8a5e190a52b34c3d4b4b5a30e8d1e8da8cc5de8 Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Wed, 14 Dec 2022 10:40:07 -0800 Subject: [PATCH 1/2] virtio early break, bump dlpi, no pub header-check Break out of the guest packet processing loop early when there are no bytes to read. This has a non-trivial impact on latency reduction. Bump the dlpi dependency. The latest version is less chatty with logging and the bug previously referenced is no longer an issue since we are not using the async API exported by the dlpi create. Set publish = false on the header check libraries. When importing propolis libraries, because both viona-api and bhyve-api have a sub-crate called header-check, cargo starts screaming. --- crates/bhyve-api/header-check/Cargo.toml | 1 + crates/viona-api/header-check/Cargo.toml | 1 + lib/propolis/Cargo.toml | 3 +-- lib/propolis/src/hw/virtio/softnpu.rs | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/bhyve-api/header-check/Cargo.toml b/crates/bhyve-api/header-check/Cargo.toml index 2cf8caa04..5697f7284 100644 --- a/crates/bhyve-api/header-check/Cargo.toml +++ b/crates/bhyve-api/header-check/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" authors = ["Patrick Mooney "] license = "MPL-2.0" build = "build.rs" +publish = false [dependencies] bhyve_api = { path = ".." } diff --git a/crates/viona-api/header-check/Cargo.toml b/crates/viona-api/header-check/Cargo.toml index 7f5a9b18d..138d464d8 100644 --- a/crates/viona-api/header-check/Cargo.toml +++ b/crates/viona-api/header-check/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" authors = ["Patrick Mooney "] license = "MPL-2.0" build = "build.rs" +publish = false [dependencies] viona_api = { path = ".." } diff --git a/lib/propolis/Cargo.toml b/lib/propolis/Cargo.toml index b4440b274..f7fa81681 100644 --- a/lib/propolis/Cargo.toml +++ b/lib/propolis/Cargo.toml @@ -65,10 +65,9 @@ branch = "main" optional = true package = "softnpu" -#see: https://github.com/oxidecomputer/dlpi-sys/issues/1 [dependencies.dlpi] git = "https://github.com/oxidecomputer/dlpi-sys" -rev = "eb4dffeef88f86294d939aeb5521509ea3d59b69" +branch = "main" optional = true [dev-dependencies] diff --git a/lib/propolis/src/hw/virtio/softnpu.rs b/lib/propolis/src/hw/virtio/softnpu.rs index 9ace91aad..6f539c321 100644 --- a/lib/propolis/src/hw/virtio/softnpu.rs +++ b/lib/propolis/src/hw/virtio/softnpu.rs @@ -330,6 +330,8 @@ impl PciVirtioSoftNpuPort { if n != 10 { if n > 0 { push_used = true; + } else { + break; } warn!(self.log, "failed to read virtio mystery bytes ({})", n); //break; From d46b094a47e0c3f1087d41e2588281ea50a063f5 Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Wed, 14 Dec 2022 10:47:33 -0800 Subject: [PATCH 2/2] feed clippy --- bin/propolis-standalone/src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/propolis-standalone/src/main.rs b/bin/propolis-standalone/src/main.rs index 7b803620b..947c91a61 100644 --- a/bin/propolis-standalone/src/main.rs +++ b/bin/propolis-standalone/src/main.rs @@ -264,10 +264,9 @@ impl Instance { match state { State::Run => { if first_boot { - ent.start().expect(&format!( - "entity {} failed to start", - record.name() - )); + ent.start().unwrap_or_else(|_| { + panic!("entity {} failed to start", record.name()) + }); } else { ent.resume(); }