[openib-general] [PATCH] defined struct ib_mw_bind

Sean Hefty mshefty at ichips.intel.com
Tue Aug 10 16:27:01 PDT 2004


On Tue, 10 Aug 2004 16:20:36 -0700
Sean Hefty <mshefty at ichips.intel.com> wrote:

> Here's a patch that defines ib_mw_bind.  Rather than defining yet another set of flags, I combined the MR, QP, and MW memory access flags together.  I will submit a second patch to update Roland's tree, to keep mthca in sync with this change.

Patch for mthca files (or whatever was under linux-kernel/infiniband).

- Sean


Index: ulp/ipoib/ipoib_verbs.c
===================================================================
--- ulp/ipoib/ipoib_verbs.c	(revision 626)
+++ ulp/ipoib/ipoib_verbs.c	(working copy)
@@ -227,7 +227,7 @@
 
 		priv->mr = ib_reg_phys_mr(priv->pd, &buffer_list,
 					  1,	/* list_len */
-					  IB_MR_LOCAL_WRITE,
+					  IB_ACCESS_LOCAL_WRITE,
 					  &dummy_iova);
 		if (IS_ERR(priv->mr)) {
 			TS_REPORT_FATAL(MOD_IB_NET,
Index: ulp/srp/srp_host.c
===================================================================
--- ulp/srp/srp_host.c	(revision 626)
+++ ulp/srp/srp_host.c	(working copy)
@@ -606,8 +606,8 @@
 		target->srp_pkt_data_mhndl[hca_index] =
 			ib_reg_phys_mr(hca->pd_hndl, &buffer_list,
 				       1, /*list_len */
-				       IB_MR_LOCAL_WRITE |
-				       IB_MR_REMOTE_READ,
+				       IB_ACCESS_LOCAL_WRITE |
+				       IB_ACCESS_REMOTE_READ,
 				       &iova);
 
 		if (IS_ERR(target->srp_pkt_data_mhndl[hca_index])) {
Index: include/ib_verbs.h
===================================================================
--- include/ib_verbs.h	(revision 626)
+++ include/ib_verbs.h	(working copy)
@@ -125,12 +125,12 @@
 	IB_CQ_NEXT_COMP
 };
 
-enum ib_mr_access_flags {
-	IB_MR_LOCAL_WRITE	= 1,
-	IB_MR_REMOTE_WRITE	= (1<<1),
-	IB_MR_REMOTE_READ	= (1<<2),
-	IB_MR_REMOTE_ATOMIC	= (1<<3),
-	IB_MR_MW_BIND		= (1<<4)
+enum ib_access_flags {
+	IB_ACCESS_LOCAL_WRITE	= 1,
+	IB_ACCESS_REMOTE_WRITE	= (1<<1),
+	IB_ACCESS_REMOTE_READ	= (1<<2),
+	IB_ACCESS_REMOTE_ATOMIC	= (1<<3),
+	IB_ACCESS_MW_BIND	= (1<<4)
 };
 
 struct ib_phys_buf {
Index: core/mad_main.c
===================================================================
--- core/mad_main.c	(revision 626)
+++ core/mad_main.c	(working copy)
@@ -58,7 +58,7 @@
 	};
 
         *mr = ib_reg_phys_mr(pd, &buffer_list, 1, /* list_len */
-			     IB_MR_LOCAL_WRITE, &iova);
+			     IB_ACCESS_LOCAL_WRITE, &iova);
         if (IS_ERR(*mr)) {
                 TS_REPORT_WARN(MOD_KERNEL_IB,
                                "ib_reg_phys_mr failed "
Index: hw/mthca/mthca_provider.c
===================================================================
--- hw/mthca/mthca_provider.c	(revision 626)
+++ hw/mthca/mthca_provider.c	(working copy)
@@ -495,10 +495,10 @@
 			page_list[n++] = buffer_list[i].addr + ((u64) j << shift);
 
 	access =
-		(acc & IB_MR_REMOTE_ATOMIC ? MTHCA_MPT_FLAG_ATOMIC       : 0) |
-		(acc & IB_MR_REMOTE_WRITE  ? MTHCA_MPT_FLAG_REMOTE_WRITE : 0) |
-		(acc & IB_MR_REMOTE_READ   ? MTHCA_MPT_FLAG_REMOTE_READ  : 0) |
-		(acc & IB_MR_LOCAL_WRITE   ? MTHCA_MPT_FLAG_LOCAL_WRITE  : 0) |
+		(acc & IB_ACCESS_REMOTE_ATOMIC ? MTHCA_MPT_FLAG_ATOMIC       : 0) |
+		(acc & IB_ACCESS_REMOTE_WRITE  ? MTHCA_MPT_FLAG_REMOTE_WRITE : 0) |
+		(acc & IB_ACCESS_REMOTE_READ   ? MTHCA_MPT_FLAG_REMOTE_READ  : 0) |
+		(acc & IB_ACCESS_LOCAL_WRITE   ? MTHCA_MPT_FLAG_LOCAL_WRITE  : 0) |
 		MTHCA_MPT_FLAG_LOCAL_READ;
 
 	mthca_dbg(to_mdev(pd->device), "Registering memory at %llx (iova %llx) "



More information about the general mailing list