[openib-general] [PATCH] kDAPL: get rid of dat version and thread safetey flags

James Lentini jlentini at netapp.com
Tue Jun 14 12:16:23 PDT 2005


Christoph,

I'm all ready to submit this minus the Makefile change. Can you 
re-send with a "Signed-off-by" line? (no need to make any changes)

On Sat, 11 Jun 2005, Christoph Hellwig wrote:

> in the linux kernel any provider must use the version it was compiled
> against, and must always be thread safe.
>
>
> Index: test/dapltest/test/dapl_test_util.c
> ===================================================================
> --- test/dapltest/test/dapl_test_util.c	(revision 2588)
> +++ test/dapltest/test/dapl_test_util.c	(working copy)
> @@ -76,12 +76,10 @@
> 	struct sockaddr_in	*ip_addr;
>
> 	DT_Tdep_PT_Printf (phead, "*****  DAPL  Characteristics  *****\n");
> -	DT_Tdep_PT_Printf (phead, "Provider: %s  Version %d.%d  DAPL %d.%d\n",
> +	DT_Tdep_PT_Printf (phead, "Provider: %s  Version %d.%d\n",
> 			pt_ptr->provider_attr.provider_name,
> 			pt_ptr->provider_attr.provider_version_major,
> -			pt_ptr->provider_attr.provider_version_minor,
> -			pt_ptr->provider_attr.dat_version_major,
> -			pt_ptr->provider_attr.dat_version_minor );
> +			pt_ptr->provider_attr.provider_version_minor);
> 	DT_Tdep_PT_Printf (phead, "Adapter: %s by %s Version %d.%d\n",
> 			pt_ptr->ia_attr.adapter_name,
> 			pt_ptr->ia_attr.vendor_name,
> Index: dat-provider/dapl_ia.c
> ===================================================================
> --- dat-provider/dapl_ia.c	(revision 2588)
> +++ dat-provider/dapl_ia.c	(working copy)
> @@ -881,15 +881,12 @@
> 			DAT_NAME_MAX_LENGTH);
> 		provider_attr->provider_version_major = DAPL_PROVIDER_MAJOR;
> 		provider_attr->provider_version_minor = DAPL_PROVIDER_MINOR;
> -		provider_attr->dat_version_major = DAT_VERSION_MAJOR;
> -		provider_attr->dat_version_minor = DAT_VERSION_MINOR;
> 		provider_attr->lmr_mem_types_supported =
> 		    DAT_MEM_TYPE_VIRTUAL | DAT_MEM_TYPE_LMR;
> 		provider_attr->iov_ownership_on_return = DAT_IOV_CONSUMER;
> 		provider_attr->dat_qos_supported = DAT_QOS_BEST_EFFORT;
> 		provider_attr->completion_flags_supported =
> 		    DAT_COMPLETION_DEFAULT_FLAG;
> -		provider_attr->is_thread_safe = FALSE;
> 		provider_attr->max_private_data_size = IB_CM_REQ_PRIVATE_DATA_SIZE;
> 		provider_attr->supports_multipath = FALSE;
> 		provider_attr->ep_creator = DAT_PSP_CREATES_EP_NEVER;
> Index: dat-provider/dapl_provider.c
> ===================================================================
> --- dat-provider/dapl_provider.c	(revision 2588)
> +++ dat-provider/dapl_provider.c	(working copy)
> @@ -244,9 +244,6 @@
> 		  (size_t) (DAT_NAME_MAX_LENGTH - 2));
> 	provider_info->ia_name[i] = 'a' + port - 1; /* IB ports are 1 based */
> 	provider_info->ia_name[i+1] = '\0';
> -	provider_info->dat_version_major = DAT_VERSION_MAJOR;
> -	provider_info->dat_version_minor = DAT_VERSION_MINOR;
> -	provider_info->is_thread_safe = DAPL_THREADSAFE;
> }
>
> static void dapl_add_port(struct ib_device *device, u8 port)
> Index: dat/dictionary.c
> ===================================================================
> --- dat/dictionary.c	(revision 2588)
> +++ dat/dictionary.c	(working copy)
> @@ -212,10 +212,6 @@
> 	BUG_ON(NULL == new_key);
>
> 	strncpy(new_key->ia_name, old_key->ia_name, DAT_NAME_MAX_LENGTH);
> -	new_key->dat_version_major = old_key->dat_version_major;
> -	new_key->dat_version_minor = old_key->dat_version_minor;
> -	new_key->is_thread_safe = old_key->is_thread_safe;
> -
> 	return DAT_SUCCESS;
> }
>
> @@ -226,10 +222,7 @@
>         BUG_ON(NULL == b);
>
> 	if ((strlen(a->ia_name) == strlen(b->ia_name)) &&
> -	    (!strncmp(a->ia_name, b->ia_name, strlen(a->ia_name)))
> -	    && (a->dat_version_major == b->dat_version_major)
> -	    && (a->dat_version_minor == b->dat_version_minor)
> -	    && (a->is_thread_safe == b->is_thread_safe))
> +	    (!strncmp(a->ia_name, b->ia_name, strlen(a->ia_name))))
> 		return TRUE;
> 	else
> 		return FALSE;
> Index: dat/api.c
> ===================================================================
> --- dat/api.c	(revision 2588)
> +++ dat/api.c	(working copy)
> @@ -349,9 +349,8 @@
> 	}
> }
>
> -u32 dat_ia_openv(const char *name, int async_event_qlen,
> -		 struct dat_evd **async_event_handle, struct dat_ia **ia,
> -		 u32 dat_major, u32 dat_minor, boolean_t thread_safety)
> +u32 dat_ia_open(const char *name, int async_event_qlen,
> +		struct dat_evd **async_event_handle, struct dat_ia **ia)
> {
> 	DAT_IA_OPEN_FUNC ia_open_func;
> 	struct dat_provider_info info;
> @@ -360,8 +359,7 @@
>
> 	dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
>                       "%s(name:%s, async_qlen:%i, ver:%x.%x, thrd_safe:%x)\n",
> -		      __func__, name, async_event_qlen, dat_major, dat_minor,
> -                      thread_safety);
> +		      __func__, name, async_event_qlen);
>
> 	if (DAT_IS_BAD_POINTER(name))
> 		return DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1);
> @@ -374,10 +372,6 @@
> 	strncpy(info.ia_name, name, len);
> 	info.ia_name[len] = '\0';
>
> -	info.dat_version_major = dat_major;
> -	info.dat_version_minor = dat_minor;
> -	info.is_thread_safe = thread_safety;
> -
> 	status = dat_dr_provider_open(&info, &ia_open_func);
> 	if (status != DAT_SUCCESS) {
> 		dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
> @@ -390,7 +384,7 @@
>         return ia_open_func(name, async_event_qlen, async_event_handle,	ia);
> }
>
> -EXPORT_SYMBOL(dat_ia_openv);
> +EXPORT_SYMBOL(dat_ia_open);
>
> u32 dat_ia_close(struct dat_ia *ia, enum dat_close_flags flags)
> {
> @@ -423,10 +417,6 @@
> 		strncpy(info.ia_name, ia_name, len);
> 		info.ia_name[len] = '\0';
>
> -		info.dat_version_major = provider_attr.dat_version_major;
> -		info.dat_version_minor = provider_attr.dat_version_minor;
> -		info.is_thread_safe = provider_attr.is_thread_safe;
> -
> 		status = dat_dr_provider_close(&info);
> 		if (DAT_SUCCESS != status)
> 			dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
> @@ -472,10 +462,7 @@
> {
> 	dat_dbg_print(DAT_DBG_TYPE_PROVIDER_API,
>                       "%s(ia:%s, ver:%x.%x, thrd_safe:%x)\n",
> -                      __func__, provider_info->ia_name,
> -                      provider_info->dat_version_major,
> -		      provider_info->dat_version_minor,
> -                      provider_info->is_thread_safe);
> +                      __func__, provider_info->ia_name);
>
> 	if (DAT_IS_BAD_POINTER(provider))
> 		return DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1);
> Index: dat/Makefile
> ===================================================================
> --- dat/Makefile	(revision 2588)
> +++ dat/Makefile	(working copy)
> @@ -1,7 +1,6 @@
>
> EXTRA_CFLAGS += \
> -    -Idrivers/dat      	\
> -    -Werror
> +    -I$(obj)
>
> obj-$(CONFIG_DAT) += dat.o
>
> Index: dat/dat.h
> ===================================================================
> --- dat/dat.h	(revision 2588)
> +++ dat/dat.h	(working copy)
> @@ -33,10 +33,6 @@
> #include <linux/in.h>
> #include <linux/in6.h>
>
> -#define DAT_VERSION_MAJOR 1
> -#define DAT_VERSION_MINOR 2
> -#define DAT_THREADSAFE FALSE
> -
> /*
>  * All return codes are actually a 3-way tuple:
>  *
> @@ -894,9 +890,6 @@
>
> struct dat_provider_info {
> 	char ia_name[DAT_NAME_MAX_LENGTH];
> -	u32 dat_version_major;
> -	u32 dat_version_minor;
> -	boolean_t is_thread_safe;
> };
>
> struct dat_evd_param {
> @@ -1017,13 +1010,10 @@
> 	char provider_name[DAT_NAME_MAX_LENGTH];
> 	u32 provider_version_major;
> 	u32 provider_version_minor;
> -	u32 dat_version_major;
> -	u32 dat_version_minor;
> 	enum dat_mem_type lmr_mem_types_supported;
> 	enum dat_iov_ownership iov_ownership_on_return;
> 	enum dat_qos dat_qos_supported;
> 	enum dat_completion_flags completion_flags_supported;
> -	boolean_t is_thread_safe;
> 	int max_private_data_size;
> 	boolean_t supports_multipath;
> 	enum dat_ep_creator_for_psp ep_creator;
> @@ -1361,16 +1351,10 @@
> /*
>  * DAT registry functions for consumers
>  */
> -extern u32 dat_ia_openv(const char *name, int async_event_qlen,
> +extern u32 dat_ia_open(const char *name, int async_event_qlen,
> 			struct dat_evd **async_event_handle,
> -			struct dat_ia **ia, u32 dat_major, u32 dat_minor,
> -			boolean_t thread_safety);
> +			struct dat_ia **ia);
>
> -#define dat_ia_open(name, qlen, async_evd, ia) \
> -        dat_ia_openv((name), (qlen), (async_evd), (ia), \
> -                DAT_VERSION_MAJOR, DAT_VERSION_MINOR, \
> -                DAT_THREADSAFE)
> -
> extern u32 dat_ia_close(struct dat_ia *, enum dat_close_flags);
>
> extern u32 dat_strerror(u32, const char **, const char **);
> _______________________________________________
> openib-general mailing list
> openib-general at openib.org
> http://openib.org/mailman/listinfo/openib-general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
>



More information about the general mailing list