From 7b16ba29fa05f7ac04da06bde6322c259be29fd0 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Mon, 31 Aug 2020 21:15:07 -0400 Subject: [PATCH] virtio: use correct number of entries field Socket message VHOST_USER_SET_VRING_ENABLE will use number of vring entries as input parameter to indicate the vring is enabled or not, previously the flag in vhost-user library wasn't checked before commit d0fcc38f5 "vhost: improve device readiness notifications", so here we also use correct filed set in SPDK. Fix issue #1583. Change-Id: If5ac8a4ba31bdecbb5a64b736346c99e4be0f4b6 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3989 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/virtio/virtio_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/virtio/virtio_user.c b/lib/virtio/virtio_user.c index 4f4932db9..e45003352 100644 --- a/lib/virtio/virtio_user.c +++ b/lib/virtio/virtio_user.c @@ -470,7 +470,7 @@ virtio_user_setup_queue(struct virtio_dev *vdev, struct virtqueue *vq) vq->vq_ring_virt_mem = queue_mem; state.index = vq->vq_queue_index; - state.num = 0; + state.num = vq->vq_nentries; if (virtio_dev_has_feature(vdev, VHOST_USER_F_PROTOCOL_FEATURES)) { rc = dev->ops->send_request(dev, VHOST_USER_SET_VRING_ENABLE, &state);