2023-10-17 12:56:42

by Junxian Huang

[permalink] [raw]
Subject: [PATCH for-rc 0/7] Bugfixes for hns RoCE

Here is a patchset of several bugfixes.

Chengchang Tang (3):
RDMA/hns: Fix printing level of asynchronous events
RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
RDMA/hns: Fix signed-unsigned mixed comparisons

Junxian Huang (2):
RDMA/hns: Fix unnecessary port_num transition in HW stats allocation
RDMA/hns: Fix init failure of RoCE VF and HIP08

Luoyouming (2):
RDMA/hns: Add check for SL
RDMA/hns: The UD mode can only be configured with DCQCN

drivers/infiniband/hw/hns/hns_roce_ah.c | 13 ++++++++-
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 34 +++++++++++++---------
drivers/infiniband/hw/hns/hns_roce_main.c | 22 +++++++-------
drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +-
4 files changed, 43 insertions(+), 28 deletions(-)

--
2.30.0


2023-10-17 12:56:44

by Junxian Huang

[permalink] [raw]
Subject: [PATCH for-rc 1/7] RDMA/hns: Fix printing level of asynchronous events

From: Chengchang Tang <[email protected]>

The current driver will print all asynchronous events. Some of the
print levels are set improperly, e.g. SRQ limit reach and SRQ last
wqe reach, which may also occur during normal operation of the software.
Currently, the information of these event is printed as a warning,
which causes a large amount of printing even during normal use of the
application. As a result, the service performance deteriorates.

This patch fixes the printing storms by modifying the print level.

Fixes: b00a92c8f2ca ("RDMA/hns: Move all prints out of irq handle")
Signed-off-by: Chengchang Tang <[email protected]>
Signed-off-by: Junxian Huang <[email protected]>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index d82daff2d9bd..2b8f6489ab3d 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -5804,7 +5804,7 @@ static void hns_roce_irq_work_handle(struct work_struct *work)
case HNS_ROCE_EVENT_TYPE_COMM_EST:
break;
case HNS_ROCE_EVENT_TYPE_SQ_DRAINED:
- ibdev_warn(ibdev, "send queue drained.\n");
+ ibdev_dbg(ibdev, "send queue drained.\n");
break;
case HNS_ROCE_EVENT_TYPE_WQ_CATAS_ERROR:
ibdev_err(ibdev, "local work queue 0x%x catast error, sub_event type is: %d\n",
@@ -5819,10 +5819,10 @@ static void hns_roce_irq_work_handle(struct work_struct *work)
irq_work->queue_num, irq_work->sub_type);
break;
case HNS_ROCE_EVENT_TYPE_SRQ_LIMIT_REACH:
- ibdev_warn(ibdev, "SRQ limit reach.\n");
+ ibdev_dbg(ibdev, "SRQ limit reach.\n");
break;
case HNS_ROCE_EVENT_TYPE_SRQ_LAST_WQE_REACH:
- ibdev_warn(ibdev, "SRQ last wqe reach.\n");
+ ibdev_dbg(ibdev, "SRQ last wqe reach.\n");
break;
case HNS_ROCE_EVENT_TYPE_SRQ_CATAS_ERROR:
ibdev_err(ibdev, "SRQ catas error.\n");
--
2.30.0

2023-10-17 12:57:19

by Junxian Huang

[permalink] [raw]
Subject: [PATCH for-rc 2/7] RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()

From: Chengchang Tang <[email protected]>

ucmd in hns_roce_create_qp_common() are not initialized. But it works fine
until new member sdb_addr is added to struct hns_roce_ib_create_qp.

If the user-mode driver uses an old version ABI, then the value of the new
member will be undefined after ib_copy_from_udata().

This patch fixes it by initialize this variable to 0. And the default value
of the new member sdb_addr will be 0 which is invalid.

Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Signed-off-by: Chengchang Tang <[email protected]>
Signed-off-by: Junxian Huang <[email protected]>
---
drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
index cdc1c6de43a1..828b58534aa9 100644
--- a/drivers/infiniband/hw/hns/hns_roce_qp.c
+++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
@@ -1064,7 +1064,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
{
struct hns_roce_ib_create_qp_resp resp = {};
struct ib_device *ibdev = &hr_dev->ib_dev;
- struct hns_roce_ib_create_qp ucmd;
+ struct hns_roce_ib_create_qp ucmd = {};
int ret;

mutex_init(&hr_qp->mutex);
--
2.30.0

2023-10-19 06:53:49

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH for-rc 0/7] Bugfixes for hns RoCE

On Tue, Oct 17, 2023 at 08:52:32PM +0800, Junxian Huang wrote:
> Here is a patchset of several bugfixes.
>
> Chengchang Tang (3):
> RDMA/hns: Fix printing level of asynchronous events
> RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
> RDMA/hns: Fix signed-unsigned mixed comparisons
>
> Junxian Huang (2):
> RDMA/hns: Fix unnecessary port_num transition in HW stats allocation
> RDMA/hns: Fix init failure of RoCE VF and HIP08
>
> Luoyouming (2):
> RDMA/hns: Add check for SL
> RDMA/hns: The UD mode can only be configured with DCQCN

I took all these patches to -next, we are in -rc6 now.

Thanks

>
> drivers/infiniband/hw/hns/hns_roce_ah.c | 13 ++++++++-
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 34 +++++++++++++---------
> drivers/infiniband/hw/hns/hns_roce_main.c | 22 +++++++-------
> drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +-
> 4 files changed, 43 insertions(+), 28 deletions(-)
>
> --
> 2.30.0
>

2023-10-19 06:54:14

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH for-rc 0/7] Bugfixes for hns RoCE


On Tue, 17 Oct 2023 20:52:32 +0800, Junxian Huang wrote:
> Here is a patchset of several bugfixes.
>
> Chengchang Tang (3):
> RDMA/hns: Fix printing level of asynchronous events
> RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
> RDMA/hns: Fix signed-unsigned mixed comparisons
>
> [...]

Applied, thanks!

[1/7] RDMA/hns: Fix printing level of asynchronous events
https://git.kernel.org/rdma/rdma/c/9faef73ef4f666
[2/7] RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
https://git.kernel.org/rdma/rdma/c/c64e9710f9241e
[3/7] RDMA/hns: Fix signed-unsigned mixed comparisons
https://git.kernel.org/rdma/rdma/c/b5f9efff101b06
[4/7] RDMA/hns: Add check for SL
https://git.kernel.org/rdma/rdma/c/5e617c18b1f34e
[5/7] RDMA/hns: The UD mode can only be configured with DCQCN
https://git.kernel.org/rdma/rdma/c/27c5fd271d8b87
[6/7] RDMA/hns: Fix unnecessary port_num transition in HW stats allocation
https://git.kernel.org/rdma/rdma/c/b4a797b894dc91
[7/7] RDMA/hns: Fix init failure of RoCE VF and HIP08
https://git.kernel.org/rdma/rdma/c/07f06e0e5cd995

Best regards,
--
Leon Romanovsky <[email protected]>