All of lore.kernel.org
 help / color / mirror / Atom feed
From: liweihang <liweihang@huawei.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>,
	"wangxi (M)" <wangxi11@huawei.com>
Subject: Re: [PATCH for-next] RDMA/hns: Clear extended doorbell info before using
Date: Thu, 10 Jun 2021 06:26:33 +0000	[thread overview]
Message-ID: <45f10d85bd794db4a107489efd327162@huawei.com> (raw)
In-Reply-To: YMDFvX0ySdq3n+Ra@unreal

On 2021/6/9 21:44, Leon Romanovsky wrote:
> On Wed, Jun 09, 2021 at 07:11:05PM +0800, Weihang Li wrote:
>> From: Xi Wang <wangxi11@huawei.com>
>>
>> Both of HIP08 and HIP09 require the extended doorbell information to be
>> cleared before being used.
> 
> Is it bugfix or feature?
> For the fix, it needs to have Fixes ... line.
> 

It is a bugfix, I will add a fixes tag, thanks.

>>
>> Signed-off-by: Xi Wang <wangxi11@huawei.com>
>> Signed-off-by: Weihang Li <liweihang@huawei.com>
>> ---
>>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 16 ++++++++++++++++
>>  drivers/infiniband/hw/hns/hns_roce_hw_v2.h |  1 +
>>  2 files changed, 17 insertions(+)
>>
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> index fbc45b9..c5d2cfb 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> @@ -1572,6 +1572,20 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
>>  	}
>>  }
>>  
>> +static void hns_roce_clear_extdb_list_info(struct hns_roce_dev *hr_dev)
>> +{
>> +	struct hns_roce_cmq_desc desc;
>> +	int ret;
>> +
>> +	hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_CLEAR_EXTDB_LIST_INFO,
>> +				      false);
>> +	ret = hns_roce_cmq_send(hr_dev, &desc, 1);
>> +	if (ret)
>> +		ibdev_warn(&hr_dev->ib_dev,
>> +			   "failed to clear extended doorbell info, ret = %d.\n",
>> +			   ret);
>> +}
>> +
>>  static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
>>  {
>>  	struct hns_roce_query_fw_info *resp;
>> @@ -2684,6 +2698,8 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
>>  	if (ret)
>>  		return ret;
>>  
>> +	/* The hns ROCEE requires the extdb info to be cleared before using */
>> +	hns_roce_clear_extdb_list_info(hr_dev);
> 
> If it "requires", why do you proceed anyway? Why don't you check for
> success/failure?
> 
> Thanks
> 

You are right, we should check for it's return value.

Weihang

>>  	if (hr_dev->is_vf)
>>  		return 0;
>>  
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
>> index cd361c0..073e835 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
>> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
>> @@ -250,6 +250,7 @@ enum hns_roce_opcode_type {
>>  	HNS_ROCE_OPC_CLR_SCCC				= 0x8509,
>>  	HNS_ROCE_OPC_QUERY_SCCC				= 0x850a,
>>  	HNS_ROCE_OPC_RESET_SCCC				= 0x850b,
>> +	HNS_ROCE_OPC_CLEAR_EXTDB_LIST_INFO		= 0x850d,
>>  	HNS_ROCE_OPC_QUERY_VF_RES			= 0x850e,
>>  	HNS_ROCE_OPC_CFG_GMV_TBL			= 0x850f,
>>  	HNS_ROCE_OPC_CFG_GMV_BT				= 0x8510,
>> -- 
>> 2.7.4
>>
> 


      reply	other threads:[~2021-06-10  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 11:11 [PATCH for-next] RDMA/hns: Clear extended doorbell info before using Weihang Li
2021-06-09 13:44 ` Leon Romanovsky
2021-06-10  6:26   ` liweihang [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=45f10d85bd794db4a107489efd327162@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=wangxi11@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.