[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/6] vdpa: Store x-svq parameter in VhostVDPAState
From: |
Eugenio Pérez |
Subject: |
[PATCH 5/6] vdpa: Store x-svq parameter in VhostVDPAState |
Date: |
Thu, 21 Jul 2022 18:43:30 +0200 |
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 at initialization time. 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 cmdline.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 15ae93bd32..90394fefdf 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -36,6 +36,9 @@ typedef struct VhostVDPAState {
/* Control commands shadow buffers */
void *cvq_cmd_out_buffer, *cvq_cmd_in_buffer;
+
+ /* The device always have SVQ enabled */
+ bool always_svq;
bool started;
} VhostVDPAState;
@@ -561,6 +564,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_tree = iova_tree;
if (!is_datapath) {
--
2.31.1
- [PATCH 0/6] Control VQ is the way net devices use to send changes to the device state, like, Eugenio Pérez, 2022/07/21
- [PATCH 1/6] linux-headers: Update kernel headers to v5.19-rc1, Eugenio Pérez, 2022/07/21
- [PATCH 2/6] vdpa: Use v->shadow_vqs_enabled in vhost_vdpa_svqs_start, Eugenio Pérez, 2022/07/21
- [PATCH 4/6] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap, Eugenio Pérez, 2022/07/21
- [PATCH 5/6] vdpa: Store x-svq parameter in VhostVDPAState,
Eugenio Pérez <=
- [PATCH 3/6] vdpa: Allocate SVQ unconditionally, Eugenio Pérez, 2022/07/21
- [PATCH 6/6] vdpa: Always start CVQ in SVQ mode, Eugenio Pérez, 2022/07/21
- Re: [PATCH 0/6] Control VQ is the way net devices use to send changes to the device state, like, Eugenio Perez Martin, 2022/07/21