[openib-general] Update from merging in Roland's changes...

Sean Hefty mshefty at ichips.intel.com
Fri Jul 30 15:32:53 PDT 2004


On Fri, 30 Jul 2004 15:17:13 -0700
Sean Hefty <mshefty at ichips.intel.com> wrote:

> I've updated ib_verbs based on changes that Roland had in his copy of the file.  Specifically, I've updated the ib_xxx structures to include pointers to referenced items, added a usecnt field, and converted the functions from prototypes into static inline routines.  The patch for this update is listed below.


Here's a separate patch to include the lkey/rkey in ib_mr, ib_mw, and ib_fmr.  With these fields included in the structures, the lkey/rkey parameters can be removed from several calls.  I have not committed these changes.  I would like to reach an agreement whether or not we want these changes.

- Sean

Index: ib_verbs.h
===================================================================
--- ib_verbs.h	(revision 548)
+++ ib_verbs.h	(working copy)
@@ -102,18 +102,23 @@
 struct ib_mr {
 	struct ib_device	*device;
 	struct ib_pd		*pd;
+	u32			lkey;
+	u32			rkey;
 	atomic_t		usecnt;
 };
 
 struct ib_mw {
 	struct ib_device	*device;
 	struct ib_pd		*pd;
+	u32			rkey;
 	atomic_t		usecnt;
 };
 
 struct ib_fmr {
 	struct ib_device	*device;
 	struct ib_pd		*pd;
+	u32			lkey;
+	u32			rkey;
 	atomic_t		usecnt;
 };
 
@@ -419,8 +424,6 @@
 	u64		device_virt_addr;
 	u64		size;
 	int		mr_access_flags;
-	u32		lkey;
-	u32		rkey;
 };
 
 enum ib_mr_rereg_flags {
@@ -719,12 +722,10 @@
 					   struct ib_phys_buf *phys_buf_array,
 					   int num_phys_buf,
 					   int mr_access_flags,
-					   u64 *iova_start,
-					   u32 *lkey,
-					   u32 *rkey)
+					   u64 *iova_start)
 {
 	return pd->device->reg_phys_mr(pd, phys_buf_array, num_phys_buf,
-				       mr_access_flags, iova_start, lkey, rkey);
+				       mr_access_flags, iova_start);
 }
 
 static inline int ib_query_mr(struct ib_mr *mr,
@@ -744,34 +745,23 @@
 				   struct ib_phys_buf *phys_buf_array,
 				   int num_phys_buf,
 				   int mr_access_flags,
-				   u64 *iova_start,
-				   u32 *lkey,
-				   u32 *rkey)
+				   u64 *iova_start)
 {
 	return mr->device->rereg_phys_mr(mr, mr_rereg_mask, pd, phys_buf_array,
 					 num_phys_buf, mr_access_flags,
-					 iova_start, lkey, rkey);
+					 iova_start);
 }
 
-static inline struct ib_mw *ib_alloc_mw(struct ib_pd *pd,
-					u32 *rkey)
+static inline struct ib_mw *ib_alloc_mw(struct ib_pd *pd)
 {
-	return pd->device->allow_mw(pd, rkey);
-}
-
-static inline int ib_query_mw(struct ib_mw *mw,
-			      u32 *rkey, 
-			      struct ib_pd **pd)
-{
-	return mw->device->query_mw(mw, rkey, pd);
+	return pd->device->alloc_mw(pd);
 }
 
 static inline int ib_bind_mw(struct ib_qp *qp,
 			     struct ib_mw *mw,
-			     struct ib_mw_bind *mw_bind,
-			     u32 *rkey)
+			     struct ib_mw_bind *mw_bind)
 {
-	return mw->device->bind_mw(qp, mw, mw_bind, rkey);
+	return mw->device->bind_mw(qp, mw, mw_bind);
 }
 
 static inline int ib_dealloc_mw(struct ib_mw *mw)
@@ -788,21 +778,16 @@
 
 static inline int ib_map_fmr(struct ib_fmr *fmr,
 			     void *addr,
-			     u64 size,
-			     u32 *lkey,
-			     u32 *rkey)
+			     u64 size)
 {
-	return fmr->device->map_fmr(fmr, addr, size, lkey, rkey);
+	return fmr->device->map_fmr(fmr, addr, size);
 }
 
 static inline int ib_map_phys_fmr(struct ib_fmr *fmr,
 				  struct ib_phys_buf *phys_buf_array,
-				  int num_phys_buf,
-				  u32 *lkey,
-				  u32 *rkey)
+				  int num_phys_buf)
 {
-	return fmr->device->map_phys_fmr(fmr, phys_buf_array, num_phys_buf,
-					 lkey, rkey);
+	return fmr->device->map_phys_fmr(fmr, phys_buf_array, num_phys_buf);
 }
 
 /* Need to discuss this... */



More information about the general mailing list