Skip to content

Add chunk mode support for mlx5 driver

Yishai Hadas kvm 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9net/mlx5: Introduce ifc bits for migration in a chunk modeinclude/linux/mlx5/mlx5_ifc.h+11 -40 replies
2/9vfio/mlx5: Wake up the reader post of disabling the SAVING migration filedrivers/vfio/pci/mlx5/main.c+1 -00 replies
3/9vfio/mlx5: Refactor the SAVE callback to activate a work only upon an errordrivers/vfio/pci/mlx5/cmd.c+13 -70 replies
4/9vfio/mlx5: Enable querying state size which is > 4GBdrivers/vfio/pci/mlx5/cmd.c drivers/vfio/pci/mlx5/cmd.h drivers/vfio/pci/mlx5/main.c+18 -80 replies
5/9vfio/mlx5: Rename some stuff to match chunk modedrivers/vfio/pci/mlx5/cmd.c drivers/vfio/pci/mlx5/cmd.h+10 -90 replies
6/9vfio/mlx5: Pre-allocate chunks for the STOP_COPY phasedrivers/vfio/pci/mlx5/cmd.c drivers/vfio/pci/mlx5/cmd.h drivers/vfio/pci/mlx5/main.c+116 -650 replies
7/9vfio/mlx5: Add support for SAVING in chunk modedrivers/vfio/pci/mlx5/cmd.c drivers/vfio/pci/mlx5/cmd.h drivers/vfio/pci/mlx5/main.c+122 -170 replies
8/9vfio/mlx5: Add support for READING in chunk modedrivers/vfio/pci/mlx5/main.c+37 -60 replies
9/9vfio/mlx5: Activate the chunk mode functionalitydrivers/vfio/pci/mlx5/cmd.c+3 -00 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJason Gunthorpe
SeriesR-b
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH vfio 0/9] Add chunk mode support for mlx5 driver

This series adds 'chunk mode' support for mlx5 driver upon the migration flow.

Before this series, we were limited to 4GB state size, as of the 4 bytes max value based on the device specification for the query/save/load commands.

Once the device supports 'chunk mode' the driver can support state size which is larger than 4GB.

In that case, the device has the capability to split a single image to multiple chunks as long as the software provides a buffer in the minimum size reported by the device.

The driver should query for the minimum buffer size required using QUERY_VHCA_MIGRATION_STATE command with the 'chunk' bit set in its input, in that case, the output will include both the minimum buffer size and also the remaining total size to be reported/used where it will be applicable.

Upon chunk mode, there may be multiple images that will be read from the device upon STOP_COPY. The driver will read ahead from the firmware the full state in small/optimized chunks while letting QEMU/user space read in parallel the available data.

The chunk buffer size is picked up based on the minimum size that firmware requires, the total full size and some max value in the driver code which was set to 8MB to achieve some optimized downtime in the general case.

With that series in place, we could migrate successfully a device state with a larger size than 4GB, while even improving the downtime in some scenarios.

Note:
As the first patch should go to net/mlx5 we may need to send it as a pull request format to VFIO to avoid conflicts before acceptance.

Yishai

Yishai Hadas (9):
net/mlx5: Introduce ifc bits for migration in a chunk mode vfio/mlx5: Wake up the reader post of disabling the SAVING migration
file
vfio/mlx5: Refactor the SAVE callback to activate a work only upon an
error
vfio/mlx5: Enable querying state size which is > 4GB vfio/mlx5: Rename some stuff to match chunk mode vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase vfio/mlx5: Add support for SAVING in chunk mode
vfio/mlx5: Add support for READING in chunk mode vfio/mlx5: Activate the chunk mode functionality

 drivers/vfio/pci/mlx5/cmd.c   | 103 +++++++++----
 drivers/vfio/pci/mlx5/cmd.h   |  28 +++-
 drivers/vfio/pci/mlx5/main.c  | 283 +++++++++++++++++++++++++---------
 include/linux/mlx5/mlx5_ifc.h |  15 +-
 4 files changed, 322 insertions(+), 107 deletions(-)
Signature · 1 line
2.18.1