]> www.infradead.org Git - users/hch/misc.git/commit
RDMA/mlx5: Add implementation for ufile_hw_cleanup device operation
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 31 Oct 2024 11:22:53 +0000 (13:22 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 4 Nov 2024 11:57:21 +0000 (06:57 -0500)
commit7c891a4dbcc1f6c69297fcf89f1553e64d282643
tree245f5bc040cf6f400f2f33e168ef056cad277ab7
parent27ed2f00807c2328c99751f9500ce6478f16cf7b
RDMA/mlx5: Add implementation for ufile_hw_cleanup device operation

Implement the device API for ufile_hw_cleanup operation, which
iterates over the ufile uobjects lists, and attempts to destroy
DevX QPs, by issuing up to 8 commands in parallel.

This function is responsible only for cleaning the FW resources of the
QP, and doesn't necessarily cleanup all of its resources.
Hence the normal serialized cleanup flow is still executed after it
in __uverbs_cleanup_ufile() to cleanup the remaining resources and
handle the cleanup of SW objects.

In order to avoid double cleanup for the FW resources, new DevX flag
was added DEVX_OBJ_FLAGS_HW_FREED, which marks the object's FW resources
as already freed.

Since QP destruction is the most time-consuming operation in FW,
parallelizing it reduces the cleanup time of applications that use
DevX QPs.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Link: https://patch.msgid.link/2f82675d0412542cba1c47a6b86f589521ae41e1.1730373303.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/devx.h
drivers/infiniband/hw/mlx5/main.c