[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v5 16/26] vhost-vdpa: Take into account SVQ in vhost_vdpa_set
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v5 16/26] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call |
Date: |
Fri, 29 Oct 2021 20:35:15 +0200 |
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-vdpa.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 64f71bd51b..89d77f3452 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -758,16 +758,27 @@ static int vhost_vdpa_set_vring_kick(struct vhost_dev
*dev,
}
}
+static int vhost_vdpa_set_vring_dev_call(struct vhost_dev *dev,
+ struct vhost_vring_file *file)
+{
+ trace_vhost_vdpa_set_vring_call(dev, file->index, file->fd);
+ return vhost_vdpa_call(dev, VHOST_SET_VRING_CALL, file);
+}
+
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 = vhost_vdpa_get_vq_index(dev, file->index);
- trace_vhost_vdpa_set_vring_call(dev, file->index, file->fd);
-
v->call_fd[vdpa_idx] = file->fd;
- return vhost_vdpa_call(dev, VHOST_SET_VRING_CALL, file);
+ if (v->shadow_vqs_enabled) {
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, vdpa_idx);
+ vhost_svq_set_guest_call_notifier(svq, file->fd);
+ return 0;
+ } else {
+ return vhost_vdpa_set_vring_dev_call(dev, file);
+ }
}
static int vhost_vdpa_get_features(struct vhost_dev *dev,
--
2.27.0
- [RFC PATCH v5 06/26] vhost: Add VhostShadowVirtqueue, (continued)
- [RFC PATCH v5 06/26] vhost: Add VhostShadowVirtqueue, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 07/26] vdpa: Save kick_fd in vhost-vdpa, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 08/26] vdpa: Add vhost_svq_get_dev_kick_notifier, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 09/26] vdpa: Add vhost_svq_set_svq_kick_fd, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 10/26] vhost: Add Shadow VirtQueue kick forwarding capabilities, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 11/26] vhost: Handle host notifiers in SVQ, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 12/26] vhost: Route guest->host notification through shadow virtqueue, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 13/26] Add vhost_svq_get_svq_call_notifier, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 14/26] Add vhost_svq_set_guest_call_notifier, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 15/26] vdpa: Save call_fd in vhost-vdpa, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 16/26] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call,
Eugenio Pérez <=
- [RFC PATCH v5 17/26] vhost: Route host->guest notification through shadow virtqueue, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 18/26] virtio: Add vhost_shadow_vq_get_vring_addr, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 19/26] vdpa: ack VIRTIO_F_QUEUE_STATE if device supports it, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 20/26] vhost: Add vhost_svq_valid_device_features to shadow vq, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 21/26] vhost: Add vhost_svq_valid_guest_features to shadow vq, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 22/26] vhost: Shadow virtqueue buffers forwarding, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 23/26] util: Add iova_tree_alloc, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 24/26] vhost: Add VhostIOVATree, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 25/26] vhost: Use a tree to store memory mappings, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 26/26] vdpa: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2021/10/29