From e9bc3320192d72f817379aa4621c1dff15bdee29 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Thu, 14 Dec 2023 08:54:55 -0800 Subject: virtio: RSS support Add RSS support to make use of multiple queues. With 4 RX queues and RSS enabled ping from host to guest vm ip queue use 192.168.2.3 192.168.2.1 2 '' 192.168.2.10 0 '' 192.168.2.5 1 '' 192.168.2.105 3 With 4 RX queues and RSS disabled, queue 0 is always used for all of the above cases Type: improvement Change-Id: I3ca78fd83fce26cbe8f23fee0a9034cb572bacb7 Signed-off-by: Steven Luong --- src/vnet/devices/virtio/virtio_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vnet/devices/virtio/virtio_api.c') diff --git a/src/vnet/devices/virtio/virtio_api.c b/src/vnet/devices/virtio/virtio_api.c index 3197a2fab6d..2e25efff29e 100644 --- a/src/vnet/devices/virtio/virtio_api.c +++ b/src/vnet/devices/virtio/virtio_api.c @@ -111,18 +111,18 @@ vl_api_virtio_pci_create_v2_t_handler (vl_api_virtio_pci_create_v2_t * mp) STATIC_ASSERT (((int) VIRTIO_API_FLAG_BUFFERING == (int) VIRTIO_FLAG_BUFFERING), "virtio buffering api flag mismatch"); + STATIC_ASSERT (((int) VIRTIO_API_FLAG_RSS == (int) VIRTIO_FLAG_RSS), + "virtio rss api flag mismatch"); ap->virtio_flags = clib_net_to_host_u32 (mp->virtio_flags); ap->features = clib_net_to_host_u64 (mp->features); if (ap->virtio_flags & VIRTIO_API_FLAG_GSO) ap->gso_enabled = 1; - else - ap->gso_enabled = 0; if (ap->virtio_flags & VIRTIO_API_FLAG_CSUM_OFFLOAD) ap->checksum_offload_enabled = 1; - else - ap->checksum_offload_enabled = 0; + if (ap->virtio_flags & VIRTIO_API_FLAG_RSS) + ap->rss_enabled = 1; virtio_pci_create_if (vm, ap); -- cgit 1.2.3-korg