| a6097e0a | 20-Feb-2025 |
Si-Wei Liu <[email protected]> |
vdpa/mlx5: Fix oversized null mkey longer than 32bit
create_user_mr() has correct code to count the number of null keys used to fill in a hole for the memory map. However, fill_indir() does not foll
vdpa/mlx5: Fix oversized null mkey longer than 32bit
create_user_mr() has correct code to count the number of null keys used to fill in a hole for the memory map. However, fill_indir() does not follow the same to cap the range up to the 1GB limit correspondingly. Fill in more null keys for the gaps in between, so that null keys are correctly populated.
Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Cc: [email protected] Reported-by: Cong Meng <[email protected]> Signed-off-by: Si-Wei Liu <[email protected]> Signed-off-by: Dragos Tatulea <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
show more ...
|
| 35025963 | 21-Oct-2024 |
Si-Wei Liu <[email protected]> |
vdpa/mlx5: Fix suboptimal range on iotlb iteration
The starting iova address to iterate iotlb map entry within a range was set to an irrelevant value when passing to the itree_next() iterator, altho
vdpa/mlx5: Fix suboptimal range on iotlb iteration
The starting iova address to iterate iotlb map entry within a range was set to an irrelevant value when passing to the itree_next() iterator, although luckily it doesn't affect the outcome of finding out the granule of the smallest iotlb map size. Fix the code to make it consistent with the following for-loop.
Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Si-Wei Liu <[email protected]> Signed-off-by: Dragos Tatulea <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
show more ...
|
| 29ce8b8a | 21-Oct-2024 |
Si-Wei Liu <[email protected]> |
vdpa/mlx5: Fix PA offset with unaligned starting iotlb map
When calculating the physical address range based on the iotlb and mr [start,end) ranges, the offset of mr->start relative to map->start is
vdpa/mlx5: Fix PA offset with unaligned starting iotlb map
When calculating the physical address range based on the iotlb and mr [start,end) ranges, the offset of mr->start relative to map->start is not taken into account. This leads to some incorrect and duplicate mappings.
For the case when mr->start < map->start the code is already correct: the range in [mr->start, map->start) was handled by a different iteration.
Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Cc: [email protected] Signed-off-by: Si-Wei Liu <[email protected]> Signed-off-by: Dragos Tatulea <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
show more ...
|
| 62111654 | 30-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Postpone MR deletion
Currently, when a new MR is set up, the old MR is deleted. MR deletion is about 30-40% the time of MR creation. As deleting the old MR is not important for the proces
vdpa/mlx5: Postpone MR deletion
Currently, when a new MR is set up, the old MR is deleted. MR deletion is about 30-40% the time of MR creation. As deleting the old MR is not important for the process of setting up the new MR, this operation can be postponed.
This series adds a workqueue that does MR garbage collection at a later point. If the MR lock is taken, the handler will back off and reschedule. The exception during shutdown: then the handler must not postpone the work.
Note that this is only a speculative optimization: if there is some mapping operation that is triggered while the garbage collector handler has the lock taken, this operation it will have to wait for the handler to finish.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
show more ...
|
| f30a1232 | 30-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Introduce init/destroy for MR resources
There's currently not a lot of action happening during the init/destroy of MR resources. But more will be added in the upcoming patches.
As the mr
vdpa/mlx5: Introduce init/destroy for MR resources
There's currently not a lot of action happening during the init/destroy of MR resources. But more will be added in the upcoming patches.
As the mr mutex lock init/destroy has been moved to these new functions, the lifetime has now shifted away from mlx5_vdpa_alloc_resources() / mlx5_vdpa_free_resources() into these new functions. However, the lifetime at the outer scope remains the same: mlx5_vdpa_dev_add() / mlx5_vdpa_dev_free()
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
show more ...
|
| 58d4d50e | 30-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Rename mr_mtx -> lock
Now that the mr resources have their own namespace in the struct, give the lock a clearer name.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cos
vdpa/mlx5: Rename mr_mtx -> lock
Now that the mr resources have their own namespace in the struct, give the lock a clearer name.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
show more ...
|
| 0071b138 | 30-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Create direct MKEYs in parallel
Use the async interface to issue MTT MKEY creation. Extra care is taken at the allocation of FW input commands due to the MTT tables having variable sizes
vdpa/mlx5: Create direct MKEYs in parallel
Use the async interface to issue MTT MKEY creation. Extra care is taken at the allocation of FW input commands due to the MTT tables having variable sizes depending on MR.
The indirect MKEY is still created synchronously at the end as the direct MKEYs need to be filled in.
This makes create_user_mr() 3-5x faster, depending on the size of the MR.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
show more ...
|
| 9dba4195 | 16-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Parallelize VQ suspend/resume for CVQ MQ command
change_num_qps() is still suspending/resuming VQs one by one. This change switches to parallel suspend/resume.
When increasing the number
vdpa/mlx5: Parallelize VQ suspend/resume for CVQ MQ command
change_num_qps() is still suspending/resuming VQs one by one. This change switches to parallel suspend/resume.
When increasing the number of queues the flow has changed a bit for simplicity: the setup_vq() function will always be called before resume_vqs(). If the VQ is initialized, setup_vq() will exit early. If the VQ is not initialized, setup_vq() will create it and resume_vqs() will resume it.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Tested-by: Lei Yang <[email protected]>
show more ...
|
| 55a7cb05 | 16-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Keep notifiers during suspend but ignore
Unregistering notifiers is a costly operation. Instead of removing the notifiers during device suspend and adding them back at resume, simply igno
vdpa/mlx5: Keep notifiers during suspend but ignore
Unregistering notifiers is a costly operation. Instead of removing the notifiers during device suspend and adding them back at resume, simply ignore the call when the device is suspended.
At resume time call queue_link_work() to make sure that the device state is propagated in case there were changes.
For 1 vDPA device x 32 VQs (16 VQPs) attached to a large VM (256 GB RAM, 32 CPUs x 2 threads per core), the device suspend time is reduced from ~13 ms to ~2.5 ms.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Tested-by: Lei Yang <[email protected]>
show more ...
|
| 5eb8c7eb | 16-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Parallelize device resume
Currently device resume works on vqs serially. Building up on previous changes that converted vq operations to the async api, this patch parallelizes the device
vdpa/mlx5: Parallelize device resume
Currently device resume works on vqs serially. Building up on previous changes that converted vq operations to the async api, this patch parallelizes the device resume.
For 1 vDPA device x 32 VQs (16 VQPs) attached to a large VM (256 GB RAM, 32 CPUs x 2 threads per core), the device resume time is reduced from ~16 ms to ~4.5 ms.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Tested-by: Lei Yang <[email protected]>
show more ...
|
| dcf3eac0 | 16-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Parallelize device suspend
Currently device suspend works on vqs serially. Building up on previous changes that converted vq operations to the async api, this patch parallelizes the devic
vdpa/mlx5: Parallelize device suspend
Currently device suspend works on vqs serially. Building up on previous changes that converted vq operations to the async api, this patch parallelizes the device suspend: 1) Suspend all active vqs parallel. 2) Query suspended vqs in parallel.
For 1 vDPA device x 32 VQs (16 VQPs) attached to a large VM (256 GB RAM, 32 CPUs x 2 threads per core), the device suspend time is reduced from ~37 ms to ~13 ms.
A later patch will remove the link unregister operation which will make it even faster.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Tested-by: Lei Yang <[email protected]>
show more ...
|
| 1fcdf43e | 16-Aug-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Use async API for vq query command
Switch firmware vq query command to be issued via the async API to allow future parallelization.
For now the command is still serial but the infrastruc
vdpa/mlx5: Use async API for vq query command
Switch firmware vq query command to be issued via the async API to allow future parallelization.
For now the command is still serial but the infrastructure is there to issue commands in parallel, including ratelimiting the number of issued async commands to firmware.
A later patch will switch to issuing more commands at a time.
Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Tested-by: Lei Yang <[email protected]>
show more ...
|
| 8e0751af | 26-Jun-2024 |
Dragos Tatulea <[email protected]> |
vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready()
VQ indices in the range [cur_num_qps, max_vqs) represent queues that have not yet been activated. .set_vq_ready should not activate these VQ
vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready()
VQ indices in the range [cur_num_qps, max_vqs) represent queues that have not yet been activated. .set_vq_ready should not activate these VQs.
Reviewed-by: Cosmin Ratiu <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Signed-off-by: Dragos Tatulea <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
show more ...
|