55 lines
1.9 KiB
Diff
55 lines
1.9 KiB
Diff
|
|
From 7a2278d9cdd9ac2a74bb9745fdf555395ff8dcd7 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
|
||
|
|
Date: Thu, 15 Dec 2022 12:31:42 +0100
|
||
|
|
Subject: [PATCH] vdpa: store x-svq parameter in VhostVDPAState
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
CVQ can be shadowed two ways:
|
||
|
|
- Device has x-svq=on parameter (current way)
|
||
|
|
- The device can isolate CVQ in its own vq group
|
||
|
|
|
||
|
|
QEMU needs to check for the second condition dynamically, because CVQ
|
||
|
|
index is not known before the driver ack the features. Since this is
|
||
|
|
dynamic, the CVQ isolation could vary with different conditions, making
|
||
|
|
it possible to go from "not isolated group" to "isolated".
|
||
|
|
|
||
|
|
Saving the cmdline parameter in an extra field so we never disable CVQ
|
||
|
|
SVQ in case the device was started with x-svq cmdline.
|
||
|
|
|
||
|
|
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
|
||
|
|
Acked-by: Jason Wang <jasowang@redhat.com>
|
||
|
|
Message-Id: <20221215113144.322011-11-eperezma@redhat.com>
|
||
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: fangyi <eric.fangyi@huawei.com>
|
||
|
|
---
|
||
|
|
net/vhost-vdpa.c | 3 +++
|
||
|
|
1 file changed, 3 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
|
||
|
|
index cb1cc2523d..7adba2c2b6 100644
|
||
|
|
--- a/net/vhost-vdpa.c
|
||
|
|
+++ b/net/vhost-vdpa.c
|
||
|
|
@@ -37,6 +37,8 @@ typedef struct VhostVDPAState {
|
||
|
|
void *cvq_cmd_out_buffer;
|
||
|
|
virtio_net_ctrl_ack *status;
|
||
|
|
|
||
|
|
+ /* The device always have SVQ enabled */
|
||
|
|
+ bool always_svq;
|
||
|
|
bool started;
|
||
|
|
} VhostVDPAState;
|
||
|
|
|
||
|
|
@@ -575,6 +577,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
|
||
|
|
|
||
|
|
s->vhost_vdpa.device_fd = vdpa_device_fd;
|
||
|
|
s->vhost_vdpa.index = queue_pair_index;
|
||
|
|
+ s->always_svq = svq;
|
||
|
|
s->vhost_vdpa.shadow_vqs_enabled = svq;
|
||
|
|
s->vhost_vdpa.iova_range = iova_range;
|
||
|
|
s->vhost_vdpa.iova_tree = iova_tree;
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|