[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/73] vdpa: Remember last call fd set
From: |
Michael S. Tsirkin |
Subject: |
[PULL 14/73] vdpa: Remember last call fd set |
Date: |
Tue, 7 Mar 2023 20:11:33 -0500 |
From: Eugenio Pérez <eperezma@redhat.com>
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>
Message-Id: <20230303172445.1089785-3-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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 df3a1e92ac..108cd63289 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1227,16 +1227,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,
--
MST
- [PULL 04/73] cryptodev: Introduce server type in QAPI, (continued)
- [PULL 04/73] cryptodev: Introduce server type in QAPI, Michael S. Tsirkin, 2023/03/07
- [PULL 05/73] cryptodev: Introduce 'query-cryptodev' QMP command, Michael S. Tsirkin, 2023/03/07
- [PULL 06/73] cryptodev-builtin: Detect akcipher capability, Michael S. Tsirkin, 2023/03/07
- [PULL 07/73] hmp: add cryptodev info command, Michael S. Tsirkin, 2023/03/07
- [PULL 08/73] cryptodev: Use CryptoDevBackendOpInfo for operation, Michael S. Tsirkin, 2023/03/07
- [PULL 09/73] cryptodev: Account statistics, Michael S. Tsirkin, 2023/03/07
- [PULL 10/73] cryptodev: support QoS, Michael S. Tsirkin, 2023/03/07
- [PULL 11/73] cryptodev: Support query-stats QMP command, Michael S. Tsirkin, 2023/03/07
- [PULL 12/73] MAINTAINERS: add myself as the maintainer for cryptodev, Michael S. Tsirkin, 2023/03/07
- [PULL 13/73] vdpa net: move iova tree creation from init to start, Michael S. Tsirkin, 2023/03/07
- [PULL 14/73] vdpa: Remember last call fd set,
Michael S. Tsirkin <=
- [PULL 15/73] vdpa: Negotiate _F_SUSPEND feature, Michael S. Tsirkin, 2023/03/07
- [PULL 16/73] vdpa: rewind at get_base, not set_base, Michael S. Tsirkin, 2023/03/07
- [PULL 17/73] vdpa: add vhost_vdpa->suspended parameter, Michael S. Tsirkin, 2023/03/07
- [PULL 18/73] vdpa: add vhost_vdpa_suspend, Michael S. Tsirkin, 2023/03/07
- [PULL 19/73] vdpa: move vhost reset after get vring base, Michael S. Tsirkin, 2023/03/07
- [PULL 20/73] vdpa: add vdpa net migration state notifier, Michael S. Tsirkin, 2023/03/07
- [PULL 21/73] vdpa: disable RAM block discard only for the first device, Michael S. Tsirkin, 2023/03/07
- [PULL 22/73] vdpa net: block migration if the device has CVQ, Michael S. Tsirkin, 2023/03/07
- [PULL 24/73] vdpa: block migration if SVQ does not admit a feature, Michael S. Tsirkin, 2023/03/07
- [PULL 26/73] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Michael S. Tsirkin, 2023/03/07