RDMA/mlx5: Reorder calls to pcie_relaxed_ordering_enabled()
authorAharon Landau <aharonl@nvidia.com>
Tue, 15 Feb 2022 17:55:33 +0000 (19:55 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 23 Feb 2022 18:59:13 +0000 (14:59 -0400)
commit77528e2aed9246cf8017b8a6f1b658a264d6f2b2
tree8489758ba76eba6bddf1e4c3ba1e8f3da0d2030d
parent9ee2516c43823652da597633aed9646dac51c1f8
RDMA/mlx5: Reorder calls to pcie_relaxed_ordering_enabled()

The mkc is the key for the mkey cache, hence, created in each attempt to
get a cache mkey, while pcie_relaxed_ordering_enabled() is called during
the setting of the mkc, but used only for cases where
IB_ACCESS_RELAXED_ORDERING is set.

pcie_relaxed_ordering_enabled() is an expensive call (26 us). Reorder the
code so the driver will call it only when it is needed.

Link: https://lore.kernel.org/r/684be1366cb1d4f05aa3e78986205e4bc410443a.1644947594.git.leonro@nvidia.com
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mr.c