public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] contain pthreads defs with ifdef  HAVE_LIBPTHREAD
@ 2009-11-04 20:58 Stan C. Smith
  2009-11-04 21:05 ` Sean Hefty
       [not found] ` <F9EFFFF3BD1D442AB6AA993FD6F0B5D8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Stan C. Smith @ 2009-11-04 20:58 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5


Contain pthread definitions with ifdef HAVE_LIBPTHREAD

Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

diff --git a/opensm/include/vendor/osm_vendor_ibumad.h b/opensm/include/vendor/osm_vendor_ibumad.h
index 0a4692d..d523412 100644
--- a/opensm/include/vendor/osm_vendor_ibumad.h
+++ b/opensm/include/vendor/osm_vendor_ibumad.h
@@ -160,8 +160,13 @@ typedef struct _osm_vendor {
 	char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
 	vendor_match_tbl_t mtbl;
 	umad_port_t umad_port;
+#ifdef HAVE_LIBPTHREAD
 	pthread_mutex_t cb_mutex;
 	pthread_mutex_t match_tbl_mutex;
+#else
+	cl_mutex_t cb_mutex;
+	cl_mutex_t match_tbl_mutex;
+#endif
 	int umad_port_id;
 	void *receiver;
 	int issmfd;



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD
  2009-11-04 20:58 [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD Stan C. Smith
@ 2009-11-04 21:05 ` Sean Hefty
  2009-11-04 21:06   ` Sean Hefty
                     ` (2 more replies)
       [not found] ` <F9EFFFF3BD1D442AB6AA993FD6F0B5D8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  1 sibling, 3 replies; 8+ messages in thread
From: Sean Hefty @ 2009-11-04 21:05 UTC (permalink / raw)
  To: Smith, Stan, 'Sasha Khapyorsky'; +Cc: linux-rdma, ofw

>Contain pthread definitions with ifdef HAVE_LIBPTHREAD
>
>Signed-off-by: stan smith <stan.smith@intel.com>
>
>diff --git a/opensm/include/vendor/osm_vendor_ibumad.h
>b/opensm/include/vendor/osm_vendor_ibumad.h
>index 0a4692d..d523412 100644
>--- a/opensm/include/vendor/osm_vendor_ibumad.h
>+++ b/opensm/include/vendor/osm_vendor_ibumad.h
>@@ -160,8 +160,13 @@ typedef struct _osm_vendor {
> 	char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
> 	vendor_match_tbl_t mtbl;
> 	umad_port_t umad_port;
>+#ifdef HAVE_LIBPTHREAD
> 	pthread_mutex_t cb_mutex;
> 	pthread_mutex_t match_tbl_mutex;
>+#else
>+	cl_mutex_t cb_mutex;
>+	cl_mutex_t match_tbl_mutex;
>+#endif

complib is available on both platforms, why not just use it?

Alternately, #define cl_mutex_t pthread_mutex_t and avoid the #ifdef's

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: RE: [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD
  2009-11-04 21:05 ` Sean Hefty
@ 2009-11-04 21:06   ` Sean Hefty
       [not found]   ` <74DB7ADB8B154DE69B8F65456193D483-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  2009-11-06 16:58   ` Sasha Khapyorsky
  2 siblings, 0 replies; 8+ messages in thread
From: Sean Hefty @ 2009-11-04 21:06 UTC (permalink / raw)
  To: Hefty, Sean, Smith, Stan, 'Sasha Khapyorsky'; +Cc: linux-rdma, ofw

>Alternately, #define cl_mutex_t pthread_mutex_t and avoid the #ifdef's

switch that define around...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] contain pthreads defs with ifdef  HAVE_LIBPTHREAD
       [not found]   ` <74DB7ADB8B154DE69B8F65456193D483-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-11-04 22:42     ` Smith, Stan
  0 siblings, 0 replies; 8+ messages in thread
From: Smith, Stan @ 2009-11-04 22:42 UTC (permalink / raw)
  To: Hefty, Sean, 'Sasha Khapyorsky'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

Hefty, Sean wrote:
>> Contain pthread definitions with ifdef HAVE_LIBPTHREAD
>>
>> Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>
>> diff --git a/opensm/include/vendor/osm_vendor_ibumad.h
>> b/opensm/include/vendor/osm_vendor_ibumad.h
>> index 0a4692d..d523412 100644
>> --- a/opensm/include/vendor/osm_vendor_ibumad.h
>> +++ b/opensm/include/vendor/osm_vendor_ibumad.h
>> @@ -160,8 +160,13 @@ typedef struct _osm_vendor {
>>      char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
>>      vendor_match_tbl_t mtbl; umad_port_t umad_port;
>> +#ifdef HAVE_LIBPTHREAD
>>      pthread_mutex_t cb_mutex;
>>      pthread_mutex_t match_tbl_mutex;
>> +#else
>> +    cl_mutex_t cb_mutex;
>> +    cl_mutex_t match_tbl_mutex;
>> +#endif
>
> complib is available on both platforms, why not just use it?
>
> Alternately, #define cl_mutex_t pthread_mutex_t and avoid the #ifdef's

Pthreads have been workin just fine, no need fix something that is not broken.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] contain pthreads defs with ifdef  HAVE_LIBPTHREAD
       [not found] ` <F9EFFFF3BD1D442AB6AA993FD6F0B5D8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-11-05 17:07   ` Smith, Stan
       [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8E0D221-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Smith, Stan @ 2009-11-05 17:07 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

Stan C. Smith wrote:
> Contain pthread definitions with ifdef HAVE_LIBPTHREAD
>
> Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> diff --git a/opensm/include/vendor/osm_vendor_ibumad.h
> b/opensm/include/vendor/osm_vendor_ibumad.h index 0a4692d..d523412
> 100644 --- a/opensm/include/vendor/osm_vendor_ibumad.h
> +++ b/opensm/include/vendor/osm_vendor_ibumad.h
> @@ -160,8 +160,13 @@ typedef struct _osm_vendor {
>       char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
>       vendor_match_tbl_t mtbl;
>       umad_port_t umad_port;
> +#ifdef HAVE_LIBPTHREAD
>       pthread_mutex_t cb_mutex;
>       pthread_mutex_t match_tbl_mutex;
> +#else
> +     cl_mutex_t cb_mutex;
> +     cl_mutex_t match_tbl_mutex;
> +#endif
>       int umad_port_id;
>       void *receiver;
>       int issmfd;

The use of ifdef HAVE_LIBPTHREAD was based on existing HAVE_LIBPTHREAD usage in opensm/include/opensm/osm_stats.h @ line 97.
If the community prefers the use of macros then these two patches can be skipped.
Please advise on path to travel.

Stan.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] contain pthreads defs with ifdef  HAVE_LIBPTHREAD
       [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8E0D221-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2009-11-06 16:56       ` Sasha Khapyorsky
  2009-11-06 17:07         ` Smith, Stan
  0 siblings, 1 reply; 8+ messages in thread
From: Sasha Khapyorsky @ 2009-11-06 16:56 UTC (permalink / raw)
  To: Smith, Stan
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On 09:07 Thu 05 Nov     , Smith, Stan wrote:
> 
> The use of ifdef HAVE_LIBPTHREAD was based on existing HAVE_LIBPTHREAD usage in opensm/include/opensm/osm_stats.h @ line 97.

Right, but it was used due to differences in the functionality between
cl_event_t and pthread stuff. I would be happy to remove those #ifdef's
upon such differences elimination.

> If the community prefers the use of macros then these two patches can be skipped.

I think that macros are nicer.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD
  2009-11-04 21:05 ` Sean Hefty
  2009-11-04 21:06   ` Sean Hefty
       [not found]   ` <74DB7ADB8B154DE69B8F65456193D483-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-11-06 16:58   ` Sasha Khapyorsky
  2 siblings, 0 replies; 8+ messages in thread
From: Sasha Khapyorsky @ 2009-11-06 16:58 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma, ofw

On 13:05 Wed 04 Nov     , Sean Hefty wrote:
> >Contain pthread definitions with ifdef HAVE_LIBPTHREAD
> >
> >Signed-off-by: stan smith <stan.smith@intel.com>
> >
> >diff --git a/opensm/include/vendor/osm_vendor_ibumad.h
> >b/opensm/include/vendor/osm_vendor_ibumad.h
> >index 0a4692d..d523412 100644
> >--- a/opensm/include/vendor/osm_vendor_ibumad.h
> >+++ b/opensm/include/vendor/osm_vendor_ibumad.h
> >@@ -160,8 +160,13 @@ typedef struct _osm_vendor {
> > 	char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
> > 	vendor_match_tbl_t mtbl;
> > 	umad_port_t umad_port;
> >+#ifdef HAVE_LIBPTHREAD
> > 	pthread_mutex_t cb_mutex;
> > 	pthread_mutex_t match_tbl_mutex;
> >+#else
> >+	cl_mutex_t cb_mutex;
> >+	cl_mutex_t match_tbl_mutex;
> >+#endif
> 
> complib is available on both platforms, why not just use it?

We don't have cl_mutex_t in linux's implementation.

I didn't know that complib on windows already implements semantics which
are similar to most useful pthread things. That is good, and seems that
an easy porting could be done by using macros like:

#define pthread_* cl_thread_*

Sasha

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD
  2009-11-06 16:56       ` Sasha Khapyorsky
@ 2009-11-06 17:07         ` Smith, Stan
  0 siblings, 0 replies; 8+ messages in thread
From: Smith, Stan @ 2009-11-06 17:07 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma@vger.kernel.org, ofw@lists.openfabrics.org

Sasha Khapyorsky wrote:
> On 09:07 Thu 05 Nov     , Smith, Stan wrote:
>>
>> The use of ifdef HAVE_LIBPTHREAD was based on existing
>> HAVE_LIBPTHREAD usage in opensm/include/opensm/osm_stats.h @ line
>> 97.
>
> Right, but it was used due to differences in the functionality between
> cl_event_t and pthread stuff. I would be happy to remove those
> #ifdef's upon such differences elimination.
>
>> If the community prefers the use of macros then these two patches
>> can be skipped.
>
> I think that macros are nicer.
>
> Sasha

OK, will proceed with macros. Skip previously submitted patch set.
I will submit patches to remove relevant HAVE_LIBPTHREAD as not all can/should be removed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-06 17:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04 20:58 [PATCH 1/2] contain pthreads defs with ifdef HAVE_LIBPTHREAD Stan C. Smith
2009-11-04 21:05 ` Sean Hefty
2009-11-04 21:06   ` Sean Hefty
     [not found]   ` <74DB7ADB8B154DE69B8F65456193D483-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-11-04 22:42     ` Smith, Stan
2009-11-06 16:58   ` Sasha Khapyorsky
     [not found] ` <F9EFFFF3BD1D442AB6AA993FD6F0B5D8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-11-05 17:07   ` Smith, Stan
     [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8E0D221-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-11-06 16:56       ` Sasha Khapyorsky
2009-11-06 17:07         ` Smith, Stan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox