[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/14] vdpa: remove msg type of vhost_vdpa
From: |
Eugenio Pérez |
Subject: |
[PATCH v3 09/14] vdpa: remove msg type of vhost_vdpa |
Date: |
Thu, 21 Dec 2023 12:53:14 +0100 |
It is always VHOST_IOTLB_MSG_V2. We can always make it back per
vhost_dev if needed.
This change makes easier for vhost_vdpa_map and unmap not to depend on
vhost_vdpa but only in VhostVDPAShared.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
include/hw/virtio/vhost-vdpa.h | 1 -
hw/virtio/vhost-vdpa.c | 9 ++++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index 11ac14085a..5bd964dac5 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -49,7 +49,6 @@ typedef struct vhost_vdpa_shared {
typedef struct vhost_vdpa {
int index;
- uint32_t msg_type;
uint32_t address_space_id;
MemoryListener listener;
uint64_t acked_features;
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 458e46befd..38afcbf1c9 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -93,7 +93,7 @@ int vhost_vdpa_dma_map(struct vhost_vdpa *v, uint32_t asid,
hwaddr iova,
int fd = v->shared->device_fd;
int ret = 0;
- msg.type = v->msg_type;
+ msg.type = VHOST_IOTLB_MSG_V2;
msg.asid = asid;
msg.iotlb.iova = iova;
msg.iotlb.size = size;
@@ -125,7 +125,7 @@ int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, uint32_t
asid, hwaddr iova,
int fd = v->shared->device_fd;
int ret = 0;
- msg.type = v->msg_type;
+ msg.type = VHOST_IOTLB_MSG_V2;
msg.asid = asid;
msg.iotlb.iova = iova;
msg.iotlb.size = size;
@@ -147,7 +147,7 @@ static void vhost_vdpa_listener_begin_batch(struct
vhost_vdpa *v)
{
int fd = v->shared->device_fd;
struct vhost_msg_v2 msg = {
- .type = v->msg_type,
+ .type = VHOST_IOTLB_MSG_V2,
.iotlb.type = VHOST_IOTLB_BATCH_BEGIN,
};
@@ -183,7 +183,7 @@ static void vhost_vdpa_listener_commit(MemoryListener
*listener)
return;
}
- msg.type = v->msg_type;
+ msg.type = VHOST_IOTLB_MSG_V2;
msg.iotlb.type = VHOST_IOTLB_BATCH_END;
trace_vhost_vdpa_listener_commit(v->shared, fd, msg.type, msg.iotlb.type);
@@ -593,7 +593,6 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void
*opaque, Error **errp)
v->dev = dev;
dev->opaque = opaque ;
v->listener = vhost_vdpa_memory_listener;
- v->msg_type = VHOST_IOTLB_MSG_V2;
vhost_vdpa_init_svq(dev, v);
error_propagate(&dev->migration_blocker, v->migration_blocker);
--
2.39.3
- [PATCH v3 01/14] vdpa: add VhostVDPAShared, (continued)
- [PATCH v3 01/14] vdpa: add VhostVDPAShared, Eugenio Pérez, 2023/12/21
- [PATCH v3 03/14] vdpa: move iova_range to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 02/14] vdpa: move iova tree to the shared struct, Eugenio Pérez, 2023/12/21
- [PATCH v3 05/14] vdpa: use vdpa shared for tracing, Eugenio Pérez, 2023/12/21
- [PATCH v3 06/14] vdpa: move file descriptor to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 07/14] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 04/14] vdpa: move shadow_data to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 10/14] vdpa: move iommu_list to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 11/14] vdpa: use VhostVDPAShared in vdpa_dma_map and unmap, Eugenio Pérez, 2023/12/21
- [PATCH v3 08/14] vdpa: move backend_cap to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21
- [PATCH v3 09/14] vdpa: remove msg type of vhost_vdpa,
Eugenio Pérez <=
- [PATCH v3 12/14] vdpa: use dev_shared in vdpa_iommu, Eugenio Pérez, 2023/12/21
- [PATCH v3 13/14] vdpa: factor out vhost_vdpa_last_dev, Eugenio Pérez, 2023/12/21
- [PATCH v3 14/14] vdpa: move memory listener to vhost_vdpa_shared, Eugenio Pérez, 2023/12/21