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:
Yong He
2022-12-20 20:04:08 +08:00
committed by Rob Bradford
parent 06e583c9ab
commit 3494080e2f
6 changed files with 130 additions and 26 deletions

View File

@@ -2334,6 +2334,9 @@ impl DeviceManager {
.map(|s| s.to_versioned_state())
.transpose()
.map_err(DeviceManagerError::RestoreGetState)?,
net_cfg.offload_tso,
net_cfg.offload_ufo,
net_cfg.offload_csum,
) {
Ok(vun_device) => vun_device,
Err(e) => {
@@ -2371,6 +2374,9 @@ impl DeviceManager {
.try_clone()
.map_err(DeviceManagerError::EventFd)?,
state,
net_cfg.offload_tso,
net_cfg.offload_ufo,
net_cfg.offload_csum,
)
.map_err(DeviceManagerError::CreateVirtioNet)?,
))
@@ -2389,6 +2395,9 @@ impl DeviceManager {
.try_clone()
.map_err(DeviceManagerError::EventFd)?,
state,
net_cfg.offload_tso,
net_cfg.offload_ufo,
net_cfg.offload_csum,
)
.map_err(DeviceManagerError::CreateVirtioNet)?,
))
@@ -2411,6 +2420,9 @@ impl DeviceManager {
.try_clone()
.map_err(DeviceManagerError::EventFd)?,
state,
net_cfg.offload_tso,
net_cfg.offload_ufo,
net_cfg.offload_csum,
)
.map_err(DeviceManagerError::CreateVirtioNet)?,
))