Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/viona-api/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 5 additions & 1 deletion crates/viona-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -218,7 +222,7 @@ pub enum ApiVersion {
}
impl ApiVersion {
pub const fn current() -> Self {
Self::V6
Self::V7
}
}
impl PartialEq<ApiVersion> for u32 {
Expand Down
7 changes: 6 additions & 1 deletion lib/propolis/src/hw/virtio/viona.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading