All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH v2 for-next 7/7] RDMA/hns: Optimize qp doorbell allocation flow
Date: Tue, 18 Feb 2020 20:52:25 -0400	[thread overview]
Message-ID: <20200219005225.GA25540@ziepe.ca> (raw)
In-Reply-To: <1581325720-12975-8-git-send-email-liweihang@huawei.com>

On Mon, Feb 10, 2020 at 05:08:40PM +0800, Weihang Li wrote:
> From: Xi Wang <wangxi11@huawei.com>
> 
> Encapsulate the kernel qp doorbell allocation related code into 2
> functions: alloc_qp_db() and free_qp_db().
> 
> Signed-off-by: Xi Wang <wangxi11@huawei.com>
> Signed-off-by: Weihang Li <liweihang@huawei.com>
>  drivers/infiniband/hw/hns/hns_roce_qp.c | 214 +++++++++++++++++---------------
>  1 file changed, 113 insertions(+), 101 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
> index ad34187..46785f1 100644
> +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
> @@ -844,6 +844,96 @@ static void free_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
>  		free_rq_inline_buf(hr_qp);
>  }
>  
> +#define user_qp_has_sdb(hr_dev, init_attr, udata, resp, ucmd) \
> +		((hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SQ_RECORD_DB) && \
> +		udata->outlen >= sizeof(*resp) && \
> +		hns_roce_qp_has_sq(init_attr) && udata->inlen >= sizeof(*ucmd))
> +
> +#define user_qp_has_rdb(hr_dev, init_attr, udata, resp) \
> +		((hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RECORD_DB) && \
> +		udata->outlen >= sizeof(*resp) && \
> +		hns_roce_qp_has_rq(init_attr))
> +
> +#define kernel_qp_has_rdb(hr_dev, init_attr) \
> +		((hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RECORD_DB) && \
> +		hns_roce_qp_has_rq(init_attr))

static inline functions not defines please

Also, these tests against inline and outlen look very strange. What
are they doing?

Jason

  reply	other threads:[~2020-02-19  0:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10  9:08 [PATCH v2 for-next 0/7] RDMA/hns: Refactor qp related code Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 1/7] RDMA/hns: Optimize qp destroy flow Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 2/7] RDMA/hns: Optimize qp context create and " Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 3/7] RDMA/hns: Optimize qp number assign flow Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 4/7] RDMA/hns: Optimize qp buffer allocation flow Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 5/7] RDMA/hns: Optimize qp param setup flow Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 6/7] RDMA/hns: Optimize kernel qp wrid allocation flow Weihang Li
2020-02-10  9:08 ` [PATCH v2 for-next 7/7] RDMA/hns: Optimize qp doorbell " Weihang Li
2020-02-19  0:52   ` Jason Gunthorpe [this message]
2020-02-19  8:14     ` Weihang Li
2020-02-19 13:19       ` Jason Gunthorpe
2020-02-22  7:22         ` Weihang Li
2020-02-22 23:38           ` Jason Gunthorpe
2020-02-24  1:29             ` liweihang
2020-02-19  0:52 ` [PATCH v2 for-next 0/7] RDMA/hns: Refactor qp related code Jason Gunthorpe
2020-02-19  8:22   ` Weihang Li

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=20200219005225.GA25540@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liweihang@huawei.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.