RDMA/core: Introduce and use API to read port immutable data
authorParav Pandit <parav@nvidia.com>
Wed, 3 Feb 2021 13:01:32 +0000 (15:01 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 5 Feb 2021 16:06:01 +0000 (12:06 -0400)
commit7416790e22452bfa86de6b55638eacf7780c8f6f
treef2c25ff63ff525be7f287bc77906beb0c1b49632
parent7a58779edd75c37352917e8fbc7769efce0e65b6
RDMA/core: Introduce and use API to read port immutable data

Currently mlx5 driver caches port GID table length for 2 ports.  It is
also cached by IB core as port immutable data.

When mlx5 representor ports are present, which are usually more than 2,
invalid access to port_caps array can happen while validating the GID
table length which is only for 2 ports.

To avoid this, take help of the IB cores port immutable data by exposing
an API to read the port immutable fields.

Remove mlx5 driver's internal cache, thereby reduce code and data.

Link: https://lore.kernel.org/r/20210203130133.4057329-5-leon@kernel.org
Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/device.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/qp.c
include/rdma/ib_verbs.h