diff options
author | Parav Pandit <parav@nvidia.com> | 2021-02-03 15:01:30 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-02-05 12:06:00 -0400 |
commit | 2019d70e919f01c43975b8d9ea2803b890eabba9 (patch) | |
tree | 6f83beda5f21eb1abb6ed24bb2252a919c7a8ff4 /drivers/infiniband/hw/mlx5/mlx5_ib.h | |
parent | 3ce60f443b143e649aa26cd3f668d645434647ac (diff) |
IB/mlx5: Avoid calling query device for reading pkey table length
Pkey table length for all the ports of the device is the same. Currently
get_ports_cap() reads and stores it for each port by querying the device
which reads more than just pkey table length.
For representor device ports which can be in range of hundreds, it queries
is for each such port and end up returning same value for all the ports.
When in representor mode, modify QP accesses pkey port caps for a port
index that can be outside of the port_caps table.
Hence, simplify the logic to query the max pkey table length only once
during device initialization sequence.
Link: https://lore.kernel.org/r/20210203130133.4057329-3-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 'drivers/infiniband/hw/mlx5/mlx5_ib.h')
-rw-r--r-- | drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index c2f91c15b973..36a92f3c29e3 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -1038,7 +1038,6 @@ struct mlx5_var_table { struct mlx5_port_caps { int gid_table_len; - int pkey_table_len; bool has_smi; u8 ext_port_cap; }; @@ -1104,6 +1103,7 @@ struct mlx5_ib_dev { struct xarray sig_mrs; struct mlx5_port_caps port_caps[MLX5_MAX_PORTS]; + u16 pkey_table_len; }; static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq) |