Re: [PATCH for-next 1/3] RDMA/hns: Enable all CMDQ context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 01, 2021 at 03:32:19PM +0800, Weihang Li wrote:
> From: Lang Cheng <chenglang@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux