Spdk/lib/nvmf
Changpeng Liu d1c2027d01 nvmf/vfio-user: add NVMe live migration support finally
VFIO in QEMU uses region 9 as the PCI passthrough devices' migration channel.

The format of the region 9 migration region is as follows:
 ------------------------------------------------------------------
|vfio_device_migration_info|    data section                      |
 ------------------------------------------------------------------
QEMU will access vfio_device_migration_info to controll the migration
process.

For SPDK vfio-user target, we also implement the BAR9 via libvfio-user,
and we also define the NVMe device specific migration data stored in
data section of BAR9.  QEMU doesn't care about the format in data section,
it will help us to gather the NVMe specific migration data in source VM and
then restore the migration date to data section of BAR9 in destination VM.

The core idea to implement live migration will following the device state
change which is controlled by QEMU.  First QEMU will try to STOP the device
in the source VM, and set the destination VM to RESUME state, SPDK will save
NVMe devic state data structure to BAR9 in the source VM once the subsystem
is paused, then QEMU will read BAR9 in source VM and restore the content of
BAR9 in destination VM, finally in the destination VM, we will restore the
NVMe device state include BARs/PCI CFG/queue pairs in the destination VM.

Change-Id: I42e38f28c3ff59831be63290038b50d199d06658
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7617
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-01-27 20:55:16 +00:00
..
ctrlr_bdev.c nvmf: make zcopy_end void 2022-01-06 18:53:42 +00:00
ctrlr_discovery.c nvmf: add new 'id' to spdk_nvmf_subsystem_listener 2021-12-20 18:12:41 +00:00
ctrlr.c nvmf: add save/restore a controller in runtime 2022-01-26 00:37:29 +00:00
fc_ls.c spelling: lib 2021-12-03 08:12:55 +00:00
fc.c nvmf: Use acceptor_poll_rate value from func args 2022-01-17 14:26:01 +00:00
Makefile nvmf/ctrlr: let transport can set VID SSVID and IEEE values 2021-12-06 23:17:07 +00:00
nvmf_fc.h spelling: lib 2021-12-03 08:12:55 +00:00
nvmf_internal.h nvmf: add save/restore a controller in runtime 2022-01-26 00:37:29 +00:00
nvmf_rpc.c nvmf: zero-copy enable flag in transport opts 2022-01-06 18:53:42 +00:00
nvmf.c nvmf: Update controller desctruction process 2022-01-20 20:00:51 +00:00
rdma.c rdma: Fix icd update to support msdbd 2022-01-20 11:21:58 +00:00
spdk_nvmf.map lib/nvmf : Added support for ZCOPY 2021-07-23 08:34:43 +00:00
subsystem.c nvmf: Update controller desctruction process 2022-01-20 20:00:51 +00:00
tcp.c nvmf: Use acceptor_poll_rate value from func args 2022-01-17 14:26:01 +00:00
transport.c nvmf: Stop all listeners when destroying transport 2022-01-27 15:11:58 +00:00
transport.h nvmf: remove accept poller from generic layer 2021-12-14 13:18:33 +00:00
vfio_user.c nvmf/vfio-user: add NVMe live migration support finally 2022-01-27 20:55:16 +00:00