From 7620b20db52837d0077fea7b8f84d3b564d55411 Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 16 Sep 2026 17:01:21 +0000 Subject: [PATCH] bump viona API version to match stlouis This brings ominous tidings for users of Propolis on illumos distributions that are not Helios: the illumos-gate viona API version is still 6, and will continue to be until https://code.oxide.computer/c/illumos-gate/+/775 is upstreamed. viona version 7 includes new ioctls which Propolis does not *yet* use, but will soon. At that point, Propolis will not run on other illumos distributions until the MAC filter table ioctls are available upstream. or worse, some inadvertent change gives viona API version 7 a different meaning upstream... --- crates/viona-api/src/ffi.rs | 2 +- crates/viona-api/src/lib.rs | 6 +++++- lib/propolis/src/hw/virtio/viona.rs | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/viona-api/src/ffi.rs b/crates/viona-api/src/ffi.rs index e67f97d11..45fc32482 100644 --- a/crates/viona-api/src/ffi.rs +++ b/crates/viona-api/src/ffi.rs @@ -154,7 +154,7 @@ pub struct vioc_set_params { /// This is the viona interface version which viona_api expects to operate /// against. All constants and structs defined by the crate are done so in /// terms of that specific version. -pub const VIONA_CURRENT_INTERFACE_VERSION: u32 = 6; +pub const VIONA_CURRENT_INTERFACE_VERSION: u32 = 7; /// Maximum size of packed nvlists used in viona parameter ioctls pub const VIONA_MAX_PARAM_NVLIST_SZ: usize = 4096; diff --git a/crates/viona-api/src/lib.rs b/crates/viona-api/src/lib.rs index d8535972c..a2e5fd96e 100644 --- a/crates/viona-api/src/lib.rs +++ b/crates/viona-api/src/lib.rs @@ -197,6 +197,10 @@ fn minor(meta: &std::fs::Metadata) -> u32 { #[repr(u32)] #[derive(Copy, Clone)] pub enum ApiVersion { + /// Adds ioctls in support of CTRL_RX MAC commands; setting a multicast MAC + /// filter table as well as controlling the device's unicast MAC. + V7 = 7, + /// Adds multi-queue support and change the data structure for per-queue /// interrupt polling to a compact bitmap. V6 = 6, @@ -218,7 +222,7 @@ pub enum ApiVersion { } impl ApiVersion { pub const fn current() -> Self { - Self::V6 + Self::V7 } } impl PartialEq for u32 { diff --git a/lib/propolis/src/hw/virtio/viona.rs b/lib/propolis/src/hw/virtio/viona.rs index 4f2dc8ea6..168044ce0 100644 --- a/lib/propolis/src/hw/virtio/viona.rs +++ b/lib/propolis/src/hw/virtio/viona.rs @@ -1883,8 +1883,13 @@ use bits::*; pub(crate) fn check_api_version() -> Result<(), crate::api_version::Error> { let vers = viona_api::api_version()?; - // when setting up a vNIC, Propolis will unconditionally do the SET_PAIRS + // When setting up a vNIC, Propolis will unconditionally do the SET_PAIRS // ioctl, which requires V6. + // + // The virtio-nic implementation here is still correct on a V7 viona, where + // we use promiscuity exclusively to control what traffic is filtered from + // guests. A future change to Propolis will use the new-in-V7 filter ioctls + // at which point we will change "want" to match that new baseline. let want = viona_api::ApiVersion::V6 as u32; if vers < want {