[openib-general] [PATCH][5/19] kDAPL: Remove typedef DAT_COMPLETION_FLAGS

Tom Duffy Tom.Duffy at Sun.COM
Sun May 15 11:27:16 PDT 2005


Signed-off-by: Tom Duffy <tduffy at sun.com>

diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat/dat.h linux-kernel5/dat/dat.h
--- linux-kernel4/dat/dat.h	2005-05-13 12:42:37.630017000 -0700
+++ linux-kernel5/dat/dat.h	2005-05-13 12:48:43.104001000 -0700
@@ -370,7 +370,7 @@ typedef union dat_context {
 typedef DAT_CONTEXT DAT_DTO_COOKIE;
 typedef DAT_CONTEXT DAT_RMR_COOKIE;
 
-typedef enum dat_completion_flags {
+enum dat_completion_flags {
 	/* Completes with notification                                     */
 	DAT_COMPLETION_DEFAULT_FLAG = 0x00,
 	/* Completions suppressed if successful                            */
@@ -386,7 +386,7 @@ typedef enum dat_completion_flags {
 	 * dat_evd_wait. UNSIGNALLED for RECV is not allowed when EP has
 	 * this attribute. */
 	DAT_COMPLETION_EVD_THRESHOLD_FLAG = 0x10
-} DAT_COMPLETION_FLAGS;
+};
 
 typedef u32 DAT_TIMEOUT;	/* microseconds */
 
@@ -561,8 +561,8 @@ struct dat_ep_attr {
 	u64 max_message_size;
 	u64 max_rdma_size;
 	enum dat_qos qos;
-	DAT_COMPLETION_FLAGS recv_completion_flags;
-	DAT_COMPLETION_FLAGS request_completion_flags;
+	enum dat_completion_flags recv_completion_flags;
+	enum dat_completion_flags request_completion_flags;
 	int max_recv_dtos;
 	int max_request_dtos;
 	int max_recv_iov;
@@ -1065,7 +1065,7 @@ struct dat_provider_attr {
 	DAT_MEM_TYPE lmr_mem_types_supported;
 	DAT_IOV_OWNERSHIP iov_ownership_on_return;
 	enum dat_qos dat_qos_supported;
-	DAT_COMPLETION_FLAGS completion_flags_supported;
+	enum dat_completion_flags completion_flags_supported;
 	boolean_t is_thread_safe;
 	int max_private_data_size;
 	boolean_t supports_multipath;
@@ -1157,23 +1157,23 @@ typedef u32 (*DAT_EP_DISCONNECT_FUNC)(DA
 
 typedef u32 (*DAT_EP_POST_SEND_FUNC)(DAT_EP_HANDLE, int,
 				     struct dat_lmr_triplet *, DAT_DTO_COOKIE,
-				     DAT_COMPLETION_FLAGS);
+				     enum dat_completion_flags);
 
 typedef u32 (*DAT_EP_POST_RECV_FUNC)(DAT_EP_HANDLE, int,
 				     struct dat_lmr_triplet *, DAT_DTO_COOKIE,
-				     DAT_COMPLETION_FLAGS);
+				     enum dat_completion_flags);
 
 typedef u32 (*DAT_EP_POST_RDMA_READ_FUNC)(DAT_EP_HANDLE, int,
 					  struct dat_lmr_triplet *,
 					  DAT_DTO_COOKIE,
 					  const struct dat_rmr_triplet *,
-					  DAT_COMPLETION_FLAGS);
+					  enum dat_completion_flags);
 
 typedef u32 (*DAT_EP_POST_RDMA_WRITE_FUNC)(DAT_EP_HANDLE, int,
 					   struct dat_lmr_triplet *,
 					   DAT_DTO_COOKIE,
 					   const struct dat_rmr_triplet *,
-					   DAT_COMPLETION_FLAGS);
+					   enum dat_completion_flags);
 
 typedef u32 (*DAT_EP_GET_STATUS_FUNC)(DAT_EP_HANDLE, DAT_EP_STATE *,
 				      boolean_t *, boolean_t *);
@@ -1204,7 +1204,7 @@ typedef u32 (*DAT_RMR_QUERY_FUNC)(DAT_RM
 
 typedef u32 (*DAT_RMR_BIND_FUNC)(DAT_RMR_HANDLE, const struct dat_lmr_triplet *,
 				 DAT_MEM_PRIV_FLAGS, DAT_EP_HANDLE,
-				 DAT_RMR_COOKIE, DAT_COMPLETION_FLAGS,
+				 DAT_RMR_COOKIE, enum dat_completion_flags,
 				 DAT_RMR_CONTEXT *);
 
 typedef u32 (*DAT_RMR_FREE_FUNC)(DAT_RMR_HANDLE);
@@ -1563,7 +1563,7 @@ static inline u32 dat_ep_post_rdma_read(
 					struct dat_lmr_triplet *local_iov,
 					DAT_DTO_COOKIE cookie,
 					const struct dat_rmr_triplet *remote_iov,
-					DAT_COMPLETION_FLAGS flags)
+					enum dat_completion_flags flags)
 {
         return DAT_CALL_PROVIDER_FUNC(ep_post_rdma_read_func, ep, size, 
                                       local_iov, cookie, remote_iov, flags);
@@ -1573,7 +1573,7 @@ static inline u32 dat_ep_post_rdma_write
 					 struct dat_lmr_triplet *local_iov,
 					 DAT_DTO_COOKIE cookie,
 					 const struct dat_rmr_triplet *remote_iov,
-					 DAT_COMPLETION_FLAGS flags)
+					 enum dat_completion_flags flags)
 {
         return DAT_CALL_PROVIDER_FUNC(ep_post_rdma_write_func, ep, size, 
                                       local_iov, cookie, remote_iov, flags);
@@ -1582,7 +1582,7 @@ static inline u32 dat_ep_post_rdma_write
 static inline u32 dat_ep_post_recv(DAT_EP_HANDLE ep, int size,
 				   struct dat_lmr_triplet *local_iov,
 				   DAT_DTO_COOKIE cookie,
-				   DAT_COMPLETION_FLAGS flags)
+				   enum dat_completion_flags flags)
 {
         return DAT_CALL_PROVIDER_FUNC(ep_post_recv_func, ep, size, local_iov,
 				      cookie, flags);
@@ -1592,7 +1592,7 @@ static inline u32 dat_ep_post_send(DAT_E
                                           int size, 
                                           struct dat_lmr_triplet *local_iov,
                                           DAT_DTO_COOKIE cookie, 
-                                          DAT_COMPLETION_FLAGS flags)
+                                          enum dat_completion_flags flags)
 {
         return DAT_CALL_PROVIDER_FUNC(
                 ep_post_send_func, ep, size, local_iov, cookie, flags);
@@ -1663,7 +1663,7 @@ static inline u32 dat_rmr_bind(DAT_RMR_H
 			       const struct dat_lmr_triplet *iov,
 			       DAT_MEM_PRIV_FLAGS mem_flags,
 			       DAT_EP_HANDLE ep, DAT_RMR_COOKIE cookie,
-			       DAT_COMPLETION_FLAGS comp_flags,
+			       enum dat_completion_flags comp_flags,
 			       DAT_RMR_CONTEXT *context)
 {
         return DAT_CALL_PROVIDER_FUNC(rmr_bind_func, rmr, iov, mem_flags, ep, 
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_post_rdma_read.c linux-kernel5/dat-provider/dapl_ep_post_rdma_read.c
--- linux-kernel4/dat-provider/dapl_ep_post_rdma_read.c	2005-05-13 10:10:34.053960000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_post_rdma_read.c	2005-05-13 12:48:23.534001000 -0700
@@ -70,7 +70,7 @@ u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE
 			   struct dat_lmr_triplet *local_iov,
 			   DAT_DTO_COOKIE user_cookie,
 			   const struct dat_rmr_triplet *remote_iov,
-			   DAT_COMPLETION_FLAGS completion_flags)
+			   enum dat_completion_flags completion_flags)
 {
 
 	u32 dat_status;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_post_rdma_write.c linux-kernel5/dat-provider/dapl_ep_post_rdma_write.c
--- linux-kernel4/dat-provider/dapl_ep_post_rdma_write.c	2005-05-13 10:10:33.166966000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_post_rdma_write.c	2005-05-13 12:48:23.536005000 -0700
@@ -70,7 +70,7 @@ u32 dapl_ep_post_rdma_write(DAT_EP_HANDL
 			    struct dat_lmr_triplet *local_iov,
 			    DAT_DTO_COOKIE user_cookie,
 			    const struct dat_rmr_triplet *remote_iov,
-			    DAT_COMPLETION_FLAGS completion_flags)
+			    enum dat_completion_flags completion_flags)
 {
 	u32 dat_status;
 
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_post_recv.c linux-kernel5/dat-provider/dapl_ep_post_recv.c
--- linux-kernel4/dat-provider/dapl_ep_post_recv.c	2005-05-13 10:10:34.508971000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_post_recv.c	2005-05-13 12:48:23.539008000 -0700
@@ -69,7 +69,7 @@
 u32 dapl_ep_post_recv(DAT_EP_HANDLE ep_handle, int num_segments,
 		      struct dat_lmr_triplet *local_iov,
 		      DAT_DTO_COOKIE user_cookie,
-		      DAT_COMPLETION_FLAGS completion_flags)
+		      enum dat_completion_flags completion_flags)
 {
 	DAPL_EP *ep_ptr;
 	DAPL_COOKIE *cookie;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_post_send.c linux-kernel5/dat-provider/dapl_ep_post_send.c
--- linux-kernel4/dat-provider/dapl_ep_post_send.c	2005-05-13 10:10:33.398972000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_post_send.c	2005-05-13 12:48:23.542011000 -0700
@@ -66,7 +66,7 @@
 u32 dapl_ep_post_send(DAT_EP_HANDLE ep_handle, int num_segments,
 		      struct dat_lmr_triplet *local_iov,
 		      DAT_DTO_COOKIE user_cookie,
-		      DAT_COMPLETION_FLAGS completion_flags)
+		      enum dat_completion_flags completion_flags)
 {
 	struct dat_rmr_triplet remote_iov = { 0, 0, 0, 0 };
 	u32 dat_status;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_util.c linux-kernel5/dat-provider/dapl_ep_util.c
--- linux-kernel4/dat-provider/dapl_ep_util.c	2005-05-13 10:10:33.960972000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_util.c	2005-05-13 12:48:23.546002000 -0700
@@ -257,7 +257,7 @@ void dapl_ep_default_attrs(DAPL_EP * ep_
 	return;
 }
 
-u32 dapl_ep_check_recv_completion_flags(DAT_COMPLETION_FLAGS flags)
+u32 dapl_ep_check_recv_completion_flags(enum dat_completion_flags flags)
 {
 
 	/*
@@ -276,7 +276,7 @@ u32 dapl_ep_check_recv_completion_flags(
 	return DAT_SUCCESS;
 }
 
-u32 dapl_ep_check_request_completion_flags(DAT_COMPLETION_FLAGS flags)
+u32 dapl_ep_check_request_completion_flags(enum dat_completion_flags flags)
 {
 	return DAT_SUCCESS;
 }
@@ -285,7 +285,7 @@ u32 dapl_ep_post_send_req(DAT_EP_HANDLE 
 			  struct dat_lmr_triplet *local_iov,
 			  DAT_DTO_COOKIE user_cookie,
 			  const struct dat_rmr_triplet *remote_iov,
-			  DAT_COMPLETION_FLAGS completion_flags,
+			  enum dat_completion_flags completion_flags,
 			  DAPL_DTO_TYPE dto_type, int op_type)
 {
 	DAPL_EP *ep_ptr;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_ep_util.h linux-kernel5/dat-provider/dapl_ep_util.h
--- linux-kernel4/dat-provider/dapl_ep_util.h	2005-05-13 10:10:34.006969000 -0700
+++ linux-kernel5/dat-provider/dapl_ep_util.h	2005-05-13 12:51:14.536002000 -0700
@@ -46,15 +46,16 @@ extern DAPL_EP *dapl_ep_alloc(DAPL_IA * 
 
 extern void dapl_ep_dealloc(DAPL_EP * ep_ptr);
 
-extern u32 dapl_ep_check_recv_completion_flags(DAT_COMPLETION_FLAGS flags);
+extern u32 dapl_ep_check_recv_completion_flags(enum dat_completion_flags flags);
 
-extern u32 dapl_ep_check_request_completion_flags(DAT_COMPLETION_FLAGS flags);
+extern u32 dapl_ep_check_request_completion_flags(enum dat_completion_flags
+							flags);
 
 extern u32 dapl_ep_post_send_req(DAT_EP_HANDLE ep_handle, int num_segments,
 				 struct dat_lmr_triplet *local_iov,
 				 DAT_DTO_COOKIE user_cookie,
 				 const struct dat_rmr_triplet *remote_iov,
-				 DAT_COMPLETION_FLAGS completion_flags,
+				 enum dat_completion_flags completion_flags,
 				 DAPL_DTO_TYPE dto_type, int op_type);
 
 void dapl_ep_timeout(uintptr_t arg);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl.h linux-kernel5/dat-provider/dapl.h
--- linux-kernel4/dat-provider/dapl.h	2005-05-13 12:43:32.918003000 -0700
+++ linux-kernel5/dat-provider/dapl.h	2005-05-13 12:48:23.531003000 -0700
@@ -576,26 +576,26 @@ extern u32 dapl_ep_disconnect(DAT_EP_HAN
 extern u32 dapl_ep_post_send(DAT_EP_HANDLE ep_handle, int num_segments,
 			     struct dat_lmr_triplet *local_iov,
 			     DAT_DTO_COOKIE user_cookie,
-			     DAT_COMPLETION_FLAGS completion_flags);
+			     enum dat_completion_flags completion_flags);
 
 extern u32 dapl_ep_post_recv(DAT_EP_HANDLE ep_handle, int num_segments,
 			     struct dat_lmr_triplet *local_iov,
 			     DAT_DTO_COOKIE user_cookie,
-			     DAT_COMPLETION_FLAGS completion_flags);
+			     enum dat_completion_flags completion_flags);
 
 extern u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE ep_handle,
 				  int num_segments,
 				  struct dat_lmr_triplet *local_iov,
 				  DAT_DTO_COOKIE user_cookie,
 				  const struct dat_rmr_triplet *remote_iov,
-				  DAT_COMPLETION_FLAGS completion_flags);
+				  enum dat_completion_flags completion_flags);
 
 extern u32 dapl_ep_post_rdma_write(DAT_EP_HANDLE ep_handle,
 				   int num_segments,
 				   struct dat_lmr_triplet *local_iov,
 				   DAT_DTO_COOKIE user_cookie,
 				   const struct dat_rmr_triplet *remote_iov,
-				   DAT_COMPLETION_FLAGS completion_flags);
+				   enum dat_completion_flags completion_flags);
 
 extern u32 dapl_ep_get_status(DAT_EP_HANDLE ep_handle, DAT_EP_STATE *ep_state,
 			      boolean_t *in_dto_idle, boolean_t *out_dto_idle);
@@ -657,7 +657,7 @@ extern u32 dapl_rmr_bind(DAT_RMR_HANDLE 
 			 const struct dat_lmr_triplet *lmr_triplet,
 			 DAT_MEM_PRIV_FLAGS mem_priv, DAT_EP_HANDLE ep_handle,
 			 DAT_RMR_COOKIE user_cookie,
-			 DAT_COMPLETION_FLAGS completion_flags,
+			 enum dat_completion_flags completion_flags,
 			 DAT_RMR_CONTEXT *context);
 
 extern u32 dapl_rmr_free(DAT_RMR_HANDLE);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_openib_dto.h linux-kernel5/dat-provider/dapl_openib_dto.h
--- linux-kernel4/dat-provider/dapl_openib_dto.h	2005-05-13 10:10:33.258972000 -0700
+++ linux-kernel5/dat-provider/dapl_openib_dto.h	2005-05-13 12:52:57.961018000 -0700
@@ -99,12 +99,12 @@ static __inline__ u32 dapl_ib_post_recv(
  *
  * Provider specific Post SEND function
  */
-static __inline__ u32 dapl_ib_post_send(DAPL_EP *ep_ptr, int op_type,
-					DAPL_COOKIE *cookie,
-					int num_segments,
-					struct dat_lmr_triplet *local_iov,
-					const struct dat_rmr_triplet *remote_iov,
-					DAT_COMPLETION_FLAGS completion_flags)
+static inline u32 dapl_ib_post_send(DAPL_EP *ep_ptr, int op_type,
+				    DAPL_COOKIE *cookie,
+				    int num_segments,
+				    struct dat_lmr_triplet *local_iov,
+				    const struct dat_rmr_triplet *remote_iov,
+				    enum dat_completion_flags completion_flags)
 {
 	struct ib_send_wr send_desc = { NULL };
 	struct ib_send_wr *send_desc_fail;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_rmr_bind.c linux-kernel5/dat-provider/dapl_rmr_bind.c
--- linux-kernel4/dat-provider/dapl_rmr_bind.c	2005-05-12 09:28:47.829013000 -0700
+++ linux-kernel5/dat-provider/dapl_rmr_bind.c	2005-05-13 12:55:03.339011000 -0700
@@ -51,7 +51,7 @@ static inline u32 dapl_rmr_bind_fuse(DAP
 				     DAT_MEM_PRIV_FLAGS mem_priv,
 				     DAPL_EP *ep_ptr,
 				     DAT_RMR_COOKIE user_cookie,
-				     DAT_COMPLETION_FLAGS completion_flags,
+				     enum dat_completion_flags completion_flags,
 				     DAT_RMR_CONTEXT *rmr_context)
 {
 	DAPL_LMR *lmr;
@@ -158,7 +158,7 @@ static inline u32 dapl_rmr_bind_fuse(DAP
 
 static inline u32 dapl_rmr_bind_unfuse(DAPL_RMR *rmr, DAPL_EP *ep_ptr,
 				       DAT_RMR_COOKIE user_cookie,
-				       DAT_COMPLETION_FLAGS completion_flags)
+				       enum dat_completion_flags cflags)
 {
 	DAPL_COOKIE *cookie;
 	u32 status = DAT_SUCCESS;
@@ -189,15 +189,14 @@ static inline u32 dapl_rmr_bind_unfuse(D
 	if (!dapl_rmr_validate_completion_flag(DAT_COMPLETION_SUPPRESS_FLAG,
 					       ep_ptr->param.ep_attr.
 					       request_completion_flags,
-					       completion_flags) ||
+					       cflags) ||
 	    !dapl_rmr_validate_completion_flag(DAT_COMPLETION_UNSIGNALLED_FLAG,
 					       ep_ptr->param.ep_attr.
 					       request_completion_flags,
-					       completion_flags) ||
+					       cflags) ||
 	    !dapl_rmr_validate_completion_flag(
                     DAT_COMPLETION_BARRIER_FENCE_FLAG,
-                    ep_ptr->param.ep_attr.request_completion_flags,
-                    completion_flags)) {
+                    ep_ptr->param.ep_attr.request_completion_flags, cflags)) {
 		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
 		goto bail1;
 	}
@@ -207,8 +206,7 @@ static inline u32 dapl_rmr_bind_unfuse(D
 	if (DAT_SUCCESS != status)
 		goto bail1;
 
-	is_signaled = (completion_flags & DAT_COMPLETION_UNSIGNALLED_FLAG) ? 
-                FALSE : TRUE;
+	is_signaled = (cflags & DAT_COMPLETION_UNSIGNALLED_FLAG) ? FALSE : TRUE;
 
 	/*
 	 * Take reference before posting to avoid race conditions with 
@@ -253,7 +251,7 @@ u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_han
 		  const struct dat_lmr_triplet *lmr_triplet,
 		  DAT_MEM_PRIV_FLAGS mem_priv, DAT_EP_HANDLE ep_handle,
 		  DAT_RMR_COOKIE user_cookie,
-		  DAT_COMPLETION_FLAGS completion_flags,
+		  enum dat_completion_flags completion_flags,
 		  DAT_RMR_CONTEXT *rmr_context)
 {
 	DAPL_RMR *rmr;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel4/dat-provider/dapl_rmr_util.h linux-kernel5/dat-provider/dapl_rmr_util.h
--- linux-kernel4/dat-provider/dapl_rmr_util.h	2005-05-11 08:28:12.678010000 -0700
+++ linux-kernel5/dat-provider/dapl_rmr_util.h	2005-05-13 12:57:13.871055000 -0700
@@ -49,27 +49,15 @@ extern DAPL_RMR *dapl_rmr_alloc(DAPL_PZ 
 
 extern void dapl_rmr_dealloc(DAPL_RMR * rmr);
 
-static __inline__ boolean_t
-dapl_rmr_validate_completion_flag(DAT_COMPLETION_FLAGS mask,
-				  DAT_COMPLETION_FLAGS allow,
-				  DAT_COMPLETION_FLAGS request);
-
-/*********************************************************************
- *                                                                   *
- * Inline Functions                                                  *
- *                                                                   *
- *********************************************************************/
-
-static __inline__ boolean_t
-dapl_rmr_validate_completion_flag(DAT_COMPLETION_FLAGS mask,
-				  DAT_COMPLETION_FLAGS allow,
-				  DAT_COMPLETION_FLAGS request)
+static inline boolean_t
+dapl_rmr_validate_completion_flag(enum dat_completion_flags mask,
+				  enum dat_completion_flags allow,
+				  enum dat_completion_flags request)
 {
-	if ((mask & request) && !(mask & allow)) {
+	if ((mask & request) && !(mask & allow))
 		return FALSE;
-	} else {
+	else
 		return TRUE;
-	}
 }
 
 #endif				/* DAPL_RMR_UTIL_H */




More information about the general mailing list