[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v2 09/13] vdpa: add feature_log parameter to vhost_vdpa
From: |
Eugenio Pérez |
Subject: |
[RFC v2 09/13] vdpa: add feature_log parameter to vhost_vdpa |
Date: |
Thu, 12 Jan 2023 18:24:30 +0100 |
This way the device's vhost_vdpa can make the choice about exposing or
not the _F_LOG feature.
At the moment it 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 7997f09a8d..7bcbcdb1dd 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -39,6 +39,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;
/* Vdpa must send shadow addresses as IOTLB key for data queues, not GPA */
bool shadow_data;
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index a61a6b2a74..40b7e8706a 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1273,7 +1273,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
- Re: [RFC v2 06/13] vhost: delay set_vring_ready after DRIVER_OK, (continued)
[RFC v2 07/13] vdpa: delay set_vring_ready after DRIVER_OK, Eugenio Pérez, 2023/01/12
[RFC v2 08/13] vdpa: Negotiate _F_SUSPEND feature, Eugenio Pérez, 2023/01/12
[RFC v2 09/13] vdpa: add feature_log parameter to vhost_vdpa,
Eugenio Pérez <=
[RFC v2 10/13] vdpa net: allow VHOST_F_LOG_ALL, Eugenio Pérez, 2023/01/12
[RFC v2 11/13] vdpa: add vdpa net migration state notifier, Eugenio Pérez, 2023/01/12