diff mbox

[rdma-core,2/6] libhns: Update assignment method for owner field of send wqe

Message ID 1526009610-72089-3-git-send-email-oulijun@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Lijun Ou May 11, 2018, 3:33 a.m. UTC
When post a work reqeust, it need to update the owner bit of send
wqe. This patch mainly fix the bug when post multiply work request.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 providers/hns/hns_roce_u_hw_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index 747de04..c69069c 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -598,7 +598,7 @@  static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
 		for (sq_shift = 0; (1 << sq_shift) < qp->sq.wqe_cnt; ++sq_shift)
 			;
 		roce_set_bit(rc_sq_wqe->byte_4, RC_SQ_WQE_BYTE_4_OWNER_S,
-			     ~(qp->sq.head >> sq_shift) & 0x1);
+			     ~(((qp->sq.head + nreq)>> sq_shift) & 0x1));
 
 		wqe += sizeof(struct hns_roce_rc_sq_wqe);
 		/* set remote addr segment */