linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Khoje <anand.a.khoje@oracle.com>
To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com,
	leon@kernel.org
Subject: [PATCH v5 for-next 0/3] IB/core: Obtaining subnet_prefix from cache in
Date: Wed, 16 Jun 2021 21:15:06 +0530	[thread overview]
Message-ID: <20210616154509.1047-1-anand.a.khoje@oracle.com> (raw)

This v5 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     | 21 +++++++++++++--------
 drivers/infiniband/core/core_priv.h |  2 +-
 drivers/infiniband/core/device.c    | 20 +++++++++++---------
 drivers/infiniband/core/security.c  |  7 ++-----
 include/rdma/ib_cache.h             |  1 -
 include/rdma/ib_verbs.h             |  5 ++++-
 6 files changed, 31 insertions(+), 25 deletions(-)

-- 
1.8.3.1


             reply	other threads:[~2021-06-16 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 15:45 Anand Khoje [this message]
2021-06-16 15:45 ` [PATCH v5 for-next 1/3] IB/core: Removed port validity check from ib_get_cached_subnet_prefix Anand Khoje
2021-06-16 15:45 ` [PATCH v5 for-next 2/3] IB/core: Shuffle locks in ib_port_data to save memory Anand Khoje
2021-06-16 15:45 ` [PATCH v5 for-next 3/3] IB/core: Obtain subnet_prefix from cache in IB devices Anand Khoje
2021-06-17  6:41   ` Leon Romanovsky
2021-06-21 23:49   ` Jason Gunthorpe
2021-06-23 13:03     ` Anand Khoje
2021-06-24 17:54       ` Jason Gunthorpe
2021-06-25  6:03         ` Anand Khoje
2021-06-25 12:48           ` Jason Gunthorpe
2021-06-21 23:52 ` [PATCH v5 for-next 0/3] IB/core: Obtaining subnet_prefix from cache in Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616154509.1047-1-anand.a.khoje@oracle.com \
    --to=anand.a.khoje@oracle.com \
    --cc=dledford@redhat.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).