All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manjunath Patil <manjunath.b.patil@oracle.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"valentinef@mellanox.com" <valentinef@mellanox.com>,
	"gustavoars@kernel.org" <gustavoars@kernel.org>,
	Haakon Bugge <haakon.bugge@oracle.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: RE: [PATCH] IB/ipoib: improve latency in ipoib/cm connection formation
Date: Mon, 25 Jan 2021 18:49:46 +0000	[thread overview]
Message-ID: <CO1PR10MB45162B7BD3F61C91C0867213CFBD9@CO1PR10MB4516.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20210121181615.GA1224360@nvidia.com>

> On Thu, Jan 21, 2021 at 09:50:03AM -0800, Manjunath Patil wrote:
> > ipoib connected mode presently queries the device[HCA] to get P_Key
> > table entry during connection formation. This will increase the time
> > taken to form the connection, especially when limited P_Keys are in use.
> > This gets worse when multiple connection attempts are done in parallel.
> > Improve this by using the cached version of ib_find_pkey().
> >
> > This improved the latency from 500ms to 3ms on an internal setup.
> >
> > Suggested-by: Haakon Bugge <haakon.bugge@oracle.com>
> > Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
> >  drivers/infiniband/ulp/ipoib/ipoib_cm.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > index 8f0b598..013a1d8 100644
> > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > @@ -40,6 +40,7 @@
> >  #include <linux/moduleparam.h>
> >  #include <linux/sched/signal.h>
> >  #include <linux/sched/mm.h>
> > +#include <rdma/ib_cache.h>
> >
> >  #include "ipoib.h"
> >
> > @@ -1122,7 +1123,8 @@ static int ipoib_cm_modify_tx_init(struct
> net_device *dev,
> >  	struct ipoib_dev_priv *priv = ipoib_priv(dev);
> >  	struct ib_qp_attr qp_attr;
> >  	int qp_attr_mask, ret;
> > -	ret = ib_find_pkey(priv->ca, priv->port, priv->pkey,
> &qp_attr.pkey_index);
> > +	ret = ib_find_cached_pkey(priv->ca, priv->port, priv->pkey,
> > +						&qp_attr.pkey_index);
> 
> ipoib interfaces are locked to a single pkey, you should be able to get the
> pkey index that was determined at link up time and use it here instead of
> searching anything
> 
> Jason

Thank you Jason for your input. I will explore and get back to you.

-Manjunath

  reply	other threads:[~2021-01-26  5:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 17:50 [PATCH] IB/ipoib: improve latency in ipoib/cm connection formation Manjunath Patil
2021-01-21 18:16 ` Jason Gunthorpe
2021-01-25 18:49   ` Manjunath Patil [this message]
2021-01-26 20:01     ` Haakon Bugge
2021-01-26 20:28     ` Haakon Bugge
2021-01-27  0:16       ` 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=CO1PR10MB45162B7BD3F61C91C0867213CFBD9@CO1PR10MB4516.namprd10.prod.outlook.com \
    --to=manjunath.b.patil@oracle.com \
    --cc=dledford@redhat.com \
    --cc=gustavoars@kernel.org \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=valentinef@mellanox.com \
    /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 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.