[v2,1/2] vhost: support VIRTIO_F_RING_RESET for vhost-user
Checks
Commit Message
Add VIRTIO_F_RING_RESET, which indicates that the driver can reset a
queue individually.
The feature is added to virtio-spec 1.2. The relevant information is
in https://github.com/oasis-tcs/virtio-spec/issues/124
Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
lib/vhost/vhost.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -376,6 +376,11 @@ struct vhost_msg {
#define VIRTIO_F_VERSION_1 32
#endif
+/* This feature indicates that the driver can reset a queue individually. */
+#ifndef VIRTIO_F_RING_RESET
+#define VIRTIO_F_RING_RESET 40
+#endif
+
/* Declare packed ring related bits for older kernels */
#ifndef VIRTIO_F_RING_PACKED
@@ -438,7 +443,8 @@ struct vring_packed_desc_event {
(1ULL << VIRTIO_NET_F_MTU) | \
(1ULL << VIRTIO_F_IN_ORDER) | \
(1ULL << VIRTIO_F_IOMMU_PLATFORM) | \
- (1ULL << VIRTIO_F_RING_PACKED))
+ (1ULL << VIRTIO_F_RING_PACKED) | \
+ (1ULL << VIRTIO_F_RING_RESET))
struct guest_page {