[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/15] vdpa: Remember last call fd set
From: |
Eugenio Pérez |
Subject: |
[PATCH v4 02/15] vdpa: Remember last call fd set |
Date: |
Fri, 24 Feb 2023 16:54:25 +0100 |
As SVQ can be enabled dynamically at any time, it needs to store call fd
always.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-vdpa.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 542e003101..4f72a52a43 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1240,16 +1240,16 @@ static int vhost_vdpa_set_vring_call(struct vhost_dev
*dev,
struct vhost_vring_file *file)
{
struct vhost_vdpa *v = dev->opaque;
+ int vdpa_idx = file->index - dev->vq_index;
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, vdpa_idx);
+ /* Remember last call fd because we can switch to SVQ anytime. */
+ vhost_svq_set_svq_call_fd(svq, file->fd);
if (v->shadow_vqs_enabled) {
- int vdpa_idx = file->index - dev->vq_index;
- VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, vdpa_idx);
-
- vhost_svq_set_svq_call_fd(svq, file->fd);
return 0;
- } else {
- return vhost_vdpa_set_vring_dev_call(dev, file);
}
+
+ return vhost_vdpa_set_vring_dev_call(dev, file);
}
static int vhost_vdpa_get_features(struct vhost_dev *dev,
--
2.31.1
- [PATCH v4 00/15] Dynamically switch to vhost shadow virtqueues at vdpa net migration, Eugenio Pérez, 2023/02/24
- [PATCH v4 01/15] vdpa net: move iova tree creation from init to start, Eugenio Pérez, 2023/02/24
- [PATCH v4 02/15] vdpa: Remember last call fd set,
Eugenio Pérez <=
- [PATCH v4 04/15] vdpa: Negotiate _F_SUSPEND feature, Eugenio Pérez, 2023/02/24
- [PATCH v4 03/15] vdpa: stop svq at vhost_vdpa_dev_start(false), Eugenio Pérez, 2023/02/24
- [PATCH v4 05/15] vdpa: move vhost reset after get vring base, Eugenio Pérez, 2023/02/24
- [PATCH v4 09/15] vdpa: add vdpa net migration state notifier, Eugenio Pérez, 2023/02/24
- [PATCH v4 14/15] vdpa net: allow VHOST_F_LOG_ALL, Eugenio Pérez, 2023/02/24
- [PATCH v4 06/15] vdpa: add vhost_vdpa->suspended parameter, Eugenio Pérez, 2023/02/24