All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 for-next 0/3] IB/core: Obtaining subnet_prefix from cache in
@ 2021-06-16  6:52 Anand Khoje
  2021-06-16  6:52 ` [PATCH v4 for-next 1/3] IB/core: Removed port validity check from ib_get_cached_subnet_prefix Anand Khoje
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Anand Khoje @ 2021-06-16  6:52 UTC (permalink / raw)
  To: linux-rdma, linux-kernel; +Cc: dledford, jgg, haakon.bugge, leon

This v4 patch series is used to read the port_attribute subnet_prefix
from a valid cache entry instead of having to call
device->ops.query_gid() in Infiniband link-layer devices. This requires
addition of a flag used to check that the cache entry is initialized and
that a valid value is being read.

1. Removed the port validity check from ib_get_cached_subnet_prefix.
This check was not useful as the port_num is always valid.

2. Shuffled locks pkey_lost_lock and netdev_lock in struct ib_port_data.
This was done as output of pahole showed two 4-byte holes in the
structure ib_port_data after pkey_list_lock and netdev_lock. Moving
netdev_lock shaved off 8 bytes from the structure.

3. Added a flag to struct ib_port_data. This is used to validate the
status of cached subnet_prefix. This valid cache entry of subnet_prefix
is used in function __ib_query_port().
This allows the utilization of the cache entry and hence avoids a call
into device->ops.query_gid(). We also ensure that in the event of a
cache update, the value for subnet_prefix gets read from the newly updated
GID cache and not via ib_query_port(), so that we do not end up reading a
stale cache value.

Anand Khoje (3):
  IB/core: Removed port validity check from ib_get_cached_subnet_prefix
  IB/core: Shuffle locks in ib_port_data to save memory
  IB/core: Obtain subnet_prefix from cache in IB devices

 drivers/infiniband/core/cache.c     | 25 ++++++++++++++++---------
 drivers/infiniband/core/core_priv.h |  2 +-
 drivers/infiniband/core/device.c    | 20 +++++++++++---------
 drivers/infiniband/core/security.c  |  7 ++-----
 include/rdma/ib_cache.h             |  5 +++++
 include/rdma/ib_verbs.h             |  6 +++++-
 6 files changed, 40 insertions(+), 25 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-06-17 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  6:52 [PATCH v4 for-next 0/3] IB/core: Obtaining subnet_prefix from cache in Anand Khoje
2021-06-16  6:52 ` [PATCH v4 for-next 1/3] IB/core: Removed port validity check from ib_get_cached_subnet_prefix Anand Khoje
2021-06-16  6:52 ` [PATCH v4 for-next 2/3] IB/core: Shuffle locks in ib_port_data to save memory Anand Khoje
2021-06-16  6:52 ` [PATCH v4 for-next 3/3] IB/core: Obtain subnet_prefix from cache in IB devices Anand Khoje
2021-06-16  7:27   ` Leon Romanovsky
2021-06-16  7:42     ` Anand Khoje
2021-06-16  8:05       ` Anand Khoje
2021-06-16  8:41       ` Leon Romanovsky
2021-06-16  7:30   ` Leon Romanovsky
2021-06-16  7:43     ` Anand Khoje
2021-06-17 10:05   ` kernel test robot
2021-06-17 10:05     ` kernel test robot
2021-06-17 10:11   ` kernel test robot
2021-06-17 10:11     ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.