* [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using
@ 2021-06-10 11:19 Weihang Li
2021-06-10 11:48 ` Leon Romanovsky
0 siblings, 1 reply; 5+ messages in thread
From: Weihang Li @ 2021-06-10 11:19 UTC (permalink / raw)
To: dledford, jgg; +Cc: leon, linux-rdma, linuxarm, Xi Wang, Weihang Li
From: Xi Wang <wangxi11@huawei.com>
Both of HIP08 and HIP09 require the extended doorbell information to be
cleared before being used.
Fixes: 6b63597d3540 ("RDMA/hns: Add TSQ link table support")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
Changes since v1:
- Add fixes tag.
- Add check for return value of hns_roce_clear_extdb_list_info().
- Link: https://patchwork.kernel.org/project/linux-rdma/patch/1623237065-43344-1-git-send-email-liweihang@huawei.com/
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 21 +++++++++++++++++++++
drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 +
2 files changed, 22 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..d24ac5c 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -1572,6 +1572,22 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
}
}
+static int 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_err(&hr_dev->ib_dev,
+ "failed to clear extended doorbell info, ret = %d.\n",
+ ret);
+
+ return ret;
+}
+
static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
{
struct hns_roce_query_fw_info *resp;
@@ -2684,6 +2700,11 @@ 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 */
+ ret = hns_roce_clear_extdb_list_info(hr_dev);
+ if (ret)
+ return ret;
+
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using
2021-06-10 11:19 [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using Weihang Li
@ 2021-06-10 11:48 ` Leon Romanovsky
2021-06-10 12:04 ` liweihang
0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2021-06-10 11:48 UTC (permalink / raw)
To: Weihang Li; +Cc: dledford, jgg, linux-rdma, linuxarm, Xi Wang
On Thu, Jun 10, 2021 at 07:19:50PM +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.
>
> Fixes: 6b63597d3540 ("RDMA/hns: Add TSQ link table support")
> Signed-off-by: Xi Wang <wangxi11@huawei.com>
> Signed-off-by: Weihang Li <liweihang@huawei.com>
> ---
> Changes since v1:
> - Add fixes tag.
> - Add check for return value of hns_roce_clear_extdb_list_info().
> - Link: https://patchwork.kernel.org/project/linux-rdma/patch/1623237065-43344-1-git-send-email-liweihang@huawei.com/
>
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 21 +++++++++++++++++++++
> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 +
> 2 files changed, 22 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..d24ac5c 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -1572,6 +1572,22 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
> }
> }
>
> +static int 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_err(&hr_dev->ib_dev,
> + "failed to clear extended doorbell info, ret = %d.\n",
> + ret);
> +
> + return ret;
> +}
> +
> static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
> {
> struct hns_roce_query_fw_info *resp;
> @@ -2684,6 +2700,11 @@ 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 */
> + ret = hns_roce_clear_extdb_list_info(hr_dev);
> + if (ret)
> + return ret;
You forgot to call to put_hem_table(hr_dev).
Thanks
> +
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using
2021-06-10 11:48 ` Leon Romanovsky
@ 2021-06-10 12:04 ` liweihang
2021-06-10 12:55 ` Leon Romanovsky
0 siblings, 1 reply; 5+ messages in thread
From: liweihang @ 2021-06-10 12:04 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: dledford, jgg, linux-rdma, Linuxarm, wangxi (M)
On 2021/6/10 19:48, Leon Romanovsky wrote:
> On Thu, Jun 10, 2021 at 07:19:50PM +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.
>>
>> Fixes: 6b63597d3540 ("RDMA/hns: Add TSQ link table support")
>> Signed-off-by: Xi Wang <wangxi11@huawei.com>
>> Signed-off-by: Weihang Li <liweihang@huawei.com>
>> ---
>> Changes since v1:
>> - Add fixes tag.
>> - Add check for return value of hns_roce_clear_extdb_list_info().
>> - Link: https://patchwork.kernel.org/project/linux-rdma/patch/1623237065-43344-1-git-send-email-liweihang@huawei.com/
>>
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 21 +++++++++++++++++++++
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 +
>> 2 files changed, 22 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..d24ac5c 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>> @@ -1572,6 +1572,22 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
>> }
>> }
>>
>> +static int 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_err(&hr_dev->ib_dev,
>> + "failed to clear extended doorbell info, ret = %d.\n",
>> + ret);
>> +
>> + return ret;
>> +}
>> +
>> static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
>> {
>> struct hns_roce_query_fw_info *resp;
>> @@ -2684,6 +2700,11 @@ 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 */
>> + ret = hns_roce_clear_extdb_list_info(hr_dev);
>> + if (ret)
>> + return ret;
>
> You forgot to call to put_hem_table(hr_dev).
>
> Thanks
>
Hi Leon,
This operation is to tell the firmware to clear the on-chip resources
configuration before initialization, the HEM table is not involved.
Thanks
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
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using
2021-06-10 12:04 ` liweihang
@ 2021-06-10 12:55 ` Leon Romanovsky
2021-06-11 1:29 ` liweihang
0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2021-06-10 12:55 UTC (permalink / raw)
To: liweihang; +Cc: dledford, jgg, linux-rdma, Linuxarm, wangxi (M)
On Thu, Jun 10, 2021 at 12:04:29PM +0000, liweihang wrote:
> On 2021/6/10 19:48, Leon Romanovsky wrote:
> > On Thu, Jun 10, 2021 at 07:19:50PM +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.
> >>
> >> Fixes: 6b63597d3540 ("RDMA/hns: Add TSQ link table support")
> >> Signed-off-by: Xi Wang <wangxi11@huawei.com>
> >> Signed-off-by: Weihang Li <liweihang@huawei.com>
> >> ---
> >> Changes since v1:
> >> - Add fixes tag.
> >> - Add check for return value of hns_roce_clear_extdb_list_info().
> >> - Link: https://patchwork.kernel.org/project/linux-rdma/patch/1623237065-43344-1-git-send-email-liweihang@huawei.com/
> >>
> >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 21 +++++++++++++++++++++
> >> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 +
> >> 2 files changed, 22 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..d24ac5c 100644
> >> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> >> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> >> @@ -1572,6 +1572,22 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
> >> }
> >> }
> >>
> >> +static int 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_err(&hr_dev->ib_dev,
> >> + "failed to clear extended doorbell info, ret = %d.\n",
> >> + ret);
> >> +
> >> + return ret;
> >> +}
> >> +
> >> static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
> >> {
> >> struct hns_roce_query_fw_info *resp;
> >> @@ -2684,6 +2700,11 @@ 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 */
> >> + ret = hns_roce_clear_extdb_list_info(hr_dev);
> >> + if (ret)
> >> + return ret;
> >
> > You forgot to call to put_hem_table(hr_dev).
> >
> > Thanks
> >
>
> Hi Leon,
>
> This operation is to tell the firmware to clear the on-chip resources
> configuration before initialization, the HEM table is not involved.
Please check your hns_roce_v2_init() implementation.
You called to get_hem_table() 6 lines above, in case of error in
hns_roce_clear_extdb_list_info(), you need to return the hem_table back.
You did it in 4 lines below.
Thanks
>
> Thanks
> 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
> >>
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using
2021-06-10 12:55 ` Leon Romanovsky
@ 2021-06-11 1:29 ` liweihang
0 siblings, 0 replies; 5+ messages in thread
From: liweihang @ 2021-06-11 1:29 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: dledford, jgg, linux-rdma, Linuxarm, wangxi (M)
On 2021/6/10 20:55, Leon Romanovsky wrote:
> On Thu, Jun 10, 2021 at 12:04:29PM +0000, liweihang wrote:
>> On 2021/6/10 19:48, Leon Romanovsky wrote:
>>> On Thu, Jun 10, 2021 at 07:19:50PM +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.
>>>>
>>>> Fixes: 6b63597d3540 ("RDMA/hns: Add TSQ link table support")
>>>> Signed-off-by: Xi Wang <wangxi11@huawei.com>
>>>> Signed-off-by: Weihang Li <liweihang@huawei.com>
>>>> ---
>>>> Changes since v1:
>>>> - Add fixes tag.
>>>> - Add check for return value of hns_roce_clear_extdb_list_info().
>>>> - Link: https://patchwork.kernel.org/project/linux-rdma/patch/1623237065-43344-1-git-send-email-liweihang@huawei.com/
>>>>
>>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 21 +++++++++++++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 +
>>>> 2 files changed, 22 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..d24ac5c 100644
>>>> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>>>> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
>>>> @@ -1572,6 +1572,22 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
>>>> }
>>>> }
>>>>
>>>> +static int 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_err(&hr_dev->ib_dev,
>>>> + "failed to clear extended doorbell info, ret = %d.\n",
>>>> + ret);
>>>> +
>>>> + return ret;
>>>> +}
>>>> +
>>>> static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
>>>> {
>>>> struct hns_roce_query_fw_info *resp;
>>>> @@ -2684,6 +2700,11 @@ 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 */
>>>> + ret = hns_roce_clear_extdb_list_info(hr_dev);
>>>> + if (ret)
>>>> + return ret;
>>>
>>> You forgot to call to put_hem_table(hr_dev).
>>>
>>> Thanks
>>>
>>
>> Hi Leon,
>>
>> This operation is to tell the firmware to clear the on-chip resources
>> configuration before initialization, the HEM table is not involved.
>
> Please check your hns_roce_v2_init() implementation.
>
> You called to get_hem_table() 6 lines above, in case of error in
> hns_roce_clear_extdb_list_info(), you need to return the hem_table back.
>
> You did it in 4 lines below.
>
> Thanks
>
Oh, I made a mistake, thank you :)
Weihang
>>
>> Thanks
>> 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
>>>>
>>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-11 1:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 11:19 [PATCH v2 for-next] RDMA/hns: Clear extended doorbell info before using Weihang Li
2021-06-10 11:48 ` Leon Romanovsky
2021-06-10 12:04 ` liweihang
2021-06-10 12:55 ` Leon Romanovsky
2021-06-11 1:29 ` liweihang
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.