qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yajun Wu <yajunw@nvidia.com>
To: <qemu-devel@nongnu.org>, <jasowang@redhat.com>, <mst@redhat.com>,
	<yajunw@nvidia.com>
Subject: [RFC PATCH 0/5] virtio-net: Introduce LM early load
Date: Mon, 18 Sep 2023 12:49:27 +0800	[thread overview]
Message-ID: <20230918044932.1433744-1-yajunw@nvidia.com> (raw)

This series of patches aims to minimize the downtime during live migration of a
virtio-net device with a vhost-user backend. In the case of hardware virtual
Data Path Acceleration (vDPA) implementation, the hardware configuration, which
includes tasks like VQ creation and RSS setting, may take above 200ms. This
significantly increases the downtime of the VM, particularly in terms of
networking.

To reduce the VM downtime, the proposed approach involves capturing the basic
device state/configuration during the VM's running stage and performing the
initial device configuration(presetup). During the normal configuration process
when the VM is in a stopped state, the second configuration is compared to the
first one, and only the differences are applied to reduce downtime. Ideally,
only the vring available index needs to be changed within VM stop.

This feature is disabled by default, because backend like dpdk also needs
adding support for vhost new message. New device property "x-early-migration"
can enable this feature.

1. Register a new vmstate for virtio-net with an early_setup flag to send the
   device state during migration setup.
2. After device state load on destination VM, need to send device status to
   vhost backend in a new way. Introduce new vhost-user message:
   VHOST_USER_PRESETUP, to notify backend of presetup.
3. Let virtio-net, vhost-net, vhost-dev support presetup. Main flow:
   a. vhost-dev sending presetup start.
   b. virtio-net setting mtu.
   c. vhost-dev sending vring configuration and setting dummy call/kick fd.
   d. vhost-net sending vring enable.
   e. vhost-dev sending presetup end.


TODOs:
======
  - No vhost-vdpa/kernel support. Need to discuss/design new kernel interface
    if there's same requirement for vhost-vdpa.

  - No vIOMMU support so far. If there is a need for vIOMMU support, it is
    planned to be addressed in a follow-up patchset.


Test:
=====
  - Live migration VM with 2 virtio-net devices, ping can recover.
    Together with DPDK patch [1].
  - The time consumption of DPDK function dev_conf is reduced from 191.4 ms
    to 6.6 ms.


References:
===========

[1] https://github.com/Mellanox/dpdk-vhost-vfe/pull/37

Any comments or feedback are highly appreciated.

Thanks,
Yajun


Yajun Wu (5):
  vhost-user: Add presetup protocol feature and op
  vhost: Add support for presetup
  vhost-net: Add support for presetup
  virtio: Add VMState for early load
  virtio-net: Introduce LM early load

 docs/interop/vhost-user.rst       |  10 ++
 hw/net/trace-events               |   1 +
 hw/net/vhost_net.c                |  40 +++++++
 hw/net/virtio-net.c               | 100 ++++++++++++++++++
 hw/virtio/vhost-user.c            |  30 ++++++
 hw/virtio/vhost.c                 | 166 +++++++++++++++++++++++++-----
 hw/virtio/virtio.c                | 152 ++++++++++++++++-----------
 include/hw/virtio/vhost-backend.h |   3 +
 include/hw/virtio/vhost.h         |  12 +++
 include/hw/virtio/virtio-net.h    |   1 +
 include/hw/virtio/virtio.h        |  10 +-
 include/net/vhost_net.h           |   3 +
 12 files changed, 443 insertions(+), 85 deletions(-)

-- 
2.27.0



             reply	other threads:[~2023-09-18  4:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-18  4:49 Yajun Wu [this message]
2023-09-18  4:49 ` [RFC PATCH 1/5] vhost-user: Add presetup protocol feature and op Yajun Wu
2023-09-18  4:49 ` [RFC PATCH 2/5] vhost: Add support for presetup Yajun Wu
2023-12-22 18:46   ` Eugenio Perez Martin
2023-09-18  4:49 ` [RFC PATCH 3/5] vhost-net: " Yajun Wu
2023-09-18  4:49 ` [RFC PATCH 4/5] virtio: Add VMState for early load Yajun Wu
2023-12-22 17:36   ` Eugenio Perez Martin
2023-09-18  4:49 ` [RFC PATCH 5/5] virtio-net: Introduce LM " Yajun Wu
2023-12-22 18:58   ` Eugenio Perez Martin
2023-10-17  7:32 ` [RFC PATCH 0/5] " Yajun Wu
2023-10-17 16:47 ` Eugenio Perez Martin
2023-10-18  6:40   ` Yajun Wu
2023-10-19 15:00     ` Eugenio Perez Martin
2023-12-22 19:07       ` Eugenio Perez Martin

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=20230918044932.1433744-1-yajunw@nvidia.com \
    --to=yajunw@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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).