From 353244d8b96767659e6c95c0c87dfe4372fe8c12 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 20 Oct 2021 12:55:53 +0800 Subject: [PATCH] vhost-vdpa: prepare for the multiqueue support Unlike vhost-kernel, vhost-vdpa adapts a single device multiqueue model. So we need to simply use virtqueue index as the vhost virtqueue index. This is a must for multiqueue to work for vhost-vdpa. Signed-off-by: Jason Wang Message-Id: <20211020045600.16082-4-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 ceb53613ba..8948fd316b 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -546,8 +546,8 @@ static int vhost_vdpa_get_vq_index(struct vhost_dev *dev, int idx) { assert(idx >= dev->vq_index && idx < dev->vq_index + dev->nvqs); - trace_vhost_vdpa_get_vq_index(dev, idx, idx - dev->vq_index); - return idx - dev->vq_index; + trace_vhost_vdpa_get_vq_index(dev, idx, idx); + return idx; } static int vhost_vdpa_set_vring_ready(struct vhost_dev *dev)