Skip to content

migration: Pass network packets received during switchover to dest VM

Juraj Marcin qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4migration/qemu-file: Add ability to clear errormigration/qemu-file.c migration/qemu-file.h+7 -00 replies
2/4migration: Introduce VM_STARTED return-path messagehw/core/machine.c migration/migration.c migration/migration.h +3 more+54 -51 reply
3/4migration: Convert VMSD early_setup into VMStateSavePhase enumhw/virtio/virtio-mem.c include/migration/vmstate.h migration/savevm.c+22 -110 replies
4/4migration: Pass network packets received during switchover to dest VMinclude/migration/vmstate.h include/net/net.h migration/meson.build +12 more+418 -49 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] migration: Pass network packets received during switchover to dest VM

During switchover there is a period during which both source and destination side VMs are paused. During this period, all network packets are still routed to the source side, but it will never process them. Once the destination resumes, it is not aware of these packets and they are lost. This can cause packet loss in unreliable protocols and extended delays due to retransmission in reliable protocols.

This series resolves this problem by caching packets received once the source VM pauses and then passing and injecting them on the destination side. This feature is implemented in the last patch. The caching and injecting is implemented using network filter interface and should work with any backend with vhost=off, but only TAP network backend was explicitly tested.

This series also introduces an RP_VM_STARTED message on the return-path channel, which is used to correctly calculate downtime for both precopy and postcopy, and also as a trigger for netpass to forward packets to the destination. With more data sent through the migration channel after the destination VM starts, using RP_SHUT wouldn't be accurate anymore, and in postcopy the downtime calculation was always incorrect.

As netpass requires return-path capability, its capability is also off by default, but I am open for discussion about making it on by default, as long as return-path is enabled (i.e. enabling return-path would also enable netpass unless it is explicitly disabled).

Juraj Marcin (4):
migration/qemu-file: Add ability to clear error
migration: Introduce VM_STARTED return-path message
migration: Convert VMSD early_setup into VMStateSavePhase enum
migration: Pass network packets received during switchover to dest VM

 hw/core/machine.c           |   4 +-
 hw/virtio/virtio-mem.c      |   2 +-
 include/migration/vmstate.h |  33 +++--
 include/net/net.h           |   5 +
 migration/meson.build       |   1 +
 migration/migration.c       |  83 +++++++++++-
 migration/migration.h       |  11 ++
 migration/netpass.c         | 246 ++++++++++++++++++++++++++++++++++++
 migration/netpass.h         |  14 ++
 migration/options.c         |  29 +++++
 migration/options.h         |   2 +
 migration/qemu-file.c       |   6 +
 migration/qemu-file.h       |   1 +
 migration/savevm.c          |  44 ++++++-
 migration/savevm.h          |   2 +
 migration/trace-events      |   9 ++
 net/net.c                   |  11 ++
 net/tap.c                   |  11 +-
 qapi/migration.json         |   7 +-
 19 files changed, 501 insertions(+), 20 deletions(-)
 create mode 100644 migration/netpass.c
 create mode 100644 migration/netpass.h
Signature · 1 line
2.52.0