Skip to content

Commit

Permalink
libhns: Fix out-of-order issue of requester when setting FENCE
Browse files Browse the repository at this point in the history
[ Upstream commit c411991 ]

The FENCE indicator in hns WQE doesn't ensure that response data from
a previous Read/Atomic operation has been written to the requester's
memory before the subsequent Send/Write operation is processed. This
may result in the subsequent Send/Write operation accessing the original
data in memory instead of the expected response data.

Unlike FENCE, the SO (Strong Order) indicator blocks the subsequent
operation until the previous response data is written to memory and a
bresp is returned. Set the SO indicator instead of FENCE to maintain
strict order.

Fixes: cbdf5e3 ("libhns: Reimplement verbs of post_send and post_recv for hip08 RoCE")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
  • Loading branch information
Junxian Huang authored and nmorey committed Nov 14, 2024
1 parent 7ecd05f commit 8bb13dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/hns/hns_roce_u_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ static int set_rc_wqe(void *wqe, struct hns_roce_qp *qp, struct ibv_send_wr *wr,

hr_reg_write_bool(wqe, RCWQE_CQE,
!!(wr->send_flags & IBV_SEND_SIGNALED));
hr_reg_write_bool(wqe, RCWQE_FENCE,
hr_reg_write_bool(wqe, RCWQE_SO,
!!(wr->send_flags & IBV_SEND_FENCE));
hr_reg_write_bool(wqe, RCWQE_SE,
!!(wr->send_flags & IBV_SEND_SOLICITED));
Expand Down

0 comments on commit 8bb13dd

Please sign in to comment.