Skip to content

Commit b713128

Browse files
Weihang Lijgunthorpe
authored andcommitted
RDMA/hns: Adjust lp_pktn_ini dynamically
lp_pktn_ini means the number of loopback slice packets for long messages, it should depend on MTU(fixed to 4096B currently) and max size of SQ inline. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Weihang Li <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 23190b8 commit b713128

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3977,7 +3977,8 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
39773977

39783978
/* mtu*(2^LP_PKTN_INI) should not bigger than 1 message length 64kb */
39793979
roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
3980-
V2_QPC_BYTE_56_LP_PKTN_INI_S, 0);
3980+
V2_QPC_BYTE_56_LP_PKTN_INI_S,
3981+
ilog2(hr_dev->caps.max_sq_inline / IB_MTU_4096));
39813982
roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
39823983
V2_QPC_BYTE_56_LP_PKTN_INI_S, 0);
39833984

0 commit comments

Comments
 (0)