diff options
author | Parav Pandit <parav@nvidia.com> | 2021-02-03 15:01:32 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-02-05 12:06:01 -0400 |
commit | 7416790e22452bfa86de6b55638eacf7780c8f6f (patch) | |
tree | f2c25ff63ff525be7f287bc77906beb0c1b49632 /include/rdma | |
parent | 7a58779edd75c37352917e8fbc7769efce0e65b6 (diff) | |
download | linux-stable-7416790e22452bfa86de6b55638eacf7780c8f6f.tar.gz linux-stable-7416790e22452bfa86de6b55638eacf7780c8f6f.tar.bz2 linux-stable-7416790e22452bfa86de6b55638eacf7780c8f6f.zip |
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>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_verbs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 62e574c50555..ca28fca5736b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -4674,4 +4674,7 @@ static inline u32 rdma_calc_flow_label(u32 lqpn, u32 rqpn) return (u32)(v & IB_GRH_FLOWLABEL_MASK); } + +const struct ib_port_immutable* +ib_port_immutable_read(struct ib_device *dev, unsigned int port); #endif /* IB_VERBS_H */ |