qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cindy Lu <lulu@redhat.com>, Shannon Nelson <snelson@pensando.io>,
	longpeng2@huawei.com, virtualization@lists.linux-foundation.org,
	Harpreet Singh Anand <hanand@xilinx.com>,
	si-wei.liu@oracle.com, Stefan Hajnoczi <stefanha@redhat.com>,
	Eli Cohen <eli@mellanox.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Gautam Dawar <gdawar@xilinx.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Liuxiangdong <liuxiangdong5@huawei.com>,
	alvaro.karsz@solid-run.com, Parav Pandit <parav@mellanox.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Zhu Lingshan <lingshan.zhu@intel.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Lei Yang <leiyang@redhat.com>
Subject: [PATCH v3 10/14] vdpa net: block migration if the device has CVQ
Date: Wed, 15 Feb 2023 18:38:46 +0100	[thread overview]
Message-ID: <20230215173850.298832-11-eperezma@redhat.com> (raw)
In-Reply-To: <20230215173850.298832-1-eperezma@redhat.com>

Devices with CVQ needs to migrate state beyond vq state.  Leaving this
to future series.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
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               | 4 ++++
 3 files changed, 6 insertions(+)

diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index 7997f09a8d..620a0f70ab 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -48,6 +48,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 94416f520b..52c72e7c94 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 cf9830bb02..9312329167 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -840,6 +840,10 @@ 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;
+
+        /* Migration blocker ownership now belongs to v */
+        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



  parent reply	other threads:[~2023-02-15 17:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 17:38 [PATCH v3 00/14] Dynamically switch to vhost shadow virtqueues at vdpa net migration Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 01/14] vdpa net: move iova tree creation from init to start Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 02/14] vdpa: stop svq at vhost_vdpa_dev_start(false) Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 03/14] vdpa: Negotiate _F_SUSPEND feature Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 04/14] vdpa: add vhost_vdpa_suspend Eugenio Pérez
2023-02-16 13:47   ` Alvaro Karsz
2023-02-16 14:35     ` Eugenio Perez Martin
2023-02-15 17:38 ` [PATCH v3 05/14] vdpa: move vhost reset after get vring base Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 06/14] vdpa: rewind at get_base, not set_base Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 07/14] vdpa net: allow VHOST_F_LOG_ALL Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 08/14] vdpa: add vdpa net migration state notifier Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 09/14] vdpa: disable RAM block discard only for the first device Eugenio Pérez
2023-02-15 17:38 ` Eugenio Pérez [this message]
2023-02-15 17:38 ` [PATCH v3 11/14] vdpa: block migration if device has unsupported features Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 12/14] vdpa: block migration if dev does not have _F_SUSPEND Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 13/14] vdpa: block migration if SVQ does not admit a feature Eugenio Pérez
2023-02-15 17:38 ` [PATCH v3 14/14] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices Eugenio Pérez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230215173850.298832-11-eperezma@redhat.com \
    --to=eperezma@redhat.com \
    --cc=alvaro.karsz@solid-run.com \
    --cc=arei.gonglei@huawei.com \
    --cc=eli@mellanox.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=jasowang@redhat.com \
    --cc=leiyang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=liuxiangdong5@huawei.com \
    --cc=longpeng2@huawei.com \
    --cc=lulu@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=snelson@pensando.io \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).