OSDN Git Service

IB/mlx5: Avoid calling query device for reading pkey table length
authorParav Pandit <parav@nvidia.com>
Wed, 3 Feb 2021 13:01:30 +0000 (15:01 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 5 Feb 2021 16:06:00 +0000 (12:06 -0400)
commit2019d70e919f01c43975b8d9ea2803b890eabba9
tree6f83beda5f21eb1abb6ed24bb2252a919c7a8ff4
parent3ce60f443b143e649aa26cd3f668d645434647ac
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>
drivers/infiniband/hw/mlx5/mad.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/qp.c