RDMA/mlx5: Set ODP caps only if device profile support ODP
authorShay Drory <shayd@nvidia.com>
Thu, 18 Mar 2021 13:52:59 +0000 (15:52 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 26 Mar 2021 14:57:38 +0000 (11:57 -0300)
commite5dc370bd9d6ea1c692c83f2b64a4204c0fa48fb
tree86f565c04240b6a4cebc8be2bad5806f47355dfe
parentc73700806d4e430d182c2be069d230076818a99a
RDMA/mlx5: Set ODP caps only if device profile support ODP

Currently, ODP caps are set during the init stage of mlx5_ib_dev,
regardless of whether the device profile supports ODP or not.  There is no
point in setting ODP caps if the device profile doesn't support
ODP. Hence, move setting the ODP caps to the odp_init stage.

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