RDMA/mlx5: Create ODP EQ only when ODP MR is created
authorShay Drory <shayd@nvidia.com>
Sun, 14 Mar 2021 12:54:18 +0000 (14:54 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 23 Mar 2021 20:00:14 +0000 (17:00 -0300)
commitad50294d4d6b573654cddf09a689592414b28b45
tree98e50b34df225914b6c9d9a69eae89cacd405997
parent783cf673b05ebf290317f583ee7eb6967ed9c964
RDMA/mlx5: Create ODP EQ only when ODP MR is created

There is no need to create the ODP EQ if the user doesn't use ODP MRs.
Hence, create it only when the first ODP MR is created. This EQ will be
destroyed only when the device is unloaded.
This will decrease the number of EQs created per device. for example: If
we creates 1K devices (SF/VF/etc'), than we will decrease the num of EQs
by 1K.

Link: https://lore.kernel.org/r/20210314125418.179716-1-leon@kernel.org
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/hw/mlx5/odp.c