vdpa/mlx5: Introduce init/destroy for MR resources
authorDragos Tatulea <dtatulea@nvidia.com>
Fri, 30 Aug 2024 10:58:37 +0000 (13:58 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Sep 2024 11:07:44 +0000 (07:07 -0400)
commitf30a1232b6979c7fc14e821cb349c40073c6191d
tree8f12292357a1c7befc84523e96360d1651f97510
parent58d4d50e758ab1e880b30ba815d733d46f5cbfac
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 <dtatulea@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Message-Id: <20240830105838.2666587-8-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/core/mlx5_vdpa.h
drivers/vdpa/mlx5/core/mr.c
drivers/vdpa/mlx5/core/resources.c
drivers/vdpa/mlx5/net/mlx5_vnet.c