[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 7/8] vdpa: Add feature_log member to vhost_vdpa
From: |
Eugenio Pérez |
Subject: |
[RFC 7/8] vdpa: Add feature_log member to vhost_vdpa |
Date: |
Wed, 10 Aug 2022 20:42:19 +0200 |
This way device's vhost_vdpa can make the choice about exposing or not
the _F_LOG feature.
At the moment is always false.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/vhost-vdpa.h | 1 +
hw/virtio/vhost-vdpa.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index 0c3ed2d69b..b09eae133a 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -33,6 +33,7 @@ typedef struct vhost_vdpa {
MemoryListener listener;
struct vhost_vdpa_iova_range iova_range;
uint64_t acked_features;
+ bool feature_log;
bool shadow_vqs_enabled;
/* The listener must send iova tree addresses, not GPA */
bool listener_shadow_vq;
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index d750d9cec1..17513ee820 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1246,7 +1246,7 @@ static int vhost_vdpa_get_features(struct vhost_dev *dev,
struct vhost_vdpa *v = dev->opaque;
int ret = vhost_vdpa_get_dev_features(dev, features);
- if (ret == 0 && v->shadow_vqs_enabled) {
+ if (ret == 0 && (v->shadow_vqs_enabled || v->feature_log)) {
/* Add SVQ logging capabilities */
*features |= BIT_ULL(VHOST_F_LOG_ALL);
}
--
2.31.1
[RFC 1/8] [NOTMERGE] Update linux headers, Eugenio Pérez, 2022/08/10
[RFC 7/8] vdpa: Add feature_log member to vhost_vdpa,
Eugenio Pérez <=
[RFC 3/8] vhost: expose memory listener priority, Eugenio Pérez, 2022/08/10
[RFC 8/8] vdpa: Conditionally expose _F_LOG in vhost_net devices, Eugenio Pérez, 2022/08/10
[RFC 6/8] vdpa: Negotiate _F_SUSPEND feature, Eugenio Pérez, 2022/08/10