public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, jgg@nvidia.com, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH for-next 1/3] RDMA/hns: Enable all CMDQ context
Date: Thu, 1 Apr 2021 16:08:06 +0300	[thread overview]
Message-ID: <YGXFtqbcVGLiKfXD@unreal> (raw)
In-Reply-To: <1617262341-37571-2-git-send-email-liweihang@huawei.com>

On Thu, Apr 01, 2021 at 03:32:19PM +0800, Weihang Li wrote:
> From: Lang Cheng <chenglang@huawei.com>
> 
> Fix error of cmd's context number calculation algorithm to enable all of
> 32 cmd entries and support 32 concurrent accesses.
> 
> Signed-off-by: Lang Cheng <chenglang@huawei.com>
> Signed-off-by: Weihang Li <liweihang@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_cmd.c    | 62 ++++++++++++-----------------
>  drivers/infiniband/hw/hns/hns_roce_device.h |  6 +--
>  2 files changed, 27 insertions(+), 41 deletions(-)

<...>

> -	WARN_ON(cmd->free_head < 0);
> -	context = &cmd->context[cmd->free_head];
> -	context->token += cmd->token_mask + 1;
> -	cmd->free_head = context->next;
> +
> +	do {
> +		context = &cmd->context[cmd->free_head];
> +		cmd->free_head = context->next;
> +	} while (context->busy);
> +
> +	context->busy = 1;

This "busy" flag after do-while together with release in __hns_roce_cmd_mbox_wait()
is interesting thing. Are you sure that it won't loop forever here?

Thanks

  reply	other threads:[~2021-04-01 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  7:32 [PATCH for-next 0/3] RDMA/hns: Updates of CMDQ Weihang Li
2021-04-01  7:32 ` [PATCH for-next 1/3] RDMA/hns: Enable all CMDQ context Weihang Li
2021-04-01 13:08   ` Leon Romanovsky [this message]
2021-04-02  1:26     ` Lang Cheng
2021-04-04 10:14       ` Leon Romanovsky
2021-04-01  7:32 ` [PATCH for-next 2/3] RDMA/hns: Support more return types of command queue Weihang Li
2021-04-01  7:32 ` [PATCH for-next 3/3] RDMA/hns: Modify prints for mailbox and " Weihang Li
2021-04-08 19:11 ` [PATCH for-next 0/3] RDMA/hns: Updates of CMDQ 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=YGXFtqbcVGLiKfXD@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox