From: Jason Gunthorpe <jgg@nvidia.com>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: 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: Tue, 8 Feb 2022 11:49:36 -0400 [thread overview]
Message-ID: <20220208154936.GA171050@nvidia.com> (raw)
In-Reply-To: <20220120174041.1714-1-shiraz.saleem@intel.com>
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?
Are you sure?
> +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.
Jason
next prev parent reply other threads:[~2022-02-08 15:49 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 [this message]
2022-02-09 17:30 ` Saleem, Shiraz
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=20220208154936.GA171050@nvidia.com \
--to=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@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 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).