From 58d25b3cccff967aa10a56f8f87692ca946aad7d Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 3 Nov 2021 17:22:03 +0100 Subject: [PATCH] virtio-devices: net: Improve throughput with virtio features By merging receive buffers through the VIRTIO_NET_F_MRG_RXBUF feature, as well as enabling the use of indirect descriptors through VIRTIO_RING_F_INDIRECT_DESC feature, we achieve better throughput for the virtio-net device without hurting its latency. Signed-off-by: Sebastien Boeuf --- virtio-devices/src/net.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index 96f89c68f..bf88d8eba 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -34,7 +34,9 @@ use std::{collections::HashMap, convert::TryInto}; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; use virtio_bindings::bindings::virtio_net::*; -use virtio_bindings::bindings::virtio_ring::VIRTIO_RING_F_EVENT_IDX; +use virtio_bindings::bindings::virtio_ring::{ + VIRTIO_RING_F_EVENT_IDX, VIRTIO_RING_F_INDIRECT_DESC, +}; use virtio_queue::Queue; use vm_memory::{ByteValued, GuestMemoryAtomic}; use vm_migration::VersionMapped; @@ -398,7 +400,9 @@ impl Net { | 1 << VIRTIO_NET_F_HOST_TSO4 | 1 << VIRTIO_NET_F_HOST_TSO6 | 1 << VIRTIO_NET_F_HOST_UFO + | 1 << VIRTIO_NET_F_MRG_RXBUF | 1 << VIRTIO_RING_F_EVENT_IDX + | 1 << VIRTIO_RING_F_INDIRECT_DESC | 1 << VIRTIO_F_VERSION_1; if iommu {