[openib-general] [PATCH 1/2] kDAPL: remove inline functions

Tom Duffy tduffy at sun.com
Tue Aug 2 15:00:47 PDT 2005


This patch removes all the inline functions, instead just call the
functions from the function table.  It also removes the _func from the
names as this is obvious by its type.

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

Index: linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/kdapl.h
===================================================================
--- linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/kdapl.h	(revision 2952)
+++ linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/kdapl.h	(working copy)
@@ -572,11 +572,9 @@ enum dat_upcall_policy {
 					 */
 };
 
-typedef void (*DAT_UPCALL_FUNC) (void *, const struct dat_event *, boolean_t);
-
 struct dat_upcall_object {
 	void *instance_data;
-	DAT_UPCALL_FUNC upcall_func;
+	void (*upcall)(void *, const struct dat_event *, boolean_t);
 };
 
 /* Define NULL upcall */
@@ -736,113 +734,104 @@ struct dat_provider {
 	const char *ia_name;
 	void *extension;
 
-	int (*ia_open_func)(const char *, int, struct dat_evd **,
-			    struct dat_ia **);
-	int (*ia_query_func)(struct dat_ia *, struct dat_evd **,
-			     struct dat_ia_attr *, struct dat_provider_attr *);
-	int (*ia_close_func)(struct dat_ia *, enum dat_close_flags);
-	int (*ia_memtype_hint_func)(struct dat_ia *, enum dat_mem_type, u64,
-				    enum dat_mem_optimize_flags, u64 *, u64 *);
-	int (*cr_query_func)(struct dat_cr *, struct dat_cr_param *);
-	int (*cr_accept_func)(struct dat_cr *, struct dat_ep *, int, 
-			      const void*);
-	int (*cr_reject_func)(struct dat_cr *);
-	int (*cr_handoff_func)(struct dat_cr *, DAT_CONN_QUAL);
-	int (*evd_kcreate_func)(struct dat_ia *, int, enum dat_upcall_policy,
-				const struct dat_upcall_object *, 
-				enum dat_evd_flags, struct dat_evd **);
-	int (*evd_query_func)(struct dat_evd *, struct dat_evd_param *);
-	int (*evd_modify_upcall_func)(struct dat_evd *, enum dat_upcall_policy,
-				      const struct dat_upcall_object *);
-	int (*evd_resize_func)(struct dat_evd *, int);
-	int (*evd_post_se_func)(struct dat_evd *, const struct dat_event *);
-	int (*evd_dequeue_func)(struct dat_evd *, struct dat_event *);
-	int (*evd_free_func)(struct dat_evd *);
-	int (*ep_create_func)(struct dat_ia *, struct dat_pz *, struct dat_evd *,
-			      struct dat_evd *, struct dat_evd *, 
-			      const struct dat_ep_attr *, struct dat_ep **);
-	int (*ep_query_func)(struct dat_ep *, struct dat_ep_param *);
-	int (*ep_modify_func)(struct dat_ep *, enum dat_ep_param_mask,
-			      const struct dat_ep_param *);
-	int (*ep_connect_func)(struct dat_ep *, struct sockaddr *, DAT_CONN_QUAL,
-			       unsigned long, int, const void *, enum dat_qos, 
-			       enum dat_connect_flags);
-
-	int (*ep_dup_connect_func)(struct dat_ep *, struct dat_ep *, 
-				   unsigned long, int, const void *, 
-				   enum dat_qos);
-	int (*ep_disconnect_func)(struct dat_ep *, enum dat_close_flags);
-	int (*ep_post_send_func)(struct dat_ep *, int, struct dat_lmr_triplet *, 
-				 DAT_DTO_COOKIE, enum dat_completion_flags);
-	int (*ep_post_recv_func)(struct dat_ep *, int, struct dat_lmr_triplet *, 
-				 DAT_DTO_COOKIE, enum dat_completion_flags);
-	int (*ep_post_rdma_read_func)(struct dat_ep *, int, 
-				      struct dat_lmr_triplet *, DAT_DTO_COOKIE,
-				      const struct dat_rmr_triplet *,
-				      enum dat_completion_flags);
-	int (*ep_post_rdma_write_func)(struct dat_ep *, int,
-				       struct dat_lmr_triplet *, DAT_DTO_COOKIE,
-				       const struct dat_rmr_triplet *,
-				       enum dat_completion_flags);
-	int (*ep_get_status_func)(struct dat_ep *, enum dat_ep_state *,
-				  boolean_t *, boolean_t *);
-
-	int (*ep_free_func)(struct dat_ep *);
-	int (*lmr_kcreate_func)(struct dat_ia *, enum dat_mem_type,
-				DAT_REGION_DESCRIPTION, u64, struct dat_pz *, 
-				enum dat_mem_priv_flags, 
-				enum dat_mem_optimize_flags, struct dat_lmr **,
-				DAT_LMR_CONTEXT *, DAT_RMR_CONTEXT *, u64 *, 
-				u64 *);
-	int (*lmr_query_func)(struct dat_lmr *, struct dat_lmr_param *);
-	int (*lmr_free_func)(struct dat_lmr *);
-	int (*rmr_create_func)(struct dat_pz *, struct dat_rmr **);
-	int (*rmr_query_func)(struct dat_rmr *, struct dat_rmr_param *);
-	int (*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 *);
-	int (*rmr_free_func)(struct dat_rmr *);
-
-	int (*psp_create_func)(struct dat_ia *, DAT_CONN_QUAL, struct dat_evd *,
-			       enum dat_psp_flags, struct dat_sp **);
-	int (*psp_query_func)(struct dat_sp *, struct dat_psp_param *);
-	int (*psp_free_func)(struct dat_sp *);
-	int (*rsp_create_func)(struct dat_ia *, DAT_CONN_QUAL, struct dat_ep *,
-			       struct dat_evd *, struct dat_sp **);
-	int (*rsp_query_func)(struct dat_sp *, struct dat_rsp_param *);
-	int (*rsp_free_func)(struct dat_sp *);
-	int (*pz_create_func)(struct dat_ia *, struct dat_pz **);
-	int (*pz_query_func)(struct dat_pz *, struct dat_pz_param *);
-	int (*pz_free_func)(struct dat_pz *);
+	int (*ia_open)(const char *, int, struct dat_evd **, struct dat_ia **);
+	int (*ia_query)(struct dat_ia *, struct dat_evd **,
+			struct dat_ia_attr *, struct dat_provider_attr *);
+	int (*ia_close)(struct dat_ia *, enum dat_close_flags);
+	int (*ia_memtype_hint)(struct dat_ia *, enum dat_mem_type, u64,
+			       enum dat_mem_optimize_flags, u64 *, u64 *);
+	int (*cr_query)(struct dat_cr *, struct dat_cr_param *);
+	int (*cr_accept)(struct dat_cr *, struct dat_ep *, int, const void*);
+	int (*cr_reject)(struct dat_cr *);
+	int (*cr_handoff)(struct dat_cr *, DAT_CONN_QUAL);
+	int (*evd_kcreate)(struct dat_ia *, int, enum dat_upcall_policy,
+			   const struct dat_upcall_object *,
+			   enum dat_evd_flags, struct dat_evd **);
+	int (*evd_query)(struct dat_evd *, struct dat_evd_param *);
+	int (*evd_modify_upcall)(struct dat_evd *, enum dat_upcall_policy,
+				 const struct dat_upcall_object *);
+	int (*evd_resize)(struct dat_evd *, int);
+	int (*evd_post_se)(struct dat_evd *, const struct dat_event *);
+	int (*evd_dequeue)(struct dat_evd *, struct dat_event *);
+	int (*evd_free)(struct dat_evd *);
+	int (*ep_create)(struct dat_ia *, struct dat_pz *, struct dat_evd *,
+			 struct dat_evd *, struct dat_evd *,
+			 const struct dat_ep_attr *, struct dat_ep **);
+	int (*ep_query)(struct dat_ep *, struct dat_ep_param *);
+	int (*ep_modify)(struct dat_ep *, enum dat_ep_param_mask,
+			 const struct dat_ep_param *);
+	int (*ep_connect)(struct dat_ep *, struct sockaddr *, DAT_CONN_QUAL,
+			  unsigned long, int, const void *, enum dat_qos,
+			  enum dat_connect_flags);
+	int (*ep_dup_connect)(struct dat_ep *, struct dat_ep *, unsigned long,
+			      int, const void *, enum dat_qos);
+	int (*ep_disconnect)(struct dat_ep *, enum dat_close_flags);
+	int (*ep_post_send)(struct dat_ep *, int, struct dat_lmr_triplet *,
+			    DAT_DTO_COOKIE, enum dat_completion_flags);
+	int (*ep_post_recv)(struct dat_ep *, int, struct dat_lmr_triplet *,
+			    DAT_DTO_COOKIE, enum dat_completion_flags);
+	int (*ep_post_rdma_read)(struct dat_ep *, int, struct dat_lmr_triplet *,
+				 DAT_DTO_COOKIE, const struct dat_rmr_triplet *,
+				 enum dat_completion_flags);
+	int (*ep_post_rdma_write)(struct dat_ep *, int,
+				  struct dat_lmr_triplet *, DAT_DTO_COOKIE,
+				  const struct dat_rmr_triplet *,
+				  enum dat_completion_flags);
+	int (*ep_get_status)(struct dat_ep *, enum dat_ep_state *, boolean_t *,
+			     boolean_t *);
+	int (*ep_free)(struct dat_ep *);
+	int (*lmr_kcreate)(struct dat_ia *, enum dat_mem_type,
+			   DAT_REGION_DESCRIPTION, u64, struct dat_pz *,
+			   enum dat_mem_priv_flags, enum dat_mem_optimize_flags,
+			   struct dat_lmr **, DAT_LMR_CONTEXT *,
+			   DAT_RMR_CONTEXT *, u64 *, u64 *);
+	int (*lmr_query)(struct dat_lmr *, struct dat_lmr_param *);
+	int (*lmr_free)(struct dat_lmr *);
+	int (*rmr_create)(struct dat_pz *, struct dat_rmr **);
+	int (*rmr_query)(struct dat_rmr *, struct dat_rmr_param *);
+	int (*rmr_bind)(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 *);
+	int (*rmr_free)(struct dat_rmr *);
+	int (*psp_create)(struct dat_ia *, DAT_CONN_QUAL, struct dat_evd *,
+			  enum dat_psp_flags, struct dat_sp **);
+	int (*psp_query)(struct dat_sp *, struct dat_psp_param *);
+	int (*psp_free)(struct dat_sp *);
+	int (*rsp_create)(struct dat_ia *, DAT_CONN_QUAL, struct dat_ep *,
+			  struct dat_evd *, struct dat_sp **);
+	int (*rsp_query)(struct dat_sp *, struct dat_rsp_param *);
+	int (*rsp_free)(struct dat_sp *);
+	int (*pz_create)(struct dat_ia *, struct dat_pz **);
+	int (*pz_query)(struct dat_pz *, struct dat_pz_param *);
+	int (*pz_free)(struct dat_pz *);
 
 	/* DAT 1.1 */
-	int (*psp_create_any_func)(struct dat_ia *, DAT_CONN_QUAL *,
-				   struct dat_evd *, enum dat_psp_flags,
-				   struct dat_sp **);
-	int (*ep_reset_func)(struct dat_ep *);
+	int (*psp_create_any)(struct dat_ia *, DAT_CONN_QUAL *,
+			      struct dat_evd *, enum dat_psp_flags,
+			      struct dat_sp **);
+	int (*ep_reset)(struct dat_ep *);
 
 	/* DAT 1.2 */
-	int (*lmr_sync_rdma_read_func)(struct dat_ia *, 
-				       const struct dat_lmr_triplet *, u64);
-	int (*lmr_sync_rdma_write_func)(struct dat_ia *,
-					const struct dat_lmr_triplet *, u64);
-	int (*ep_create_with_srq_func)(struct dat_ia *, struct dat_pz *,
-				       struct dat_evd *, struct dat_evd *,
-				       struct dat_evd *, struct dat_srq *,
-				       const struct dat_ep_attr *,
-				       struct dat_ep **);
-	int (*ep_recv_query_func)(struct dat_ep *, int *, int *);
-	int (*ep_set_watermark_func)(struct dat_ep *, int, int);
-	int (*srq_create_func)(struct dat_ia *, struct dat_pz *,
-			       struct dat_srq_attr *, struct dat_srq **);
-	int (*srq_free_func)(struct dat_srq *);
-	int (*srq_post_recv_func)(struct dat_srq *, int, 
-				  struct dat_lmr_triplet *, DAT_DTO_COOKIE);
-	int (*srq_query_func)(struct dat_srq *, struct dat_srq_param *);
-	int (*srq_resize_func)(struct dat_srq *, int);
-	int (*srq_set_lw_func)(struct dat_srq *, int);
+	int (*lmr_sync_rdma_read)(struct dat_ia *,
+				  const struct dat_lmr_triplet *, u64);
+	int (*lmr_sync_rdma_write)(struct dat_ia *,
+				   const struct dat_lmr_triplet *, u64);
+	int (*ep_create_with_srq)(struct dat_ia *, struct dat_pz *,
+				  struct dat_evd *, struct dat_evd *,
+				  struct dat_evd *, struct dat_srq *,
+				  const struct dat_ep_attr *, struct dat_ep **);
+	int (*ep_recv_query)(struct dat_ep *, int *, int *);
+	int (*ep_set_watermark)(struct dat_ep *, int, int);
+	int (*srq_create)(struct dat_ia *, struct dat_pz *,
+			  struct dat_srq_attr *, struct dat_srq **);
+	int (*srq_free)(struct dat_srq *);
+	int (*srq_post_recv)(struct dat_srq *, int, struct dat_lmr_triplet *,
+			     DAT_DTO_COOKIE);
+	int (*srq_query)(struct dat_srq *, struct dat_srq_param *);
+	int (*srq_resize)(struct dat_srq *, int);
+	int (*srq_set_lw)(struct dat_srq *, int);
 };
 
 struct dat_common {
@@ -913,399 +902,12 @@ extern int dat_registry_remove_provider(
  * DAT registry functions for consumers
  */
 extern int dat_ia_open(const char *name, int async_event_qlen,
-			struct dat_evd **async_event_handle,
-			struct dat_ia **ia);
+		       struct dat_evd **async_event_handle,
+		       struct dat_ia **ia);
 
 extern int dat_ia_close(struct dat_ia *, enum dat_close_flags);
 
 extern int dat_registry_list_providers(int max_to_return, int *entries_returned,
 				 struct dat_provider_info *dat_provider_list[]);
 
-/*
- * inline functions for consumers
- */
-#define DAT_CALL_PROVIDER_FUNC(func, handle, ...) \
-        handle->common.provider->func(handle, ##__VA_ARGS__)
-
-static inline int dat_ia_memtype_hint(struct dat_ia *ia,
-				      enum dat_mem_type mem_type,
-				      u64 length,
-				      enum dat_mem_optimize_flags mem_optimize,
-				      u64 *preferred_length,
-				      u64 *preferred_alignment)
-{
-        return DAT_CALL_PROVIDER_FUNC(ia_memtype_hint_func, ia, mem_type,
-				      length, mem_optimize, preferred_length,
-				      preferred_alignment);
-}
-
-static inline int dat_ia_query(struct dat_ia *ia, struct dat_evd **async_evd,
-			       struct dat_ia_attr *ia_attr,
-			       struct dat_provider_attr *provider_attr)
-{
-        return DAT_CALL_PROVIDER_FUNC(
-                ia_query_func, ia, async_evd, ia_attr, provider_attr);
-}
-
-static inline int dat_cr_accept(struct dat_cr *cr, struct dat_ep *ep,
-				int private_data_size, const void *private_data)
-{
-        return DAT_CALL_PROVIDER_FUNC(
-                cr_accept_func, cr, ep, private_data_size, private_data);
-}
-
-static inline int dat_cr_handoff(struct dat_cr *cr, DAT_CONN_QUAL handoff)
-{
-	return DAT_CALL_PROVIDER_FUNC(cr_handoff_func, cr, handoff);
-}
-
-static inline int dat_cr_query(struct dat_cr *cr, struct dat_cr_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(cr_query_func, cr, param);
-}
-
-static inline int dat_cr_reject(struct dat_cr *cr) 
-{
-        return DAT_CALL_PROVIDER_FUNC(cr_reject_func, cr);
-}
-
-static inline int dat_evd_dequeue(struct dat_evd *evd, struct dat_event *event)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_dequeue_func, evd, event);
-}
-
-static inline int dat_evd_free(struct dat_evd *evd)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_free_func, evd);
-}
-
-static inline int dat_evd_kcreate(struct dat_ia *ia, int qlen,
-				  enum dat_upcall_policy policy,
-				  const struct dat_upcall_object *upcall,
-				  enum dat_evd_flags flags,
-				  struct dat_evd ** evd)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_kcreate_func, ia, qlen, policy,
-				      upcall, flags, evd);
-}
-
-static inline int dat_evd_modify_upcall(struct dat_evd *evd,
-					enum dat_upcall_policy policy,
-					const struct dat_upcall_object *upcall)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_modify_upcall_func, evd, policy,
-				      upcall);
-}
-
-static inline int dat_evd_post_se(struct dat_evd *evd,
-				  const struct dat_event *event)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_post_se_func, evd, event);
-}
-
-static inline int dat_evd_query(struct dat_evd *evd, struct dat_evd_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_query_func, evd, param);
-}
-
-static inline int dat_evd_resize(struct dat_evd *evd, int qlen)
-{
-        return DAT_CALL_PROVIDER_FUNC(evd_resize_func, evd, qlen);
-}
-
-static inline int dat_ep_connect(struct dat_ep *ep, struct sockaddr *ia_addr,
-				 DAT_CONN_QUAL conn_qual, unsigned long timeout,
-				 int private_data_size,
-				 const void *private_data, enum dat_qos qos,
-				 enum dat_connect_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_connect_func, ep, ia_addr, conn_qual,
-				      timeout, private_data_size, private_data,
-				      qos, flags);
-}
-
-static inline int dat_ep_create(struct dat_ia *ia, struct dat_pz *pz,
-				struct dat_evd *in_evd, struct dat_evd *out_evd,
-				struct dat_evd *connect_evd,
-				const struct dat_ep_attr *attr,
-				struct dat_ep **ep)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_create_func, ia, pz, in_evd, out_evd,
-				      connect_evd, attr, ep);
-}
-
-
-static inline int dat_ep_create_with_srq(struct dat_ia *ia, struct dat_pz *pz,
-					 struct dat_evd *in_evd,
-					 struct dat_evd *out_evd,
-					 struct dat_evd *connect_evd,
-					 struct dat_srq *srq,
-					 const struct dat_ep_attr *attr,
-					 struct dat_ep **ep)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_create_with_srq_func, ia, pz, in_evd, 
-                                      out_evd, connect_evd, srq, attr, ep);
-}
-
-static inline int dat_ep_disconnect(struct dat_ep *ep,
-				    enum dat_close_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_disconnect_func, ep, flags);
-}
-
-static inline int dat_ep_dup_connect(struct dat_ep *ep, struct dat_ep *dup_ep,
-				     unsigned long timeout,
-				     int private_data_size,
-				     const void *private_data, enum dat_qos qos)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_dup_connect_func, ep, dup_ep, timeout, 
-                                      private_data_size, private_data, qos);
-}
-
-static inline int dat_ep_free(struct dat_ep *ep)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_free_func, ep);
-}
-
-static inline int dat_ep_get_status(struct dat_ep *ep, enum dat_ep_state *state,
-				    boolean_t *recv_idle, boolean_t *req_idle)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_get_status_func, ep, state, recv_idle,
-				      req_idle);
-}
-
-static inline int dat_ep_modify(struct dat_ep *ep, enum dat_ep_param_mask mask,
-				const struct dat_ep_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_modify_func, ep, mask, param);
-}
-
-static inline int dat_ep_post_rdma_read(struct dat_ep *ep, int size,
-					struct dat_lmr_triplet *local_iov,
-					DAT_DTO_COOKIE cookie,
-					const struct dat_rmr_triplet *remote_iov,
-					enum dat_completion_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_post_rdma_read_func, ep, size, 
-                                      local_iov, cookie, remote_iov, flags);
-}
-
-static inline int dat_ep_post_rdma_write(struct dat_ep *ep, int size,
-					 struct dat_lmr_triplet *local_iov,
-					 DAT_DTO_COOKIE cookie,
-					 const struct dat_rmr_triplet *remote_iov,
-					 enum dat_completion_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_post_rdma_write_func, ep, size, 
-                                      local_iov, cookie, remote_iov, flags);
-}
-
-static inline int dat_ep_post_recv(struct dat_ep *ep, int size,
-				   struct dat_lmr_triplet *local_iov,
-				   DAT_DTO_COOKIE cookie,
-				   enum dat_completion_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_post_recv_func, ep, size, local_iov,
-				      cookie, flags);
-}
-
-static inline int dat_ep_post_send(struct dat_ep *ep, 
-                                          int size, 
-                                          struct dat_lmr_triplet *local_iov,
-                                          DAT_DTO_COOKIE cookie, 
-                                          enum dat_completion_flags flags)
-{
-        return DAT_CALL_PROVIDER_FUNC(
-                ep_post_send_func, ep, size, local_iov, cookie, flags);
-}
-
-static inline int dat_ep_query(struct dat_ep *ep, struct dat_ep_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_query_func, ep, param);
-}
-
-static inline int dat_ep_recv_query(struct dat_ep *ep, int *bufs_alloc,
-				    int *bufs_avail)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_recv_query_func, ep, bufs_alloc,
-				      bufs_avail);
-}
-
-static inline int dat_ep_reset(struct dat_ep *ep)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_reset_func, ep);
-}
-
-static inline int dat_ep_set_watermark(struct dat_ep *ep,
-				       int soft_high_watermark,
-				       int hard_high_watermark)
-{
-        return DAT_CALL_PROVIDER_FUNC(ep_set_watermark_func, ep, 
-                                      soft_high_watermark, hard_high_watermark);
-}
-
-static inline int dat_lmr_query(struct dat_lmr *lmr, struct dat_lmr_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(lmr_query_func, lmr, param);
-}
-
-static inline int dat_lmr_free(struct dat_lmr *lmr) 
-{
-        return DAT_CALL_PROVIDER_FUNC(lmr_free_func, lmr);
-}
-
-static inline int dat_lmr_sync_rdma_read(struct dat_ia *ia,
-					 const struct dat_lmr_triplet *iovs,
-					 u64 num_iovs)
-{
-        return DAT_CALL_PROVIDER_FUNC(lmr_sync_rdma_read_func, ia, iovs,
-				      num_iovs);
-}
-
-static inline int dat_lmr_sync_rdma_write(struct dat_ia *ia,
-					  const struct dat_lmr_triplet *iovs,
-					  u64 num_iovs)
-{
-        return DAT_CALL_PROVIDER_FUNC(lmr_sync_rdma_write_func, ia, iovs,
-				      num_iovs);
-}
-
-static inline int dat_rmr_create(struct dat_pz *pz, struct dat_rmr **rmr)
-{
-        return DAT_CALL_PROVIDER_FUNC(rmr_create_func, pz, rmr);
-}
-
-static inline int dat_rmr_query(struct dat_rmr *rmr, struct dat_rmr_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(rmr_query_func, rmr, param);
-}
-
-static inline int 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, lmr, iov, mem_flags, 
-                                      ep, cookie, comp_flags, context);
-}
-
-static inline int dat_rmr_free(struct dat_rmr *rmr)
-{
-        return DAT_CALL_PROVIDER_FUNC(rmr_free_func, rmr);
-}
-
-static inline int dat_psp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
-				 struct dat_evd *evd, enum dat_psp_flags flags,
-				 struct dat_sp **psp)
-{
-        return DAT_CALL_PROVIDER_FUNC(psp_create_func, ia, conn_qual, evd,
-				      flags, psp);
-}
-
-static inline int dat_psp_create_any(struct dat_ia *ia, DAT_CONN_QUAL *conn_qual,
-				     struct dat_evd *evd,
-				     enum dat_psp_flags flags,
-				     struct dat_sp **psp)
-{
-        return DAT_CALL_PROVIDER_FUNC(psp_create_any_func, ia, conn_qual, evd,
-				      flags, psp);
-}
-
-static inline int dat_psp_query(struct dat_sp *psp, struct dat_psp_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(psp_query_func, psp, param);
-}
-
-static inline int dat_psp_free(struct dat_sp *psp)
-{
-        return DAT_CALL_PROVIDER_FUNC(psp_free_func, psp);
-}
-
-static inline int dat_rsp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
-				 struct dat_ep *ep, struct dat_evd *evd,
-				 struct dat_sp **rsp)
-{
-        return DAT_CALL_PROVIDER_FUNC(rsp_create_func, ia, conn_qual, ep, evd,
-				      rsp);
-}
-
-static inline int dat_rsp_query(struct dat_sp *rsp, struct dat_rsp_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(rsp_query_func, rsp, param);
-}
-
-static inline int dat_rsp_free(struct dat_sp *rsp)
-{
-        return DAT_CALL_PROVIDER_FUNC(rsp_free_func, rsp);
-}
-
-static inline int dat_pz_create(struct dat_ia *ia, struct dat_pz **pz)
-{
-        return DAT_CALL_PROVIDER_FUNC(pz_create_func, ia, pz);
-}
-
-static inline int dat_pz_query(struct dat_pz *pz, struct dat_pz_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(pz_query_func, pz, param);
-}
-
-static inline int dat_pz_free(struct dat_pz *pz)
-{
-        return DAT_CALL_PROVIDER_FUNC(pz_free_func, pz);
-}
-
-static inline int dat_srq_create(struct dat_ia *ia, struct dat_pz *pz,
-				 struct dat_srq_attr *attr,
-				 struct dat_srq **srq)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_create_func, ia, pz, attr, srq);
-}
-
-static inline int dat_srq_free(struct dat_srq *srq)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_free_func, srq);
-}
-
-static inline int dat_srq_post_recv(struct dat_srq *srq, int num_iovs,
-				    struct dat_lmr_triplet *iovs,
-				    DAT_DTO_COOKIE cookie)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_post_recv_func, srq, num_iovs, iovs,
-				      cookie);
-}
-
-static inline int dat_srq_query(struct dat_srq *srq, struct dat_srq_param *param)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_query_func, srq, param);
-}
-
-static inline int dat_srq_resize(struct dat_srq *srq, int max_recv_dtos)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_resize_func, srq, max_recv_dtos);
-}
-
-static inline int dat_srq_set_lw(struct dat_srq *srq, int low_watermark)
-{
-        return DAT_CALL_PROVIDER_FUNC(srq_set_lw_func, srq, low_watermark);
-}
-
-static inline int dat_lmr_kcreate(struct dat_ia *ia, enum dat_mem_type type,
-				  DAT_REGION_DESCRIPTION region, u64 len,
-				  struct dat_pz *pz,
-				  enum dat_mem_priv_flags privileges,
-				  enum dat_mem_optimize_flags optimization,
-				  struct dat_lmr **lmr,
-				  DAT_LMR_CONTEXT *lmr_context,
-				  DAT_RMR_CONTEXT *rmr_context,
-				  u64 *registered_length,
-				  u64 *registered_address)
-{
-        return DAT_CALL_PROVIDER_FUNC(lmr_kcreate_func, ia, type, region, len,
-				      pz, privileges, optimization, lmr,
-				      lmr_context, rmr_context,
-				      registered_length, registered_address);
-}
-
 #endif /* DAT_H */
