Skip to content

Commit 5dbcb1c

Browse files
Junxian Huangrleon
authored andcommitted
RDMA/hns: Fix out-of-order issue of requester when setting FENCE
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: 9a44353 ("IB/hns: Add driver files for hns RoCE driver") Signed-off-by: Junxian Huang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 7566752 commit 5dbcb1c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static inline int set_rc_wqe(struct hns_roce_qp *qp,
575575
if (WARN_ON(ret))
576576
return ret;
577577

578-
hr_reg_write(rc_sq_wqe, RC_SEND_WQE_FENCE,
578+
hr_reg_write(rc_sq_wqe, RC_SEND_WQE_SO,
579579
(wr->send_flags & IB_SEND_FENCE) ? 1 : 0);
580580

581581
hr_reg_write(rc_sq_wqe, RC_SEND_WQE_SE,

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ struct hns_roce_v2_rc_send_wqe {
924924
#define RC_SEND_WQE_OWNER RC_SEND_WQE_FIELD_LOC(7, 7)
925925
#define RC_SEND_WQE_CQE RC_SEND_WQE_FIELD_LOC(8, 8)
926926
#define RC_SEND_WQE_FENCE RC_SEND_WQE_FIELD_LOC(9, 9)
927+
#define RC_SEND_WQE_SO RC_SEND_WQE_FIELD_LOC(10, 10)
927928
#define RC_SEND_WQE_SE RC_SEND_WQE_FIELD_LOC(11, 11)
928929
#define RC_SEND_WQE_INLINE RC_SEND_WQE_FIELD_LOC(12, 12)
929930
#define RC_SEND_WQE_WQE_INDEX RC_SEND_WQE_FIELD_LOC(30, 15)

0 commit comments

Comments
 (0)