| cb04444c | 14-Nov-2024 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Fix unwind flows in mlx5vf_pci_save/resume_device_data()
Fix unwind flows in mlx5vf_pci_save_device_data() and mlx5vf_pci_resume_device_data() to avoid freeing the migf pointer at the 'en
vfio/mlx5: Fix unwind flows in mlx5vf_pci_save/resume_device_data()
Fix unwind flows in mlx5vf_pci_save_device_data() and mlx5vf_pci_resume_device_data() to avoid freeing the migf pointer at the 'end' label, as this will be handled by fput(migf->filp) through mlx5vf_release_file().
To ensure mlx5vf_release_file() functions correctly, move the initialization of migf fields (such as migf->lock) to occur before any potential unwind flow, as these fields may be accessed within mlx5vf_release_file().
Fixes: 9945a67ea4b3 ("vfio/mlx5: Refactor PD usage") Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 793d4bfa | 05-Feb-2024 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Handle the EREMOTEIO error upon the SAVE command
The SAVE command uses the async command interface over the PF.
Upon a failure in the firmware -EREMOTEIO is returned.
In that case call
vfio/mlx5: Handle the EREMOTEIO error upon the SAVE command
The SAVE command uses the async command interface over the PF.
Upon a failure in the firmware -EREMOTEIO is returned.
In that case call mlx5_cmd_out_err() to let it print the command failure details including the firmware syndrome.
Note: The other commands in the driver use the sync command interface in a way that a firmware syndrome is printed upon an error inside mlx5_core.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 13578d4e | 24-Oct-2023 |
Joao Martins <[email protected]> |
iommufd/iova_bitmap: Move symbols to IOMMUFD namespace
Have the IOVA bitmap exported symbols adhere to the IOMMUFD symbol export convention i.e. using the IOMMUFD namespace. In doing so, import the
iommufd/iova_bitmap: Move symbols to IOMMUFD namespace
Have the IOVA bitmap exported symbols adhere to the IOMMUFD symbol export convention i.e. using the IOMMUFD namespace. In doing so, import the namespace in the current users. This means VFIO and the vfio-pci drivers that use iova_bitmap_set().
Link: https://lore.kernel.org/r/[email protected] Suggested-by: Jason Gunthorpe <[email protected]> Signed-off-by: Joao Martins <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Alex Williamson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
show more ...
|
| fcb2f2ed | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Activate the chunk mode functionality
Now that all pieces are in place, activate the chunk mode functionality based on device capabilities.
Signed-off-by: Yishai Hadas <[email protected]
vfio/mlx5: Activate the chunk mode functionality
Now that all pieces are in place, activate the chunk mode functionality based on device capabilities.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| a899caca | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Add support for READING in chunk mode
Add support for READING in chunk mode.
In case the last SAVE command recognized that there was still some image to be read, however, there was no av
vfio/mlx5: Add support for READING in chunk mode
Add support for READING in chunk mode.
In case the last SAVE command recognized that there was still some image to be read, however, there was no available chunk to use for, this task was delayed for the reader till one chunk will be consumed and becomes available.
In the above case, a work will be executed to read in the background the next image from the device.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 67135f29 | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Add support for SAVING in chunk mode
Add support for SAVING in chunk mode, it includes running a work that will fill the next chunk from the device.
In case the number of available chunk
vfio/mlx5: Add support for SAVING in chunk mode
Add support for SAVING in chunk mode, it includes running a work that will fill the next chunk from the device.
In case the number of available chunks will reach the MAX_NUM_CHUNKS, the next chunk SAVING will be delayed till the reader will consume one chunk.
The next patch from the series will add the reader part of the chunk mode.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 5798e4dd | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase
This patch is another preparation step towards working in chunk mode.
It pre-allocates chunks for the STOP_COPY phase to let the driver use th
vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase
This patch is another preparation step towards working in chunk mode.
It pre-allocates chunks for the STOP_COPY phase to let the driver use them immediately and prevent an extra allocation upon that phase.
Before that patch we had a single large buffer that was dedicated for the STOP_COPY phase as there was a single SAVE in the source for the last image.
Once we'll move to chunk mode the idea is to have some small buffers that will be used upon the STOP_COPY phase.
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.
Each buffer holds its chunk number to let it be recognized down the road in the coming patches.
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.
As the chunk mode is applicable even if we move directly to STOP_COPY the buffers preparation and some other related stuff is done unconditionally with regards to STOP/PRE-COPY.
Note: In that phase in the series we still didn't activate the chunk mode and the first buffer will be used in all the places.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 9114100d | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Rename some stuff to match chunk mode
Upon chunk mode there may be multiple images that will be read from the device upon STOP_COPY.
This patch is some preparation for that mode by repla
vfio/mlx5: Rename some stuff to match chunk mode
Upon chunk mode there may be multiple images that will be read from the device upon STOP_COPY.
This patch is some preparation for that mode by replacing the relevant stuff to a better matching name.
As part of that, be stricter to recognize PRE_COPY error only when it didn't occur on a STOP_COPY chunk.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 543640af | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Enable querying state size which is > 4GB
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
vfio/mlx5: Enable querying state size which is > 4GB
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 (i.e. required_umem_size) and also the remaining total size to be reported/used where that it will be applicable.
At that point in the series the 'chunk' bit is off, the last patch will activate the feature once all pieces will be ready.
Note: Before this change we were limited to 4GB state size as of 4 bytes max value based on the device specification for the query/save/load commands.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| 34a64c8e | 11-Sep-2023 |
Yishai Hadas <[email protected]> |
vfio/mlx5: Refactor the SAVE callback to activate a work only upon an error
Upon a successful SAVE callback there is no need to activate a work, all the required stuff can be done directly.
As so,
vfio/mlx5: Refactor the SAVE callback to activate a work only upon an error
Upon a successful SAVE callback there is no need to activate a work, all the required stuff can be done directly.
As so, refactor the above flow to activate a work only upon an error.
Signed-off-by: Yishai Hadas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
show more ...
|
| f14c1a14 | 12-Jun-2023 |
Maher Sanalla <[email protected]> |
net/mlx5: Allocate completion EQs dynamically
This commit enables the dynamic allocation of EQs at runtime, allowing for more flexibility in managing completion EQs and reducing the memory overhead
net/mlx5: Allocate completion EQs dynamically
This commit enables the dynamic allocation of EQs at runtime, allowing for more flexibility in managing completion EQs and reducing the memory overhead of driver load. Whenever a CQ is created for a given vector index, the driver will lookup to see if there is an already mapped completion EQ for that vector, if so, utilize it. Otherwise, allocate a new EQ on demand and then utilize it for the CQ completion events.
Add a protection lock to the EQ table to protect from concurrent EQ creation attempts.
While at it, replace mlx5_vector2irqn()/mlx5_vector2eqn() with mlx5_comp_eqn_get() and mlx5_comp_irqn_get() which will allocate an EQ on demand if no EQ is found for the given vector.
Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Shay Drory <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
show more ...
|