Skip to content

Commit 09ed024

Browse files
Wenpeng Lianggregkh
authored andcommitted
RDMA/hns: Fix the wrong value of rnr_retry when querying qp
[ Upstream commit 99fcf82 ] The rnr_retry returned to the user is not correct, it should be got from another fields in QPC. Fixes: bfe8603 ("RDMA/hns: Fix cast from or to restricted __le32 for driver") Link: https://lore.kernel.org/r/1600509802-44382-7-git-send-email-liweihang@huawei.com Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com> Signed-off-by: Weihang Li <liweihang@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e667137 commit 09ed024

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4767,7 +4767,9 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
47674767
qp_attr->retry_cnt = roce_get_field(context.byte_212_lsn,
47684768
V2_QPC_BYTE_212_RETRY_CNT_M,
47694769
V2_QPC_BYTE_212_RETRY_CNT_S);
4770-
qp_attr->rnr_retry = le32_to_cpu(context.rq_rnr_timer);
4770+
qp_attr->rnr_retry = roce_get_field(context.byte_244_rnr_rxack,
4771+
V2_QPC_BYTE_244_RNR_CNT_M,
4772+
V2_QPC_BYTE_244_RNR_CNT_S);
47714773

47724774
done:
47734775
qp_attr->cur_qp_state = qp_attr->qp_state;

0 commit comments

Comments
 (0)