From efe6f11447556ce6ac78ed4c7dd738f022012219 Mon Sep 17 00:00:00 2001 From: ZhouJuan Date: Mon, 7 Aug 2023 11:50:41 +0800 Subject: [PATCH] Revert "RDMA/hns: Modify the value of long message loopback slice" driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I7RKQ1 --------------------------------------------------------------------------- This reverts commit 62df4e45e229ff611b50e5cb06948f39c59f3b4a. Signed-off-by: Juan Zhou --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 8 +++++--- 1 file changed, 5 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 e991127555c5..d93f98e55540 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4849,9 +4849,11 @@ 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 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); +#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; if (attr_mask & IB_QP_PATH_MTU) { hr_reg_write(context, QPC_MTU, ib_mtu); -- GitLab