ed5979
From 28163d7d61b6b0b8312b78d57dabc8f44bf39c46 Mon Sep 17 00:00:00 2001
ed5979
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
ed5979
Date: Thu, 15 Dec 2022 12:31:42 +0100
ed5979
Subject: [PATCH 10/14] vdpa: store x-svq parameter in VhostVDPAState
ed5979
MIME-Version: 1.0
ed5979
Content-Type: text/plain; charset=UTF-8
ed5979
Content-Transfer-Encoding: 8bit
ed5979
ed5979
RH-Author: Eugenio Pérez <eperezma@redhat.com>
ed5979
RH-MergeRequest: 136: vDPA ASID support in Qemu
ed5979
RH-Bugzilla: 2104412
ed5979
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ed5979
RH-Acked-by: Cindy Lu <lulu@redhat.com>
ed5979
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
ed5979
RH-Commit: [10/13] 53f3b2698b4a5caca434f55e4300103a78778548 (eperezmartin/qemu-kvm)
ed5979
ed5979
CVQ can be shadowed two ways:
ed5979
- Device has x-svq=on parameter (current way)
ed5979
- The device can isolate CVQ in its own vq group
ed5979
ed5979
QEMU needs to check for the second condition dynamically, because CVQ
ed5979
index is not known before the driver ack the features. Since this is
ed5979
dynamic, the CVQ isolation could vary with different conditions, making
ed5979
it possible to go from "not isolated group" to "isolated".
ed5979
ed5979
Saving the cmdline parameter in an extra field so we never disable CVQ
ed5979
SVQ in case the device was started with x-svq cmdline.
ed5979
ed5979
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
ed5979
Acked-by: Jason Wang <jasowang@redhat.com>
ed5979
Message-Id: <20221215113144.322011-11-eperezma@redhat.com>
ed5979
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
ed5979
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ed5979
(cherry picked from commit 7f211a28fd5482f76583988beecd8ee61588d45e)
ed5979
---
ed5979
 net/vhost-vdpa.c | 3 +++
ed5979
 1 file changed, 3 insertions(+)
ed5979
ed5979
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
ed5979
index c2f319eb88..1757f1d028 100644
ed5979
--- a/net/vhost-vdpa.c
ed5979
+++ b/net/vhost-vdpa.c
ed5979
@@ -38,6 +38,8 @@ typedef struct VhostVDPAState {
ed5979
     void *cvq_cmd_out_buffer;
ed5979
     virtio_net_ctrl_ack *status;
ed5979
 
ed5979
+    /* The device always have SVQ enabled */
ed5979
+    bool always_svq;
ed5979
     bool started;
ed5979
 } VhostVDPAState;
ed5979
 
ed5979
@@ -576,6 +578,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
ed5979
 
ed5979
     s->vhost_vdpa.device_fd = vdpa_device_fd;
ed5979
     s->vhost_vdpa.index = queue_pair_index;
ed5979
+    s->always_svq = svq;
ed5979
     s->vhost_vdpa.shadow_vqs_enabled = svq;
ed5979
     s->vhost_vdpa.iova_range = iova_range;
ed5979
     s->vhost_vdpa.iova_tree = iova_tree;
ed5979
-- 
ed5979
2.31.1
ed5979