[openib-general] [PATCH][kdapl] Update dat_rmr_bind API

Itamar Rabenstein itamar at mellanox.co.il
Mon Jun 20 01:42:55 PDT 2005


Update dat_rmr_bind function API (added lmr_handle as input param)

Signed-off-by: Itamar Rabenstein <itamar at mellanox.co.il>

Index: test/dapltest/test/dapl_bpool.c
===================================================================
--- test/dapltest/test/dapl_bpool.c	(revision 2656)
+++ test/dapltest/test/dapl_bpool.c	(working copy)
@@ -237,6 +237,7 @@
     			bpool_ptr->reg_addr, bpool_ptr->reg_size));
     
     	ret = dat_rmr_bind ( bpool_ptr->rmr_handle,
+			    bpool_ptr->lmr,
     			    &iov,
     			    mflags,
     			    bpool_ptr->ep,
Index: test/dapltest/kdapl/kdapl_tdep_user.c
===================================================================
--- test/dapltest/kdapl/kdapl_tdep_user.c	(revision 2656)
+++ test/dapltest/kdapl/kdapl_tdep_user.c	(working copy)
@@ -76,7 +76,7 @@
     }
     if (params_ptr->test_type == TRANSACTION_TEST) {
         print_ioctl.cookie = ioctl (fd, KDAPL_IOCTL_GET_STAT_T, &Client_Stats_T);
-        DT_print_transaction_stats(&Client_Stats_T,params_ptr->u.Transaction_Cmd.num_iterations,
+        DT_print_transaction_stats(&Client_Stats_T,params_ptr->u.Transaction_Cmd.num_threads,
                                    params_ptr->u.Transaction_Cmd.eps_per_thread);
     }
 
Index: dat-provider/dapl_rmr.c
===================================================================
--- dat-provider/dapl_rmr.c	(revision 2656)
+++ dat-provider/dapl_rmr.c	(working copy)
@@ -149,26 +149,18 @@
 }
 
 static inline u32 dapl_rmr_bind_fuse(struct dapl_rmr *rmr,
-				     const struct dat_lmr_triplet *lmr_triplet,
+				     struct dapl_lmr *lmr,
+				     const struct dat_lmr_triplet *lmr_triplet,
 				     enum dat_mem_priv_flags mem_priv,
 				     struct dapl_ep *ep_ptr,
 				     DAT_RMR_COOKIE user_cookie,
 				     enum dat_completion_flags completion_flags,
 				     DAT_RMR_CONTEXT *rmr_context)
 {
-	struct dapl_lmr *lmr;
 	struct dapl_cookie *cookie;
 	u32 status;
 	boolean_t is_signaled;
 
-	status = dapl_hash_search(rmr->common.owner_ia->hca->lmr_hash_table,
-                                  lmr_triplet->lmr_context,
-                                  (DAPL_HASH_DATA *) &lmr);
-	if (DAT_SUCCESS != status) {
-		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
-		goto bail;
-	}
-
 	/*
 	 * if the ep in unconnected return an error. IB requires that the
 	 * QP be connected to change a memory window binding since:
@@ -353,27 +345,32 @@
  * Output:
  */
 u32 dapl_rmr_bind(struct dat_rmr *rmr_handle,
-		  const struct dat_lmr_triplet *lmr_triplet,
+		  struct dat_lmr *lmr_handle, const struct dat_lmr_triplet *lmr_triplet,
 		  enum dat_mem_priv_flags mem_priv, struct dat_ep *ep,
 		  DAT_RMR_COOKIE user_cookie,
 		  enum dat_completion_flags completion_flags,
 		  DAT_RMR_CONTEXT *rmr_context)
 {
 	struct dapl_rmr *rmr;
+	struct dapl_lmr *lmr;
 	struct dapl_ep *ep_ptr;
 
 	if (!rmr_handle)
 		return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR);
 
+	if (!lmr_handle)
+		return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR);
+
 	if (!ep)
 		return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
 
 	rmr = (struct dapl_rmr *)rmr_handle;
+	lmr = (struct dapl_lmr *)lmr_handle;
 	ep_ptr = (struct dapl_ep *)ep;
 
 	/* if the rmr should be bound */
 	if (0 != lmr_triplet->segment_length)
-		return dapl_rmr_bind_fuse(rmr, lmr_triplet, mem_priv, ep_ptr,
+		return dapl_rmr_bind_fuse(rmr, lmr, lmr_triplet, mem_priv, ep_ptr,
 					  user_cookie, completion_flags, 
                                           rmr_context);
 	else /* the rmr should be unbound */
Index: dat-provider/dapl.h
===================================================================
--- dat-provider/dapl.h	(revision 2656)
+++ dat-provider/dapl.h	(working copy)
@@ -543,6 +543,7 @@
 			  struct dat_rmr_param *rmr_args);
 
 extern u32 dapl_rmr_bind(struct dat_rmr *rmr,
+			 struct dat_lmr *lmr,
 			 const struct dat_lmr_triplet *lmr_triplet,
 			 enum dat_mem_priv_flags mem_priv,
 			 struct dat_ep *ep,
Index: dat/dat.h
===================================================================
--- dat/dat.h	(revision 2656)
+++ dat/dat.h	(working copy)
@@ -1144,7 +1144,8 @@
 
 typedef u32 (*DAT_RMR_QUERY_FUNC)(struct dat_rmr *, struct dat_rmr_param *);
 
-typedef u32 (*DAT_RMR_BIND_FUNC)(struct dat_rmr *, const struct dat_lmr_triplet *,
+typedef u32 (*DAT_RMR_BIND_FUNC)(struct dat_rmr *, struct dat_lmr *,
+				 const struct dat_lmr_triplet *,
 				 enum dat_mem_priv_flags, struct dat_ep *,
 				 DAT_RMR_COOKIE, enum dat_completion_flags,
 				 DAT_RMR_CONTEXT *);
@@ -1617,23 +1618,24 @@
         return DAT_CALL_PROVIDER_FUNC(rmr_create_func, pz, rmr);
 }
 
-static inline u32 dat_rmr_query(struct dat_rmr * rmr, struct dat_rmr_param *param)
+static inline u32 dat_rmr_query(struct dat_rmr *rmr, struct dat_rmr_param *param)
 {
         return DAT_CALL_PROVIDER_FUNC(rmr_query_func, rmr, param);
 }
 
-static inline u32 dat_rmr_bind(struct dat_rmr * rmr,
-			       const struct dat_lmr_triplet *iov,
+static inline u32 dat_rmr_bind(struct dat_rmr *rmr,
+			       struct dat_lmr *lmr,
+				   const struct dat_lmr_triplet *iov,
 			       enum dat_mem_priv_flags mem_flags,
 			       struct dat_ep *ep, DAT_RMR_COOKIE cookie,
 			       enum dat_completion_flags comp_flags,
 			       DAT_RMR_CONTEXT *context)
 {
-        return DAT_CALL_PROVIDER_FUNC(rmr_bind_func, rmr, iov, mem_flags, ep, 
-                                      cookie, comp_flags, context);
+        return DAT_CALL_PROVIDER_FUNC(rmr_bind_func, rmr, lmr, iov, mem_flags, 
+                                      ep, cookie, comp_flags, context);
 }
 
-static inline u32 dat_rmr_free(struct dat_rmr * rmr)
+static inline u32 dat_rmr_free(struct dat_rmr *rmr)
 {
         return DAT_CALL_PROVIDER_FUNC(rmr_free_func, rmr);
 }
-- 
Itamar



More information about the general mailing list