RDMA/hns: Fix wrong assignment of lp_pktn_ini in QPC
authorWeihang Li <liweihang@huawei.com>
Tue, 14 Jul 2020 11:28:58 +0000 (19:28 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 16 Jul 2020 12:52:14 +0000 (09:52 -0300)
commit7b9bd73ed13d3c399f76bb7578cbe1b9e5a8e8b0
tree899b61d55594a85c1332983937c468abfc5659ef
parentc3d6057e07a5d15be7c69ea545b3f91877808c96
RDMA/hns: Fix wrong assignment of lp_pktn_ini in QPC

The RoCE Engine will schedule to another QP after one has sent
(2 ^ lp_pktn_ini) packets. lp_pktn_ini is set in QPC and should be
calculated from 2 factors:

1. current MTU as a integer
2. the RoCE Engine's maximum slice length 64KB

But the driver use MTU as a enum ib_mtu and the max inline capability, the
lp_pktn_ini will be much bigger than expected which may cause traffic of
some QPs to never get scheduled.

Fixes: b713128de7a1 ("RDMA/hns: Adjust lp_pktn_ini dynamically")
Link: https://lore.kernel.org/r/1594726138-49294-1-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c