Index: linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_evd.c
===================================================================
--- linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_evd.c	(revision 2952)
+++ linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_evd.c	(working copy)
@@ -47,7 +47,7 @@ static void dapl_evd_upcall_trigger(stru
 	struct dat_event event;
 
 	/* Only process events if there is an enabled callback function. */
-	if ((evd->upcall.upcall_func == (DAT_UPCALL_FUNC) NULL) ||
+	if ((evd->upcall.upcall == NULL) ||
 	    (evd->upcall_policy == DAT_UPCALL_DISABLE)) {
 		return;
 	}
@@ -57,8 +57,7 @@ static void dapl_evd_upcall_trigger(stru
 		if (0 != status) 
 			return;
 
-		evd->upcall.upcall_func(evd->upcall.instance_data, &event,
-					FALSE);
+		evd->upcall.upcall(evd->upcall.instance_data, &event, FALSE);
 	}
 }
 
@@ -177,7 +176,7 @@ static struct dapl_evd *dapl_evd_alloc(s
 		evd->upcall = *upcall;
 	else {
 		evd->upcall.instance_data = NULL;
-		evd->upcall.upcall_func = NULL;
+		evd->upcall.upcall = NULL;
 	}
 
 bail:
Index: linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_provider.c
===================================================================
--- linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_provider.c	(revision 2952)
+++ linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/ib/dapl_provider.c	(working copy)
@@ -66,75 +66,75 @@ static struct dat_provider g_dapl_provid
 	.ia_name = NULL,
 	.extension = NULL,
 
-	.ia_open_func = &dapl_ia_open,
-	.ia_query_func = &dapl_ia_query,
-	.ia_close_func = &dapl_ia_close,
-	.ia_memtype_hint_func = &dapl_ia_memtype_hint,
-
-	.cr_query_func = &dapl_cr_query,
-	.cr_accept_func = &dapl_cr_accept,
-	.cr_reject_func = &dapl_cr_reject,
-	.cr_handoff_func = &dapl_cr_handoff,
-
-	.evd_kcreate_func = &dapl_evd_kcreate,
-	.evd_query_func = &dapl_evd_kquery,
-	.evd_modify_upcall_func = &dapl_evd_modify_upcall,
-	.evd_resize_func = &dapl_evd_resize,
-	.evd_post_se_func = &dapl_evd_post_se,
-	.evd_dequeue_func = &dapl_evd_dequeue,
-	.evd_free_func = &dapl_evd_free,
-
-	.ep_create_func = &dapl_ep_create,
-	.ep_query_func = &dapl_ep_query,
-	.ep_modify_func = &dapl_ep_modify,
-	.ep_connect_func = &dapl_ep_connect,
-	.ep_dup_connect_func = &dapl_ep_dup_connect,
-	.ep_disconnect_func = &dapl_ep_disconnect,
-	.ep_post_send_func = &dapl_ep_post_send,
-	.ep_post_recv_func = &dapl_ep_post_recv,
-	.ep_post_rdma_read_func = &dapl_ep_post_rdma_read,
-	.ep_post_rdma_write_func = &dapl_ep_post_rdma_write,
-	.ep_get_status_func = &dapl_ep_get_status,
-	.ep_free_func = &dapl_ep_free,
-
-	.lmr_kcreate_func = &dapl_lmr_kcreate,
-	.lmr_query_func = &dapl_lmr_query,
-	.lmr_free_func = &dapl_lmr_free,
-
-	.rmr_create_func = &dapl_rmr_create,
-	.rmr_query_func = &dapl_rmr_query,
-	.rmr_bind_func = &dapl_rmr_bind,
-	.rmr_free_func = &dapl_rmr_free,
-
-	.psp_create_func = &dapl_psp_create,
-	.psp_query_func = &dapl_psp_query,
-	.psp_free_func = &dapl_psp_free,
-
-	.rsp_create_func = &dapl_rsp_create,
-	.rsp_query_func = &dapl_rsp_query,
-	.rsp_free_func = &dapl_rsp_free,
-
-	.pz_create_func = &dapl_pz_create,
-	.pz_query_func = &dapl_pz_query,
-	.pz_free_func = &dapl_pz_free,
+	.ia_open = &dapl_ia_open,
+	.ia_query = &dapl_ia_query,
+	.ia_close = &dapl_ia_close,
+	.ia_memtype_hint = &dapl_ia_memtype_hint,
+
+	.cr_query = &dapl_cr_query,
+	.cr_accept = &dapl_cr_accept,
+	.cr_reject = &dapl_cr_reject,
+	.cr_handoff = &dapl_cr_handoff,
+
+	.evd_kcreate = &dapl_evd_kcreate,
+	.evd_query = &dapl_evd_kquery,
+	.evd_modify_upcall = &dapl_evd_modify_upcall,
+	.evd_resize = &dapl_evd_resize,
+	.evd_post_se = &dapl_evd_post_se,
+	.evd_dequeue = &dapl_evd_dequeue,
+	.evd_free = &dapl_evd_free,
+
+	.ep_create = &dapl_ep_create,
+	.ep_query = &dapl_ep_query,
+	.ep_modify = &dapl_ep_modify,
+	.ep_connect = &dapl_ep_connect,
+	.ep_dup_connect = &dapl_ep_dup_connect,
+	.ep_disconnect = &dapl_ep_disconnect,
+	.ep_post_send = &dapl_ep_post_send,
+	.ep_post_recv = &dapl_ep_post_recv,
+	.ep_post_rdma_read = &dapl_ep_post_rdma_read,
+	.ep_post_rdma_write = &dapl_ep_post_rdma_write,
+	.ep_get_status = &dapl_ep_get_status,
+	.ep_free = &dapl_ep_free,
+
+	.lmr_kcreate = &dapl_lmr_kcreate,
+	.lmr_query = &dapl_lmr_query,
+	.lmr_free = &dapl_lmr_free,
+
+	.rmr_create = &dapl_rmr_create,
+	.rmr_query = &dapl_rmr_query,
+	.rmr_bind = &dapl_rmr_bind,
+	.rmr_free = &dapl_rmr_free,
+
+	.psp_create = &dapl_psp_create,
+	.psp_query = &dapl_psp_query,
+	.psp_free = &dapl_psp_free,
+
+	.rsp_create = &dapl_rsp_create,
+	.rsp_query = &dapl_rsp_query,
+	.rsp_free = &dapl_rsp_free,
+
+	.pz_create = &dapl_pz_create,
+	.pz_query = &dapl_pz_query,
+	.pz_free = &dapl_pz_free,
 
 	/* dat-1.1 */
-	.psp_create_any_func = &dapl_psp_create_any,
-	.ep_reset_func = &dapl_ep_reset,
+	.psp_create_any = &dapl_psp_create_any,
+	.ep_reset = &dapl_ep_reset,
 
 	/* dat-1.2 */
-	.lmr_sync_rdma_read_func = &dapl_lmr_sync_rdma_read,
-	.lmr_sync_rdma_write_func = &dapl_lmr_sync_rdma_write,
+	.lmr_sync_rdma_read = &dapl_lmr_sync_rdma_read,
+	.lmr_sync_rdma_write = &dapl_lmr_sync_rdma_write,
 
-	.ep_create_with_srq_func = &dapl_ep_create_with_srq,
-	.ep_recv_query_func = &dapl_ep_recv_query,
-	.ep_set_watermark_func = &dapl_ep_set_watermark,
-	.srq_create_func = &dapl_srq_create,
-	.srq_free_func = &dapl_srq_free,
-	.srq_post_recv_func = &dapl_srq_post_recv,
-	.srq_query_func = &dapl_srq_query,
-	.srq_resize_func = &dapl_srq_resize,
-	.srq_set_lw_func = &dapl_srq_set_lw
+	.ep_create_with_srq = &dapl_ep_create_with_srq,
+	.ep_recv_query = &dapl_ep_recv_query,
+	.ep_set_watermark = &dapl_ep_set_watermark,
+	.srq_create = &dapl_srq_create,
+	.srq_free = &dapl_srq_free,
+	.srq_post_recv = &dapl_srq_post_recv,
+	.srq_query = &dapl_srq_query,
+	.srq_resize = &dapl_srq_resize,
+	.srq_set_lw = &dapl_srq_set_lw
 };
 
 /*********************************************************************
Index: linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/api.c
===================================================================
--- linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/api.c	(revision 2952)
+++ linux-2.6.13-rc5-openib/drivers/infiniband/ulp/kdapl/api.c	(working copy)
@@ -48,8 +48,7 @@ MODULE_PARM_DESC(dbg_mask, "Bitmask to e
 struct dat_provider_list_entry {
 	struct list_head list;
 	struct dat_provider_info info;
-	int (*ia_open_func)(const char *, int, struct dat_evd **,
-			    struct dat_ia **);
+	int (*ia_open)(const char *, int, struct dat_evd **, struct dat_ia **);
 	int ref_count;
 };
 
@@ -104,7 +103,7 @@ int dat_ia_open(const char *name, int as
 	spin_unlock_irqrestore(&dat_provider_list_lock, flags);
 
 	if (entry) 
-		return entry->ia_open_func(name, async_evd_qlen, async_evd, ia);
+		return entry->ia_open(name, async_evd_qlen, async_evd, ia);
 	else {
 		dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API | DAT_DBG_TYPE_ERROR,
                               "%s: IA [%s] not found in registry\n", __func__,
@@ -129,7 +128,7 @@ int dat_ia_close(struct dat_ia *ia, enum
 	provider = ia->common.provider;
 	name = provider->ia_name;
 
-	status = provider->ia_close_func(ia, close_flags);
+	status = provider->ia_close(ia, close_flags);
 	if (status) {
 		dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API | DAT_DBG_TYPE_ERROR,
 			      "%s: IA [%s] close failed\n", __func__, name);
@@ -166,7 +165,7 @@ int dat_registry_add_provider(const stru
 
 	entry->ref_count = 0;
 	entry->info = *info;
-	entry->ia_open_func = provider->ia_open_func;
+	entry->ia_open = provider->ia_open;
 
 	spin_lock_irqsave(&dat_provider_list_lock, flags);
 	if (dat_registry_search(info->ia_name)) {





More information about the general mailing list