virtio-devices: net: Add support for VIRTIO_NET_F_CTRL_GUEST_OFFLOADS

This allows the guest to reprogram the offload settings and mitigates
issues where the Linux kernel tries to reprogram the queues even when
the feature is not advertised.

Fixes: #2528

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2021-04-28 15:35:50 +01:00
committed by Sebastien Boeuf
parent 9ef1a68539
commit 51a93bc635
4 changed files with 47 additions and 9 deletions
+2 -1
View File
@@ -315,6 +315,7 @@ impl Net {
rate_limiter_config: Option<RateLimiterConfig>,
) -> Result<Self> {
let mut avail_features = 1 << VIRTIO_NET_F_CSUM
| 1 << VIRTIO_NET_F_CTRL_GUEST_OFFLOADS
| 1 << VIRTIO_NET_F_GUEST_CSUM
| 1 << VIRTIO_NET_F_GUEST_ECN
| 1 << VIRTIO_NET_F_GUEST_TSO4
@@ -511,7 +512,7 @@ impl VirtioDevice for Net {
mem: mem.clone(),
kill_evt,
pause_evt,
ctrl_q: NetCtrl::new(cvq_queue, cvq_queue_evt),
ctrl_q: NetCtrl::new(cvq_queue, cvq_queue_evt, Some(self.taps.clone())),
};
let paused = self.common.paused.clone();