Loading
lib/virtio: set vring state to be 1 explicitly when enabling queue
We're developing a new spdk bdev engine bdev_virtio_fs, which is
similar to bdev_virtio_blk. This new engine will connect virtiofsd[1]
with vhost-user protocol, we'll submit patches later.
Currently virtiofsd reports an error when spdk and virtiofsd do protocol
negotiations:
Waiting for daemon failed: HandleRequest(InvalidParam)
The root cause is that when handling VHOST_USER_SET_VRING_ENABLE message,
virtiofsd only take 0 or 1 as valid value, other values will be considered
as invalid. In qemu's docs/interop/vhost-user.rst, there's such
comments:
If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the
ring is initialized in a disabled state and is enabled by
VHOST_USER_SET_VRING_ENABLE with parameter 1.
also in qemu's codes, when enabling vring, it'll set vhost_vring_state's
num to 1, so currently qemu can work with virtiofsd correctly.
To fix this incompatibility issue, set vring state to be 1 explicitly
in spdk codes.
Change-Id: Ic603110bda69f7898cc22e31b8759fdb1a0bc20e
Signed-off-by:
Xiaoguang Wang <lege.wang@jaguarmicro.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20453
Community-CI: Mellanox Build Bot
Reviewed-by:
Jim Harris <jim.harris@samsung.com>
Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by:
Changpeng Liu <changpeng.liu@intel.com>