net: Don't override default TAP interface MTU

Adjust MTU logic such that:
1. Apply an MTU to the TAP interface if the user supplies it
2. Always query the TAP interface for the MTU and expose that.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-09-26 15:58:54 +02:00
committed by Rob Bradford
parent 44d66ec531
commit 903c08f8a1
4 changed files with 25 additions and 24 deletions

View File

@@ -2244,7 +2244,7 @@ impl DeviceManager {
match virtio_devices::vhost_user::Net::new(
id.clone(),
net_cfg.mac,
Some(net_cfg.mtu),
net_cfg.mtu,
vu_cfg,
server,
self.seccomp_action.clone(),
@@ -2275,7 +2275,7 @@ impl DeviceManager {
None,
Some(net_cfg.mac),
&mut net_cfg.host_mac,
None,
net_cfg.mtu,
self.force_iommu | net_cfg.iommu,
net_cfg.num_queues,
net_cfg.queue_size,
@@ -2293,6 +2293,7 @@ impl DeviceManager {
id.clone(),
fds,
Some(net_cfg.mac),
net_cfg.mtu,
self.force_iommu | net_cfg.iommu,
net_cfg.queue_size,
self.seccomp_action.clone(),
@@ -2312,7 +2313,7 @@ impl DeviceManager {
Some(net_cfg.mask),
Some(net_cfg.mac),
&mut net_cfg.host_mac,
Some(net_cfg.mtu),
net_cfg.mtu,
self.force_iommu | net_cfg.iommu,
net_cfg.num_queues,
net_cfg.queue_size,