[openib-general] [PATCH] libmthca: fence support

Michael S. Tsirkin mst at mellanox.co.il
Mon Feb 27 06:12:26 PST 2006


Add support to IBV_SEND_FENCE in post_send.

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: last_stable/src/userspace/libmthca/src/qp.c
===================================================================
--- last_stable.orig/src/userspace/libmthca/src/qp.c	2006-02-26 13:10:42.000000000 +0200
+++ last_stable/src/userspace/libmthca/src/qp.c	2006-02-26 13:11:54.000000000 +0200
@@ -282,7 +282,9 @@ int mthca_tavor_post_send(struct ibv_qp 
 			      mthca_opcode[wr->opcode]);
 
 		((struct mthca_next_seg *) prev_wqe)->ee_nds =
-			htonl((size0 ? 0 : MTHCA_NEXT_DBD) | size);
+			htonl((size0 ? 0 : MTHCA_NEXT_DBD) | size |
+			((wr->send_flags & IBV_SEND_FENCE) ?
+			 MTHCA_NEXT_FENCE : 0));
 
 		if (!size0) {
 			size0 = size;
@@ -633,7 +634,9 @@ int mthca_arbel_post_send(struct ibv_qp 
 			      mthca_opcode[wr->opcode]);
 		mb();
 		((struct mthca_next_seg *) prev_wqe)->ee_nds =
-			htonl(MTHCA_NEXT_DBD | size);
+			htonl(MTHCA_NEXT_DBD | size |
+			      ((wr->send_flags & IBV_SEND_FENCE) ?
+                       	       MTHCA_NEXT_FENCE : 0));
 
 		if (!size0) {
 			size0 = size;

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list