mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: config: Switch NetConfig to use PciDeviceCommonConfig
Switch NetConfig over to using the newly extracted struct members as used by all PCI based devices. The use of #[serde(flatten)] means that this change has no impact on the JSON format that the data is stored as. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -122,7 +122,7 @@ mod fds_helper {
|
|||||||
|
|
||||||
impl ConfigWithFDs for NetConfig {
|
impl ConfigWithFDs for NetConfig {
|
||||||
fn id(&self) -> Option<&str> {
|
fn id(&self) -> Option<&str> {
|
||||||
self.id.as_deref()
|
self.pci_common.id.as_deref()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fds_from_http_body(&self) -> Option<&[RawFd]> {
|
fn fds_from_http_body(&self) -> Option<&[RawFd]> {
|
||||||
|
|||||||
@@ -1554,11 +1554,6 @@ impl NetConfig {
|
|||||||
.unwrap_or(Toggle(true))
|
.unwrap_or(Toggle(true))
|
||||||
.0;
|
.0;
|
||||||
let mtu = parser.convert("mtu").map_err(Error::ParseNetwork)?;
|
let mtu = parser.convert("mtu").map_err(Error::ParseNetwork)?;
|
||||||
let iommu = parser
|
|
||||||
.convert::<Toggle>("iommu")
|
|
||||||
.map_err(Error::ParseNetwork)?
|
|
||||||
.unwrap_or(Toggle(false))
|
|
||||||
.0;
|
|
||||||
let queue_size = parser
|
let queue_size = parser
|
||||||
.convert("queue_size")
|
.convert("queue_size")
|
||||||
.map_err(Error::ParseNetwork)?
|
.map_err(Error::ParseNetwork)?
|
||||||
@@ -1577,15 +1572,10 @@ impl NetConfig {
|
|||||||
.convert("vhost_mode")
|
.convert("vhost_mode")
|
||||||
.map_err(Error::ParseNetwork)?
|
.map_err(Error::ParseNetwork)?
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let id = parser.get("id");
|
|
||||||
let fds = parser
|
let fds = parser
|
||||||
.convert::<IntegerList>("fd")
|
.convert::<IntegerList>("fd")
|
||||||
.map_err(Error::ParseNetwork)?
|
.map_err(Error::ParseNetwork)?
|
||||||
.map(|v| v.0.iter().map(|e| *e as i32).collect());
|
.map(|v| v.0.iter().map(|e| *e as i32).collect());
|
||||||
let pci_segment = parser
|
|
||||||
.convert("pci_segment")
|
|
||||||
.map_err(Error::ParseNetwork)?
|
|
||||||
.unwrap_or_default();
|
|
||||||
let bw_size = parser
|
let bw_size = parser
|
||||||
.convert("bw_size")
|
.convert("bw_size")
|
||||||
.map_err(Error::ParseNetwork)?
|
.map_err(Error::ParseNetwork)?
|
||||||
@@ -1637,23 +1627,23 @@ impl NetConfig {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let pci_common = PciDeviceCommonConfig::parse(net)?;
|
||||||
|
|
||||||
let config = NetConfig {
|
let config = NetConfig {
|
||||||
|
pci_common,
|
||||||
tap,
|
tap,
|
||||||
ip,
|
ip,
|
||||||
mask,
|
mask,
|
||||||
mac,
|
mac,
|
||||||
host_mac,
|
host_mac,
|
||||||
mtu,
|
mtu,
|
||||||
iommu,
|
|
||||||
num_queues,
|
num_queues,
|
||||||
queue_size,
|
queue_size,
|
||||||
vhost_user,
|
vhost_user,
|
||||||
vhost_socket,
|
vhost_socket,
|
||||||
vhost_mode,
|
vhost_mode,
|
||||||
id,
|
|
||||||
fds,
|
fds,
|
||||||
rate_limiter_config,
|
rate_limiter_config,
|
||||||
pci_segment,
|
|
||||||
offload_tso,
|
offload_tso,
|
||||||
offload_ufo,
|
offload_ufo,
|
||||||
offload_csum,
|
offload_csum,
|
||||||
@@ -1662,6 +1652,8 @@ impl NetConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate(&self, vm_config: &VmConfig) -> ValidationResult<()> {
|
pub fn validate(&self, vm_config: &VmConfig) -> ValidationResult<()> {
|
||||||
|
self.pci_common.validate(vm_config)?;
|
||||||
|
|
||||||
if self.num_queues < 2 {
|
if self.num_queues < 2 {
|
||||||
return Err(ValidationError::VnetQueueLowerThan2(self.num_queues));
|
return Err(ValidationError::VnetQueueLowerThan2(self.num_queues));
|
||||||
}
|
}
|
||||||
@@ -1689,23 +1681,10 @@ impl NetConfig {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.vhost_user && self.iommu {
|
if self.vhost_user && self.pci_common.iommu {
|
||||||
return Err(ValidationError::IommuNotSupported);
|
return Err(ValidationError::IommuNotSupported);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(platform_config) = vm_config.platform.as_ref() {
|
|
||||||
if self.pci_segment >= platform_config.num_pci_segments {
|
|
||||||
return Err(ValidationError::InvalidPciSegment(self.pci_segment));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(iommu_segments) = platform_config.iommu_segments.as_ref()
|
|
||||||
&& iommu_segments.contains(&self.pci_segment)
|
|
||||||
&& !self.iommu
|
|
||||||
{
|
|
||||||
return Err(ValidationError::OnIommuSegment(self.pci_segment));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(mtu) = self.mtu
|
if let Some(mtu) = self.mtu
|
||||||
&& mtu < virtio_devices::net::MIN_MTU
|
&& mtu < virtio_devices::net::MIN_MTU
|
||||||
{
|
{
|
||||||
@@ -2778,6 +2757,7 @@ impl RestoreConfig {
|
|||||||
for net_fds in vm_config.net.iter().flatten() {
|
for net_fds in vm_config.net.iter().flatten() {
|
||||||
if let Some(expected_fds) = &net_fds.fds {
|
if let Some(expected_fds) = &net_fds.fds {
|
||||||
let expected_id = net_fds
|
let expected_id = net_fds
|
||||||
|
.pci_common
|
||||||
.id
|
.id
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect("Invalid 'NetConfig' with empty 'id' for VM restore.");
|
.expect("Invalid 'NetConfig' with empty 'id' for VM restore.");
|
||||||
@@ -3066,9 +3046,9 @@ impl VmConfig {
|
|||||||
return Err(ValidationError::VhostUserRequiresSharedMemory);
|
return Err(ValidationError::VhostUserRequiresSharedMemory);
|
||||||
}
|
}
|
||||||
net.validate(self)?;
|
net.validate(self)?;
|
||||||
self.iommu |= net.iommu;
|
self.iommu |= net.pci_common.iommu;
|
||||||
|
|
||||||
Self::validate_identifier(&mut id_list, &net.id)?;
|
Self::validate_identifier(&mut id_list, &net.pci_common.id)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3564,7 +3544,7 @@ impl VmConfig {
|
|||||||
// Remove if net device
|
// Remove if net device
|
||||||
if let Some(net) = self.net.as_mut() {
|
if let Some(net) = self.net.as_mut() {
|
||||||
let len = net.len();
|
let len = net.len();
|
||||||
net.retain(|dev| dev.id.as_ref().map(|id| id.as_ref()) != Some(id));
|
net.retain(|dev| dev.pci_common.id.as_ref().map(|id| id.as_ref()) != Some(id));
|
||||||
removed |= net.len() != len;
|
removed |= net.len() != len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4148,22 +4128,20 @@ mod unit_tests {
|
|||||||
|
|
||||||
fn net_fixture() -> NetConfig {
|
fn net_fixture() -> NetConfig {
|
||||||
NetConfig {
|
NetConfig {
|
||||||
|
pci_common: PciDeviceCommonConfig::default(),
|
||||||
tap: None,
|
tap: None,
|
||||||
ip: None,
|
ip: None,
|
||||||
mask: None,
|
mask: None,
|
||||||
mac: MacAddr::parse_str("de:ad:be:ef:12:34").unwrap(),
|
mac: MacAddr::parse_str("de:ad:be:ef:12:34").unwrap(),
|
||||||
host_mac: Some(MacAddr::parse_str("12:34:de:ad:be:ef").unwrap()),
|
host_mac: Some(MacAddr::parse_str("12:34:de:ad:be:ef").unwrap()),
|
||||||
mtu: None,
|
mtu: None,
|
||||||
iommu: false,
|
|
||||||
num_queues: 2,
|
num_queues: 2,
|
||||||
queue_size: 256,
|
queue_size: 256,
|
||||||
vhost_user: false,
|
vhost_user: false,
|
||||||
vhost_socket: None,
|
vhost_socket: None,
|
||||||
vhost_mode: VhostMode::Client,
|
vhost_mode: VhostMode::Client,
|
||||||
id: None,
|
|
||||||
fds: None,
|
fds: None,
|
||||||
rate_limiter_config: None,
|
rate_limiter_config: None,
|
||||||
pci_segment: 0,
|
|
||||||
offload_tso: true,
|
offload_tso: true,
|
||||||
offload_ufo: true,
|
offload_ufo: true,
|
||||||
offload_csum: true,
|
offload_csum: true,
|
||||||
@@ -4181,7 +4159,10 @@ mod unit_tests {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
NetConfig::parse("mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,id=mynet0")?,
|
NetConfig::parse("mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,id=mynet0")?,
|
||||||
NetConfig {
|
NetConfig {
|
||||||
id: Some("mynet0".to_owned()),
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
id: Some("mynet0".to_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -4214,9 +4195,12 @@ mod unit_tests {
|
|||||||
"mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,num_queues=4,queue_size=1024,iommu=on"
|
"mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,num_queues=4,queue_size=1024,iommu=on"
|
||||||
)?,
|
)?,
|
||||||
NetConfig {
|
NetConfig {
|
||||||
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
iommu: true,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
num_queues: 4,
|
num_queues: 4,
|
||||||
queue_size: 1024,
|
queue_size: 1024,
|
||||||
iommu: true,
|
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -4840,19 +4824,28 @@ id=\"{id}\",pci_segment={pci_segment},queue_sizes={queue_sizes}"
|
|||||||
preserved_fds: None,
|
preserved_fds: None,
|
||||||
net: Some(vec![
|
net: Some(vec![
|
||||||
NetConfig {
|
NetConfig {
|
||||||
id: Some("net0".to_owned()),
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
id: Some("net0".to_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
num_queues: 2,
|
num_queues: 2,
|
||||||
fds: Some(vec![-1, -1, -1, -1]),
|
fds: Some(vec![-1, -1, -1, -1]),
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
},
|
},
|
||||||
NetConfig {
|
NetConfig {
|
||||||
id: Some("net1".to_owned()),
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
id: Some("net1".to_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
num_queues: 1,
|
num_queues: 1,
|
||||||
fds: Some(vec![-1, -1]),
|
fds: Some(vec![-1, -1]),
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
},
|
},
|
||||||
NetConfig {
|
NetConfig {
|
||||||
id: Some("net2".to_owned()),
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
id: Some("net2".to_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
fds: None,
|
fds: None,
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
},
|
},
|
||||||
@@ -4947,7 +4940,10 @@ id=\"{id}\",pci_segment={pci_segment},queue_sizes={queue_sizes}"
|
|||||||
resume: false,
|
resume: false,
|
||||||
};
|
};
|
||||||
snapshot_vm_config.net = Some(vec![NetConfig {
|
snapshot_vm_config.net = Some(vec![NetConfig {
|
||||||
id: Some("net2".to_owned()),
|
pci_common: PciDeviceCommonConfig {
|
||||||
|
id: Some("net2".to_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
fds: None,
|
fds: None,
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
}]);
|
}]);
|
||||||
@@ -5330,8 +5326,11 @@ id=\"{id}\",pci_segment={pci_segment},queue_sizes={queue_sizes}"
|
|||||||
..platform_fixture()
|
..platform_fixture()
|
||||||
});
|
});
|
||||||
still_valid_config.net = Some(vec![NetConfig {
|
still_valid_config.net = Some(vec![NetConfig {
|
||||||
iommu: true,
|
pci_common: PciDeviceCommonConfig {
|
||||||
pci_segment: 1,
|
iommu: true,
|
||||||
|
pci_segment: 1,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
}]);
|
}]);
|
||||||
still_valid_config.validate().unwrap();
|
still_valid_config.validate().unwrap();
|
||||||
@@ -5398,8 +5397,11 @@ id=\"{id}\",pci_segment={pci_segment},queue_sizes={queue_sizes}"
|
|||||||
..platform_fixture()
|
..platform_fixture()
|
||||||
});
|
});
|
||||||
invalid_config.net = Some(vec![NetConfig {
|
invalid_config.net = Some(vec![NetConfig {
|
||||||
iommu: false,
|
pci_common: PciDeviceCommonConfig {
|
||||||
pci_segment: 1,
|
iommu: false,
|
||||||
|
pci_segment: 1,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
..net_fixture()
|
..net_fixture()
|
||||||
}]);
|
}]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
@@ -2937,11 +2937,11 @@ impl DeviceManager {
|
|||||||
&mut self,
|
&mut self,
|
||||||
net_cfg: &mut NetConfig,
|
net_cfg: &mut NetConfig,
|
||||||
) -> DeviceManagerResult<MetaVirtioDevice> {
|
) -> DeviceManagerResult<MetaVirtioDevice> {
|
||||||
let id = if let Some(id) = &net_cfg.id {
|
let id = if let Some(id) = &net_cfg.pci_common.id {
|
||||||
id.clone()
|
id.clone()
|
||||||
} else {
|
} else {
|
||||||
let id = self.next_device_name(NET_DEVICE_NAME_PREFIX)?;
|
let id = self.next_device_name(NET_DEVICE_NAME_PREFIX)?;
|
||||||
net_cfg.id = Some(id.clone());
|
net_cfg.pci_common.id = Some(id.clone());
|
||||||
id
|
id
|
||||||
};
|
};
|
||||||
info!("Creating virtio-net device: {net_cfg:?}");
|
info!("Creating virtio-net device: {net_cfg:?}");
|
||||||
@@ -2999,7 +2999,7 @@ impl DeviceManager {
|
|||||||
Some(net_cfg.mac),
|
Some(net_cfg.mac),
|
||||||
&mut net_cfg.host_mac,
|
&mut net_cfg.host_mac,
|
||||||
net_cfg.mtu,
|
net_cfg.mtu,
|
||||||
self.force_iommu | net_cfg.iommu,
|
self.force_iommu | net_cfg.pci_common.iommu,
|
||||||
net_cfg.num_queues,
|
net_cfg.num_queues,
|
||||||
net_cfg.queue_size,
|
net_cfg.queue_size,
|
||||||
self.seccomp_action.clone(),
|
self.seccomp_action.clone(),
|
||||||
@@ -3020,7 +3020,7 @@ impl DeviceManager {
|
|||||||
fds,
|
fds,
|
||||||
Some(net_cfg.mac),
|
Some(net_cfg.mac),
|
||||||
net_cfg.mtu,
|
net_cfg.mtu,
|
||||||
self.force_iommu | net_cfg.iommu,
|
self.force_iommu | net_cfg.pci_common.iommu,
|
||||||
net_cfg.queue_size,
|
net_cfg.queue_size,
|
||||||
self.seccomp_action.clone(),
|
self.seccomp_action.clone(),
|
||||||
net_cfg.rate_limiter_config,
|
net_cfg.rate_limiter_config,
|
||||||
@@ -3050,7 +3050,7 @@ impl DeviceManager {
|
|||||||
Some(net_cfg.mac),
|
Some(net_cfg.mac),
|
||||||
&mut net_cfg.host_mac,
|
&mut net_cfg.host_mac,
|
||||||
net_cfg.mtu,
|
net_cfg.mtu,
|
||||||
self.force_iommu | net_cfg.iommu,
|
self.force_iommu | net_cfg.pci_common.iommu,
|
||||||
net_cfg.num_queues,
|
net_cfg.num_queues,
|
||||||
net_cfg.queue_size,
|
net_cfg.queue_size,
|
||||||
self.seccomp_action.clone(),
|
self.seccomp_action.clone(),
|
||||||
@@ -3083,9 +3083,9 @@ impl DeviceManager {
|
|||||||
|
|
||||||
Ok(MetaVirtioDevice {
|
Ok(MetaVirtioDevice {
|
||||||
virtio_device,
|
virtio_device,
|
||||||
iommu: net_cfg.iommu,
|
iommu: net_cfg.pci_common.iommu,
|
||||||
id,
|
id,
|
||||||
pci_segment: net_cfg.pci_segment,
|
pci_segment: net_cfg.pci_common.pci_segment,
|
||||||
dma_handler: None,
|
dma_handler: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -4737,7 +4737,7 @@ impl DeviceManager {
|
|||||||
let nets = config.net.as_deref_mut().unwrap();
|
let nets = config.net.as_deref_mut().unwrap();
|
||||||
let net_dev_cfg = nets
|
let net_dev_cfg = nets
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|net| net.id.as_deref() == Some(id))
|
.find(|net| net.pci_common.id.as_deref() == Some(id))
|
||||||
// unwrap: the device could not have been removed without an ID
|
// unwrap: the device could not have been removed without an ID
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fds = net_dev_cfg.fds.take().unwrap_or(Vec::new());
|
let fds = net_dev_cfg.fds.take().unwrap_or(Vec::new());
|
||||||
@@ -5067,9 +5067,9 @@ impl DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_net(&mut self, net_cfg: &mut NetConfig) -> DeviceManagerResult<PciDeviceInfo> {
|
pub fn add_net(&mut self, net_cfg: &mut NetConfig) -> DeviceManagerResult<PciDeviceInfo> {
|
||||||
self.validate_identifier(&net_cfg.id)?;
|
self.validate_identifier(&net_cfg.pci_common.id)?;
|
||||||
|
|
||||||
if net_cfg.iommu && !self.is_iommu_segment(net_cfg.pci_segment) {
|
if net_cfg.pci_common.iommu && !self.is_iommu_segment(net_cfg.pci_common.pci_segment) {
|
||||||
return Err(DeviceManagerError::InvalidIommuHotplug);
|
return Err(DeviceManagerError::InvalidIommuHotplug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1879,7 +1879,9 @@ impl RequestHandler for Vmm {
|
|||||||
for net in restored_nets.iter() {
|
for net in restored_nets.iter() {
|
||||||
for net_config in vm_net_configs.iter_mut() {
|
for net_config in vm_net_configs.iter_mut() {
|
||||||
// update only if the net dev is backed by FDs
|
// update only if the net dev is backed by FDs
|
||||||
if net_config.id.as_ref() == Some(&net.id) && net_config.fds.is_some() {
|
if net_config.pci_common.id.as_ref() == Some(&net.id)
|
||||||
|
&& net_config.fds.is_some()
|
||||||
|
{
|
||||||
net_config.fds.clone_from(&net.fds);
|
net_config.fds.clone_from(&net.fds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,6 +350,8 @@ pub fn default_diskconfig_sparse() -> bool {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct NetConfig {
|
pub struct NetConfig {
|
||||||
|
#[serde(flatten)]
|
||||||
|
pub pci_common: PciDeviceCommonConfig,
|
||||||
#[serde(default = "default_netconfig_tap")]
|
#[serde(default = "default_netconfig_tap")]
|
||||||
pub tap: Option<String>,
|
pub tap: Option<String>,
|
||||||
pub ip: Option<IpAddr>,
|
pub ip: Option<IpAddr>,
|
||||||
@@ -360,8 +362,6 @@ pub struct NetConfig {
|
|||||||
pub host_mac: Option<MacAddr>,
|
pub host_mac: Option<MacAddr>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub mtu: Option<u16>,
|
pub mtu: Option<u16>,
|
||||||
#[serde(default)]
|
|
||||||
pub iommu: bool,
|
|
||||||
#[serde(default = "default_netconfig_num_queues")]
|
#[serde(default = "default_netconfig_num_queues")]
|
||||||
pub num_queues: usize,
|
pub num_queues: usize,
|
||||||
#[serde(default = "default_netconfig_queue_size")]
|
#[serde(default = "default_netconfig_queue_size")]
|
||||||
@@ -371,8 +371,6 @@ pub struct NetConfig {
|
|||||||
pub vhost_socket: Option<String>,
|
pub vhost_socket: Option<String>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub vhost_mode: VhostMode,
|
pub vhost_mode: VhostMode,
|
||||||
#[serde(default)]
|
|
||||||
pub id: Option<String>,
|
|
||||||
// Special deserialize handling:
|
// Special deserialize handling:
|
||||||
// Therefore, we don't serialize FDs, and whatever value is here after
|
// Therefore, we don't serialize FDs, and whatever value is here after
|
||||||
// deserialization is invalid.
|
// deserialization is invalid.
|
||||||
@@ -383,8 +381,6 @@ pub struct NetConfig {
|
|||||||
pub fds: Option<Vec<i32>>,
|
pub fds: Option<Vec<i32>>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub rate_limiter_config: Option<RateLimiterConfig>,
|
pub rate_limiter_config: Option<RateLimiterConfig>,
|
||||||
#[serde(default)]
|
|
||||||
pub pci_segment: u16,
|
|
||||||
#[serde(default = "default_netconfig_true")]
|
#[serde(default = "default_netconfig_true")]
|
||||||
pub offload_tso: bool,
|
pub offload_tso: bool,
|
||||||
#[serde(default = "default_netconfig_true")]
|
#[serde(default = "default_netconfig_true")]
|
||||||
|
|||||||
Reference in New Issue
Block a user