[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v5 08/26] vdpa: Add vhost_svq_get_dev_kick_notifier
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v5 08/26] vdpa: Add vhost_svq_get_dev_kick_notifier |
Date: |
Fri, 29 Oct 2021 20:35:07 +0200 |
Is needed so vhost-vdpa knows what to send to device as kick event fd.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.h | 4 ++++
hw/virtio/vhost-shadow-virtqueue.c | 10 +++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio/vhost-shadow-virtqueue.h
index 27ac6388fa..50ebddbbb9 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -11,9 +11,13 @@
#define VHOST_SHADOW_VIRTQUEUE_H
#include "hw/virtio/vhost.h"
+#include "qemu/event_notifier.h"
typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
+const EventNotifier *vhost_svq_get_dev_kick_notifier(
+ const VhostShadowVirtqueue *svq);
+
VhostShadowVirtqueue *vhost_svq_new(struct vhost_dev *dev, int idx);
void vhost_svq_free(VhostShadowVirtqueue *vq);
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 38887c3433..076418556d 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -11,7 +11,6 @@
#include "hw/virtio/vhost-shadow-virtqueue.h"
#include "qemu/error-report.h"
-#include "qemu/event_notifier.h"
/* Shadow virtqueue to relay notifications */
typedef struct VhostShadowVirtqueue {
@@ -21,6 +20,15 @@ typedef struct VhostShadowVirtqueue {
EventNotifier hdev_call;
} VhostShadowVirtqueue;
+/**
+ * The notifier that SVQ will use to notify the device.
+ */
+const EventNotifier *vhost_svq_get_dev_kick_notifier(
+ const VhostShadowVirtqueue *svq)
+{
+ return &svq->hdev_kick;
+}
+
/*
* Creates vhost shadow virtqueue, and instruct vhost device to use the shadow
* methods and file descriptors.
--
2.27.0
- [RFC PATCH v5 00/26] vDPA shadow virtqueue, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 01/26] util: Make some iova_tree parameters const, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 02/26] vhost: Fix last queue index of devices with no cvq, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 03/26] virtio: Add VIRTIO_F_QUEUE_STATE, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 04/26] virtio-net: Honor VIRTIO_CONFIG_S_DEVICE_STOPPED, Eugenio Pérez, 2021/10/29
- [RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp, Eugenio Pérez, 2021/10/29
- [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 <=
- [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, 2021/10/29
- [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