[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/31] vdpa: Adapt vhost_vdpa_get_vring_base to SVQ
|
From: |
Eugenio Pérez |
|
Subject: |
[PATCH 25/31] vdpa: Adapt vhost_vdpa_get_vring_base to SVQ |
|
Date: |
Fri, 21 Jan 2022 21:27:27 +0100 |
This is needed to achieve migration, so destination can restore its
index.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-vdpa.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 276a559649..887857c177 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -716,8 +716,17 @@ static int vhost_vdpa_set_vring_base(struct vhost_dev *dev,
static int vhost_vdpa_get_vring_base(struct vhost_dev *dev,
struct vhost_vring_state *ring)
{
+ struct vhost_vdpa *v = dev->opaque;
int ret;
+ if (v->shadow_vqs_enabled) {
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs,
+ ring->index);
+
+ ring->num = vhost_svq_get_last_used_idx(svq);
+ return 0;
+ }
+
ret = vhost_vdpa_call(dev, VHOST_GET_VRING_BASE, ring);
trace_vhost_vdpa_get_vring_base(dev, ring->index, ring->num);
return ret;
--
2.27.0
[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, 2022/01/21
[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 <=
[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
[PATCH 30/31] vdpa: Move vhost_vdpa_get_iova_range to net/vhost-vdpa.c, Eugenio Pérez, 2022/01/21
[PATCH 31/31] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/01/21
Re: [PATCH 00/31] vDPA shadow virtqueue, Jason Wang, 2022/01/28