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

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


Add support to IB_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/drivers/infiniband/hw/mthca/mthca_qp.c
===================================================================
--- last_stable.orig/drivers/infiniband/hw/mthca/mthca_qp.c	2006-02-26 13:10:59.000000000 +0200
+++ last_stable/drivers/infiniband/hw/mthca/mthca_qp.c	2006-02-26 13:13:02.000000000 +0200
@@ -1602,7 +1602,9 @@ int mthca_tavor_post_send(struct ib_qp *
 				    mthca_opcode[wr->opcode]);
 		wmb();
 		((struct mthca_next_seg *) prev_wqe)->ee_nds =
-			cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size);
+			cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size |
+				    ((wr->send_flags & IB_SEND_FENCE) ?
+				    MTHCA_NEXT_FENCE : 0));
 
 		if (!size0) {
 			size0 = size;
@@ -1964,7 +1966,9 @@ int mthca_arbel_post_send(struct ib_qp *
 				    mthca_opcode[wr->opcode]);
 		wmb();
 		((struct mthca_next_seg *) prev_wqe)->ee_nds =
-			cpu_to_be32(MTHCA_NEXT_DBD | size);
+			cpu_to_be32(MTHCA_NEXT_DBD | size |
+                                    ((wr->send_flags & IB_SEND_FENCE) ?
+                                    MTHCA_NEXT_FENCE : 0));
 
 		if (!size0) {
 			size0 = size;

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list