vfio/mlx5: Improve the source side flow upon pre_copy
authorYishai Hadas <yishaih@nvidia.com>
Tue, 24 Jan 2023 14:49:54 +0000 (16:49 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 30 Jan 2023 19:16:15 +0000 (12:16 -0700)
commitb04e2e86e919633825728007484508dbdc44c7bb
tree4c93d401dad36863e45aa6690f5788ae21f5c7c6
parentcaf094b5a156272708b46f423833392af464b664
vfio/mlx5: Improve the source side flow upon pre_copy

Improve the source side flow upon pre_copy as of below.

- Prepare the stop_copy buffers as part of moving to pre_copy.
- Send to the target a record that includes the expected
  stop_copy size to let it optimize its stop_copy flow as well.

As for sending the target this new record type (i.e.
MLX5_MIGF_HEADER_TAG_STOP_COPY_SIZE) we split the current 64 header
flags bits into 32 flags bits and another 32 tag bits, each record may
have a tag and a flag whether it's optional or mandatory. Optional
records will be ignored in the target.

The above reduces the downtime upon stop_copy as the relevant data stuff
is prepared ahead as part of pre_copy.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20230124144955.139901-3-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/mlx5/cmd.c
drivers/vfio/pci/mlx5/cmd.h
drivers/vfio/pci/mlx5/main.c