From c31635d438a355f4574d1bf5e1c7ef8b39251552 Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Tue, 31 Oct 2023 07:12:53 -0700 Subject: [PATCH 1/3] softnpu: add enough space to handle jumbo frames --- lib/propolis/src/hw/virtio/softnpu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/propolis/src/hw/virtio/softnpu.rs b/lib/propolis/src/hw/virtio/softnpu.rs index e4635dd39..d9b717b07 100644 --- a/lib/propolis/src/hw/virtio/softnpu.rs +++ b/lib/propolis/src/hw/virtio/softnpu.rs @@ -42,8 +42,8 @@ use rand::Rng; use serde::{Deserialize, Serialize}; use slog::{error, info, warn, Logger}; -// TODO make configurable -const MTU: usize = 1600; +// Transit jumbo frames +const MTU: usize = 9216; const SOFTNPU_CPU_AUX_PORT: u16 = 1000; From d675b1511b5501754f545058dc064cbd43cf049b Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Tue, 31 Oct 2023 07:13:25 -0700 Subject: [PATCH 2/3] p9fs: remove noisy message logging --- lib/propolis/src/hw/virtio/p9fs.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/propolis/src/hw/virtio/p9fs.rs b/lib/propolis/src/hw/virtio/p9fs.rs index bc360317e..6689eb878 100644 --- a/lib/propolis/src/hw/virtio/p9fs.rs +++ b/lib/propolis/src/hw/virtio/p9fs.rs @@ -235,8 +235,6 @@ pub trait P9Handler: Sync + Send + 'static { let len = u32::from_le_bytes(buf[0..4].try_into().unwrap()) as usize; let typ = MessageType::try_from_primitive(buf[4]).unwrap(); - println!("message: {:?}", typ); - match typ { MessageType::Tversion => { self.handle_version(&data[..len], &mut chain, &mem) From a4856eed991c5b4e08dd96558136378291b163c0 Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Tue, 31 Oct 2023 07:16:12 -0700 Subject: [PATCH 3/3] feed clippy --- lib/propolis/src/hw/virtio/softnpu.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/propolis/src/hw/virtio/softnpu.rs b/lib/propolis/src/hw/virtio/softnpu.rs index d9b717b07..f677fd6d5 100644 --- a/lib/propolis/src/hw/virtio/softnpu.rs +++ b/lib/propolis/src/hw/virtio/softnpu.rs @@ -773,8 +773,7 @@ impl ManagementMessageReader { fn read(&self) -> ManagementRequest { loop { - let mut buf = Vec::new(); - buf.resize(10240, 0u8); + let mut buf = vec![0; 10240]; let mut i = 0; let mut in_message = false; loop {