All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Saleem, Shiraz" <shiraz.saleem@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"Ismail, Mustafa" <mustafa.ismail@intel.com>
Subject: RE: [PATCH rdma-next] RDMA/irdma: Add support for address handle re-use
Date: Wed, 9 Feb 2022 17:30:54 +0000	[thread overview]
Message-ID: <57929d88b4cd43e7b284e0debe4d4db7@intel.com> (raw)
In-Reply-To: <20220208154936.GA171050@nvidia.com>

> Subject: Re: [PATCH rdma-next] RDMA/irdma: Add support for address handle re-
> use
> 
> On Thu, Jan 20, 2022 at 11:40:41AM -0600, Shiraz Saleem wrote:
> > +/**
> > + * irdma_ah_exists - Check for existing identical AH
> > + * @iwdev: irdma device
> > + * @new_ah: AH to check for
> > + *
> > + * returns true if AH is found, false if not found.
> > + */
> > +static bool irdma_ah_exists(struct irdma_device *iwdev,
> > +			    struct irdma_ah *new_ah)
> > +{
> > +	struct irdma_ah *ah;
> >
> > -		if (!cnt) {
> > -			ibdev_dbg(&iwdev->ibdev,
> > -				  "VERBS: CQP create AH timed out");
> > -			err = -ETIMEDOUT;
> > -			goto error;
> > +	list_for_each_entry (ah, &iwdev->ah_list, list) {
> > +		/* Set ah_valid and ah_id the same so memcmp can work */
> > +		new_ah->sc_ah.ah_info.ah_idx = ah->sc_ah.ah_info.ah_idx;
> > +		new_ah->sc_ah.ah_info.ah_valid = ah->sc_ah.ah_info.ah_valid;
> > +		if (!memcmp(&ah->sc_ah.ah_info, &new_ah->sc_ah.ah_info,
> > +			    sizeof(ah->sc_ah.ah_info))) {
> > +			refcount_inc(&ah->refcnt);
> > +			new_ah->parent_ah = ah;
> > +			return true;
> >  		}
> >  	}
> 
> So, the number of AHs is so large the HW has problems but you propose to use a
> linear search to de-dup them?

We will look into optimizing this search. 

> 
> > +static int irdma_create_user_ah(struct ib_ah *ibah,
> > +				struct rdma_ah_init_attr *attr,
> > +				struct ib_udata *udata)
> > +{
> > +	struct irdma_ah *ah = container_of(ibah, struct irdma_ah, ibah);
> > +	struct irdma_device *iwdev = to_iwdev(ibah->pd->device);
> > +	struct irdma_create_ah_resp uresp;
> > +	struct irdma_ah *parent_ah;
> > +	int err;
> > +
> > +	err = irdma_setup_ah(ibah, attr);
> > +	if (err)
> > +		return err;
> > +	if (attr->flags & RDMA_CREATE_AH_SLEEPABLE) {
> > +		mutex_lock(&iwdev->ah_list_lock);
> 
> User AH's are always sleepable, no need for these extra paths.
>

Ok.

Thanks a lot for the feedback.

Shiraz

      reply	other threads:[~2022-02-09 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 17:40 [PATCH rdma-next] RDMA/irdma: Add support for address handle re-use Shiraz Saleem
2022-02-08 15:49 ` Jason Gunthorpe
2022-02-09 17:30   ` Saleem, Shiraz [this message]

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=57929d88b4cd43e7b284e0debe4d4db7@intel.com \
    --to=shiraz.saleem@intel.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.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.