Skip to content

Commit

Permalink
RDMA/hns: Fix the wrong value of rnr_retry when querying qp
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Wenpeng Liang <[email protected]>
Signed-off-by: Weihang Li <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
Wenpeng Liang authored and jgunthorpe committed Sep 24, 2020
1 parent 768202a commit 99fcf82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4881,7 +4881,9 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
qp_attr->retry_cnt = roce_get_field(context.byte_212_lsn,
V2_QPC_BYTE_212_RETRY_CNT_M,
V2_QPC_BYTE_212_RETRY_CNT_S);
qp_attr->rnr_retry = le32_to_cpu(context.rq_rnr_timer);
qp_attr->rnr_retry = roce_get_field(context.byte_244_rnr_rxack,
V2_QPC_BYTE_244_RNR_CNT_M,
V2_QPC_BYTE_244_RNR_CNT_S);

done:
qp_attr->cur_qp_state = qp_attr->qp_state;
Expand Down

0 comments on commit 99fcf82

Please sign in to comment.