mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: add configuration for network offloading features
Add new configuration for offloading features, including Checksum/TSO/UFO, and set these offloading features as enabled by default. Fixes: #4792. Signed-off-by: Yong He <alexyonghe@tencent.com>
This commit is contained in:
@@ -291,6 +291,16 @@ pub struct NetConfig {
|
||||
pub rate_limiter_config: Option<RateLimiterConfig>,
|
||||
#[serde(default)]
|
||||
pub pci_segment: u16,
|
||||
#[serde(default = "default_netconfig_true")]
|
||||
pub offload_tso: bool,
|
||||
#[serde(default = "default_netconfig_true")]
|
||||
pub offload_ufo: bool,
|
||||
#[serde(default = "default_netconfig_true")]
|
||||
pub offload_csum: bool,
|
||||
}
|
||||
|
||||
pub fn default_netconfig_true() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
pub fn default_netconfig_tap() -> Option<String> {
|
||||
@@ -340,6 +350,9 @@ impl Default for NetConfig {
|
||||
fds: None,
|
||||
rate_limiter_config: None,
|
||||
pci_segment: 0,
|
||||
offload_tso: true,
|
||||
offload_ufo: true,
|
||||
offload_csum: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user