IB/core: Read subnet_prefix in ib_query_port via cache.
authorAnand Khoje <anand.a.khoje@oracle.com>
Mon, 12 Jul 2021 12:26:25 +0000 (17:56 +0530)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 16 Jul 2021 13:57:28 +0000 (10:57 -0300)
commit21bfee9c0c7754408b1f311bffe304caf3e62250
treedb088266ac160eb8e9f922b9e5ff2dbdc034669a
parent36721a6d4cf2a39f411e3ac04d5771d1ffef9d23
IB/core: Read subnet_prefix in ib_query_port via cache.

ib_query_port() calls device->ops.query_port() to get the port
attributes. The method of querying is device driver specific.  The same
function calls device->ops.query_gid() to get the GID and extract the
subnet_prefix (gid_prefix).

The GID and subnet_prefix are stored in a cache. But they do not get
read from the cache if the device is an Infiniband device. The
following change takes advantage of the cached subnet_prefix.
Testing with RDBMS has shown a significant improvement in performance
with this change.

Link: https://lore.kernel.org/r/20210712122625.1147-4-anand.a.khoje@oracle.com
Signed-off-by: Anand Khoje <anand.a.khoje@oracle.com>
Signed-off-by: Haakon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/device.c