From eb15d158d4b662ec6664e7dbdabd5a7cd255754a Mon Sep 17 00:00:00 2001 From: suhua Date: Tue, 19 Apr 2022 17:33:53 +0800 Subject: [PATCH] vhost: Add VIRTIO_F_ANY_LAYOUT feature for vhost In the qemu virtualization environment, when the virtio driver of the windows image is upgraded to virtio-win 0.1.185, and virtio uses legacy mode. In the negotiation stage of vhost, qemu's host_features will enable VIRTIO_F_ANY_LAYOUT, and guest_features will also enable this feature, because qemu's feature is a superset, so the feature will be passed to the spdk side through the set feature process, which leads to "VHOST_CONFIG: Processing VHOST_USER_SET_FEATURES failed. VHOST_CONFIG: vhost message handling failed.", so we enable this bit for spdk vhost. Signed-off-by: suhua Signed-off-by: lizhaoxin Change-Id: I27323bf5a03dce774c8a74cfb070ddd43be05534 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12300 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/vhost/vhost_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vhost/vhost_internal.h b/lib/vhost/vhost_internal.h index b16d9c00b..34fa0ae9a 100644 --- a/lib/vhost/vhost_internal.h +++ b/lib/vhost/vhost_internal.h @@ -75,7 +75,8 @@ (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | \ (1ULL << VIRTIO_RING_F_EVENT_IDX) | \ (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | \ - (1ULL << VIRTIO_F_RING_PACKED)) + (1ULL << VIRTIO_F_RING_PACKED) | \ + (1ULL << VIRTIO_F_ANY_LAYOUT)) #define SPDK_VHOST_DISABLED_FEATURES ((1ULL << VIRTIO_RING_F_EVENT_IDX) | \ (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY))