[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 10/14] vdpa net: block migration if the device has CVQ
From: |
Eugenio Pérez |
Subject: |
[PATCH v5 10/14] vdpa net: block migration if the device has CVQ |
Date: |
Fri, 3 Mar 2023 18:24:41 +0100 |
Devices with CVQ need to migrate state beyond vq state. Leaving this to
future series.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
v5: Fix comment (s/v/s->vhost_vdpa/).
v3: Migration blocker is registered in vhost_dev.
---
include/hw/virtio/vhost-vdpa.h | 1 +
hw/virtio/vhost-vdpa.c | 1 +
net/vhost-vdpa.c | 9 +++++++++
3 files changed, 11 insertions(+)
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index 4a7d396674..c278a2a8de 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -50,6 +50,7 @@ typedef struct vhost_vdpa {
const VhostShadowVirtqueueOps *shadow_vq_ops;
void *shadow_vq_ops_opaque;
struct vhost_dev *dev;
+ Error *migration_blocker;
VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
} VhostVDPA;
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 49afa59261..e9167977d5 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -438,6 +438,7 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void
*opaque, Error **errp)
v->msg_type = VHOST_IOTLB_MSG_V2;
vhost_vdpa_init_svq(dev, v);
+ error_propagate(&dev->migration_blocker, v->migration_blocker);
if (!vhost_vdpa_first_dev(dev)) {
return 0;
}
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 167b43679d..533ba54317 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -828,6 +828,15 @@ static NetClientState *net_vhost_vdpa_init(NetClientState
*peer,
s->vhost_vdpa.shadow_vq_ops = &vhost_vdpa_net_svq_ops;
s->vhost_vdpa.shadow_vq_ops_opaque = s;
+
+ /*
+ * TODO: We cannot migrate devices with CVQ as there is no way to set
+ * the device state (MAC, MQ, etc) before starting the datapath.
+ *
+ * Migration blocker ownership now belongs to s->vhost_vdpa.
+ */
+ error_setg(&s->vhost_vdpa.migration_blocker,
+ "net vdpa cannot migrate with CVQ feature");
}
ret = vhost_vdpa_add(nc, (void *)&s->vhost_vdpa, queue_pair_index, nvqs);
if (ret) {
--
2.31.1
- [PATCH v5 00/14] Dynamically switch to vhost shadow virtqueues at vdpa net migration, Eugenio Pérez, 2023/03/03
- [PATCH v5 01/14] vdpa net: move iova tree creation from init to start, Eugenio Pérez, 2023/03/03
- [PATCH v5 02/14] vdpa: Remember last call fd set, Eugenio Pérez, 2023/03/03
- [PATCH v5 05/14] vdpa: add vhost_vdpa->suspended parameter, Eugenio Pérez, 2023/03/03
- [PATCH v5 04/14] vdpa: rewind at get_base, not set_base, Eugenio Pérez, 2023/03/03
- [PATCH v5 06/14] vdpa: add vhost_vdpa_suspend, Eugenio Pérez, 2023/03/03
- [PATCH v5 07/14] vdpa: move vhost reset after get vring base, Eugenio Pérez, 2023/03/03
- [PATCH v5 03/14] vdpa: Negotiate _F_SUSPEND feature, Eugenio Pérez, 2023/03/03
- [PATCH v5 08/14] vdpa: add vdpa net migration state notifier, Eugenio Pérez, 2023/03/03
- [PATCH v5 09/14] vdpa: disable RAM block discard only for the first device, Eugenio Pérez, 2023/03/03
- [PATCH v5 10/14] vdpa net: block migration if the device has CVQ,
Eugenio Pérez <=
- [PATCH v5 11/14] vdpa: block migration if device has unsupported features, Eugenio Pérez, 2023/03/03
- [PATCH v5 13/14] vdpa net: allow VHOST_F_LOG_ALL, Eugenio Pérez, 2023/03/03
- [PATCH v5 12/14] vdpa: block migration if SVQ does not admit a feature, Eugenio Pérez, 2023/03/03
- [PATCH v5 14/14] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Eugenio Pérez, 2023/03/03
- Re: [PATCH v5 00/14] Dynamically switch to vhost shadow virtqueues at vdpa net migration, Lei Yang, 2023/03/07