aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-05-31 11:01:39 -0700
committerRoland Dreier <rolandd@cisco.com>2007-05-31 11:01:39 -0700
commite716237f442d2522023c07a5b03f6e3e7977dfa0 (patch)
tree4e663ba9f0c16542c60842e3dc41863349a30cc6
parenta61acb1ce4fcc96c520ae284d64d8f09adbc350c (diff)
downloadlibmthca-e716237f442d2522023c07a5b03f6e3e7977dfa0.tar.gz
Add missing wmb() in mthca_tavor_post_send()
Make sure send WQE fields do not get written in the wrong order to avoid the HCA hardware seeing a bogus WQE. Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/qp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qp.c b/src/qp.c
index 2d03d49..2ea9dc0 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -292,7 +292,10 @@ int mthca_tavor_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
htonl(((ind << qp->sq.wqe_shift) +
qp->send_wqe_offset) |
mthca_opcode[wr->opcode]);
-
+ /*
+ * Make sure that nda_op is written before setting ee_nds.
+ */
+ wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
htonl((size0 ? 0 : MTHCA_NEXT_DBD) | size |
((wr->send_flags & IBV_SEND_FENCE) ?