[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v6 02/23] vdpa: Fix bad index calculus at vhost_vdpa_get_vrin
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v6 02/23] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base |
Date: |
Mon, 11 Apr 2022 16:50:05 +0200 |
Fixes: 6d0b222666 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-vdpa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 9e5fe15d03..1f229ff4cb 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1172,11 +1172,11 @@ static int vhost_vdpa_get_vring_base(struct vhost_dev
*dev,
struct vhost_vring_state *ring)
{
struct vhost_vdpa *v = dev->opaque;
+ int vdpa_idx = ring->index - dev->vq_index;
int ret;
if (v->shadow_vqs_enabled) {
- VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs,
- ring->index);
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, vdpa_idx);
/*
* Setting base as last used idx, so destination will see as available
--
2.27.0
- [RFC PATCH v6 00/23] Net Control VQ support with asid in vDPA SVQ, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 01/23] vdpa: Add missing tracing to batch mapping functions, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 03/23] util: Return void on iova_tree_remove, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 05/23] vhost: Fix bad return of descriptors to SVQ, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 04/23] hw/virtio: Replace g_memdup() by g_memdup2(), Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 02/23] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base,
Eugenio Pérez <=
- [RFC PATCH v6 06/23] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 07/23] vhost: move descriptor translation to vhost_svq_vring_write_descs, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 09/23] virtio-net: Expose ctrl virtqueue logic, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 11/23] virtio: Make virtqueue_alloc_element non-static, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 10/23] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 13/23] vhost: Add custom used buffer callback, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 08/23] vdpa: Fix index calculus at vhost_vdpa_svqs_start, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 14/23] vdpa: control virtqueue support on shadow virtqueue, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 15/23] vhost: Add vhost_iova_tree_find, Eugenio Pérez, 2022/04/11
- [RFC PATCH v6 18/23] vdpa: add NetClientState->start() callback, Eugenio Pérez, 2022/04/11