[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/31] vhost: dd vhost_svq_get_svq_call_notifier
From: |
Eugenio Pérez |
Subject: |
[PATCH 07/31] vhost: dd vhost_svq_get_svq_call_notifier |
Date: |
Fri, 21 Jan 2022 21:27:09 +0100 |
This allows vhost-vdpa device to retrieve device -> svq call eventfd.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio/vhost-shadow-virtqueue.h
index 4c583a9171..a78234b52b 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -18,6 +18,8 @@ typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd);
const EventNotifier *vhost_svq_get_dev_kick_notifier(
const VhostShadowVirtqueue *svq);
+const EventNotifier *vhost_svq_get_svq_call_notifier(
+ const VhostShadowVirtqueue *svq);
void vhost_svq_stop(VhostShadowVirtqueue *svq);
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 8991f0b3c3..25fcdf16ec 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -55,6 +55,18 @@ static void vhost_handle_guest_kick(EventNotifier *n)
event_notifier_set(&svq->hdev_kick);
}
+/**
+ * Obtain the SVQ call notifier, where vhost device notifies SVQ that there
+ * exists pending used buffers.
+ *
+ * @svq Shadow Virtqueue
+ */
+const EventNotifier *vhost_svq_get_svq_call_notifier(
+ const VhostShadowVirtqueue *svq)
+{
+ return &svq->hdev_call;
+}
+
/**
* Set a new file descriptor for the guest to kick SVQ and notify for avail
*
--
2.27.0
- Re: [PATCH 03/31] vdpa: Add vhost_svq_get_dev_kick_notifier, (continued)
- [PATCH 04/31] vdpa: Add vhost_svq_set_svq_kick_fd, Eugenio Pérez, 2022/01/21
- [PATCH 05/31] vhost: Add Shadow VirtQueue kick forwarding capabilities, Eugenio Pérez, 2022/01/21
- [PATCH 06/31] vhost: Route guest->host notification through shadow virtqueue, Eugenio Pérez, 2022/01/21
- [PATCH 07/31] vhost: dd vhost_svq_get_svq_call_notifier,
Eugenio Pérez <=
- [PATCH 08/31] vhost: Add vhost_svq_set_guest_call_notifier, Eugenio Pérez, 2022/01/21
- [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call, Eugenio Pérez, 2022/01/21
- [PATCH 10/31] vhost: Route host->guest notification through shadow virtqueue, Eugenio Pérez, 2022/01/21
- [PATCH 12/31] vhost: Add vhost_svq_valid_guest_features to shadow vq, Eugenio Pérez, 2022/01/21
- [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq, Eugenio Pérez, 2022/01/21