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 <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3989
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2020-08-31 21:15:07 -04:00 committed by Tomasz Zawadzki
parent fe87dcadb7
commit 7b16ba29fa

View File

@ -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);