DirectWQE fields are not assigned or cleared explicitly when DirectWQE not used. When QP wraps around, data in these fields from the previous use at the same position still remains and are issued to HW by mistake. Clear these fields before issuing doorbell to HW. Fixes: 159933c37450 ("libhns: Add support for direct wqe") Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> --- providers/hns/hns_roce_u_hw_v2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index da8451534..e2f61fcea 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -1374,6 +1374,9 @@ int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, wqe = get_send_wqe(qp, wqe_idx); qp->sq.wrid[wqe_idx] = wr->wr_id; + /* RC and UD share the same DirectWQE field layout */ + ((struct hns_roce_rc_sq_wqe *)wqe)->byte_4 = 0; + switch (ibvqp->qp_type) { case IBV_QPT_XRC_SEND: hr_reg_write(wqe, RCWQE_XRC_SRQN, -- 2.33.0