RDMA/hns: Get message length of ack_req from FW
authorJunxian Huang <huangjunxian6@hisilicon.com>
Thu, 3 Jul 2025 11:39:02 +0000 (19:39 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 7 Jul 2025 05:37:35 +0000 (01:37 -0400)
commit2c2ec0106c0f1f12d4eefd11de318ac47557a750
tree8de22455d676c64b67976a4c6afda38f0d8d306d
parent998b41cb20b02c4e28ac558e4e7f8609d659ec05
RDMA/hns: Get message length of ack_req from FW

ACK_REQ_FREQ indicates the number of packets (after MTU fragmentation)
HW sends before setting an ACK request. When MTU is greater than or
equal to 1024, the current ACK_REQ_FREQ value causes HW to request an
ACK for every MTU fragment. The processing of a large number of ACKs
severely impacts HW performance when sending large size payloads.

Get message length of ack_req from FW so that we can adjust this
parameter according to different situations. There are several
constraints for ACK_REQ_FREQ:

1. mtu * (2 ^ ACK_REQ_FREQ) should not be too large, otherwise it may
   cause some unexpected retries when sending large payload.

2. ACK_REQ_FREQ should be larger than or equal to LP_PKTN_INI.

3. ACK_REQ_FREQ must be equal to LP_PKTN_INI when using LDCP
   or HC3 congestion control algorithm.

Fixes: 56518a603fd2 ("RDMA/hns: Modify the value of long message loopback slice")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250703113905.3597124-4-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.h