Skip to content

Commit 56518a6

Browse files
l00436852jgunthorpe
authored andcommitted
RDMA/hns: Modify the value of long message loopback slice
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: 0e60778 ("RDMA/hns: Modify the value of MAX_LP_MSG_LEN to meet hardware compatibility") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yangyang Li <[email protected]> Signed-off-by: Junxian Huang <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 7f3969b commit 56518a6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4583,11 +4583,9 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
45834583
mtu = ib_mtu_enum_to_int(ib_mtu);
45844584
if (WARN_ON(mtu <= 0))
45854585
return -EINVAL;
4586-
#define MAX_LP_MSG_LEN 16384
4587-
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 16KB */
4588-
lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
4589-
if (WARN_ON(lp_pktn_ini >= 0xF))
4590-
return -EINVAL;
4586+
#define MIN_LP_MSG_LEN 1024
4587+
/* mtu * (2 ^ lp_pktn_ini) should be in the range of 1024 to mtu */
4588+
lp_pktn_ini = ilog2(max(mtu, MIN_LP_MSG_LEN) / mtu);
45914589

45924590
if (attr_mask & IB_QP_PATH_MTU) {
45934591
hr_reg_write(context, QPC_MTU, ib_mtu);

0 commit comments

Comments
 (0)