2023-05-12 09:33:14

by Junxian Huang

[permalink] [raw]
Subject: [PATCH for-rc 0/3] Bugfixes for HNS RoCE

1.#1: The first patch fixes an error of queried timeout attr on HIP08.

2.#2: The second patch checks and adjusts the BT page size to ensure
successful resource allocation.

3.#3: The third patch modifies the value of long message loopback slice
to improve traffic balance.

Chengchang Tang (2):
RDMA/hns: Fix timeout attr in query qp for HIP08
RDMA/hns: Fix base address table allocation

Yangyang Li (1):
RDMA/hns: Modify the value of long message loopback slice

drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 25 +++++++++----
drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 2 +
drivers/infiniband/hw/hns/hns_roce_mr.c | 43 ++++++++++++++++++++++
3 files changed, 62 insertions(+), 8 deletions(-)

--
2.30.0



2023-05-12 09:34:35

by Junxian Huang

[permalink] [raw]
Subject: [PATCH for-rc 3/3] RDMA/hns: Modify the value of long message loopback slice

From: Yangyang Li <[email protected]>

Long message loopback slice is used for achieving traffic balance
between QPs. It prevents the problem that QPs with large traffic
occupying the hardware pipeline for a long time and QPs with small
traffic cannot be scheduled.

Currently, its maximum value is set to 16K, which means only after a QP
sends 16K will the second QP be scheduled. This value is too large, which
will lead to unbalanced traffic scheduling, and thus it needs to be
modified.

The setting range of the long message loopback slice is modified to be
from 1024 (the lower limit supported by hardware) to mtu. Actual testing
shows that this value can significantly reduce error in hardware traffic
scheduling.

This solution is compatible with both HIP08 and HIP09. The modified
lp_pktn_ini has a maximum value of 2 (when mtu is 256), so the range
checking code for lp_pktn_ini is no longer necessary and needs to
be deleted.

Fixes: 0e60778efb07 ("RDMA/hns: Modify the value of MAX_LP_MSG_LEN to meet hardware compatibility")
Signed-off-by: Yangyang Li <[email protected]>
Signed-off-by: Junxian Huang <[email protected]>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 3a1c90406ed9..d4c6b9bc0a4e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4583,11 +4583,9 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
mtu = ib_mtu_enum_to_int(ib_mtu);
if (WARN_ON(mtu <= 0))
return -EINVAL;
-#define MAX_LP_MSG_LEN 16384
- /* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 16KB */
- lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
- if (WARN_ON(lp_pktn_ini >= 0xF))
- return -EINVAL;
+#define MIN_LP_MSG_LEN 1024
+ /* mtu * (2 ^ lp_pktn_ini) should be in the range of 1024 to mtu */
+ lp_pktn_ini = ilog2(max(mtu, MIN_LP_MSG_LEN) / mtu);

if (attr_mask & IB_QP_PATH_MTU) {
hr_reg_write(context, QPC_MTU, ib_mtu);
--
2.30.0


2023-05-17 19:26:24

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH for-rc 0/3] Bugfixes for HNS RoCE

On Fri, May 12, 2023 at 05:22:42PM +0800, Junxian Huang wrote:
> 1.#1: The first patch fixes an error of queried timeout attr on HIP08.
>
> 2.#2: The second patch checks and adjusts the BT page size to ensure
> successful resource allocation.
>
> 3.#3: The third patch modifies the value of long message loopback slice
> to improve traffic balance.
>
> Chengchang Tang (2):
> RDMA/hns: Fix timeout attr in query qp for HIP08
> RDMA/hns: Fix base address table allocation
>
> Yangyang Li (1):
> RDMA/hns: Modify the value of long message loopback slice

Applied to for-rc, thanks

Jason