History

vfio: Add an option to get migration data size

Add an option to get migration data size by introducing a new migration feature named VFIO_DEVICE_FEATURE_MIG_DATA_SIZE. Upon VFIO_DEVICE_FEATURE_GET the estimated data length that will be required to complete STOP_COPY is returned. This option may better enable user space to consider before moving to STOP_COPY whether it can meet the downtime SLA based on the returned data. The patch also includes the implementation for mlx5 and hisi for this new option to make it feature complete for the existing drivers in this area.

Yishai Hadas committed 4 years ago

Commit 4e016f91 parent 913447d6 files · +79 −1Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/vfio.h+13−0
@@ -1128,6 +1128,19 @@ struct vfio_device_feature_dma_logging_report { · 1127 unmodified lines
11281128
11291129 #define VFIO_DEVICE_FEATURE_DMA_LOGGING_REPORT 8
11301130
1131+/*
1132+ * Upon VFIO_DEVICE_FEATURE_GET read back the estimated data length that will
1133+ * be required to complete stop copy.
1134+ *
1135+ * Note: Can be called on each device state.
1136+ */
1137+
1138+struct vfio_device_feature_mig_data_size {
1139+ __aligned_u64 stop_copy_length;
1140+};
1141+
1142+#define VFIO_DEVICE_FEATURE_MIG_DATA_SIZE 9
1143+
11311144 /* -------- API for Type1 VFIO IOMMU -------- */
11321145
11331146 /**