[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 24/31] vhost: Add vhost_svq_get_last_used_idx
From: |
Eugenio Pérez |
Subject: |
[PATCH 24/31] vhost: Add vhost_svq_get_last_used_idx |
Date: |
Fri, 21 Jan 2022 21:27:26 +0100 |
This way SVQ queues can be migrated.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.h | 1 +
hw/virtio/vhost-shadow-virtqueue.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio/vhost-shadow-virtqueue.h
index c6f67d6f76..a2b0c6434d 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -30,6 +30,7 @@ const EventNotifier *vhost_svq_get_svq_call_notifier(
const VhostShadowVirtqueue *svq);
void vhost_svq_get_vring_addr(const VhostShadowVirtqueue *svq,
struct vhost_vring_addr *addr);
+uint16_t vhost_svq_get_last_used_idx(const VhostShadowVirtqueue *svq);
uint16_t vhost_svq_get_num(const VhostShadowVirtqueue *svq);
size_t vhost_svq_driver_area_size(const VhostShadowVirtqueue *svq);
size_t vhost_svq_device_area_size(const VhostShadowVirtqueue *svq);
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index c7888eb8cf..eb0a3fcb80 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -574,6 +574,14 @@ void vhost_svq_get_vring_addr(const VhostShadowVirtqueue
*svq,
addr->used_user_addr = (uint64_t)svq->vring.used;
}
+/**
+ * Get the next index that SVQ is going to consume from SVQ used ring.
+ */
+uint16_t vhost_svq_get_last_used_idx(const VhostShadowVirtqueue *svq)
+{
+ return svq->last_used_idx;
+}
+
uint16_t vhost_svq_get_num(const VhostShadowVirtqueue *svq)
{
return svq->vring.num;
--
2.27.0
- Re: [PATCH 21/31] util: Add iova_tree_alloc, (continued)
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/25
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Peter Xu, 2022/01/27
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/27
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Peter Xu, 2022/01/27
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Jason Wang, 2022/01/28
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/28
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Jason Wang, 2022/01/30
[PATCH 20/31] util: Store DMA entries in a list, Eugenio Pérez, 2022/01/21
[PATCH 22/31] vhost: Add VhostIOVATree, Eugenio Pérez, 2022/01/21
[PATCH 24/31] vhost: Add vhost_svq_get_last_used_idx,
Eugenio Pérez <=
[PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2022/01/21
[PATCH 25/31] vdpa: Adapt vhost_vdpa_get_vring_base to SVQ, Eugenio Pérez, 2022/01/21
[PATCH 26/31] vdpa: Clear VHOST_VRING_F_LOG at vhost_vdpa_set_vring_addr in SVQ, Eugenio Pérez, 2022/01/21
[PATCH 27/31] vdpa: Never set log_base addr if SVQ is enabled, Eugenio Pérez, 2022/01/21
[PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ, Eugenio Pérez, 2022/01/21
[PATCH 29/31] vdpa: Make ncs autofree, Eugenio Pérez, 2022/01/21