[ofa-general] [PATCH] libmthca: Ensure an Rx WQE is in memory before linking

Eli Cohen eli at mellanox.co.il
Mon Jan 14 05:53:29 PST 2008


Ensure an Rx WQE is in memory before linking

Use a write memory barrier to ensure a WQE is written to memory
before linking it to the previous WQE.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---
 src/qp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/qp.c b/src/qp.c
index 23d7774..841e316 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -390,6 +390,7 @@ int mthca_tavor_post_recv(struct ibv_qp *ibqp, struct ibv_recv_wr *wr,
 
 		((struct mthca_next_seg *) prev_wqe)->nda_op =
 			htonl((ind << qp->rq.wqe_shift) | 1);
+		wmb();
 		((struct mthca_next_seg *) prev_wqe)->ee_nds =
 			htonl(MTHCA_NEXT_DBD | size);
 
-- 
1.5.3.8






More information about the general mailing list