public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* creating common ib_types.h for linux and windows
@ 2011-09-19 21:20 Hefty, Sean
       [not found] ` <1828884A29C6694DAF28B7E6B8A8237316E65191-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Hefty, Sean @ 2011-09-19 21:20 UTC (permalink / raw)
  To: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

It would be easier to maintain opensm on windows if it truly shared the same code base.  For now, I'd just like to start with a common ib_types.h file.  (There are currently hundreds, if not thousands, of lines that differ.)  ib_types.h uses #if defined(__WIN__) to separate linux from windows code.  This isn't actually used, since separate files are maintained anyway.

My question is whether we should continue to use #if defined(__WIN__) or add a new ib_types_osd.h file.  Any preferences from the opensm maintainer side?

- Sean
--
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] 7+ messages in thread

* Re: creating common ib_types.h for linux and windows
       [not found] ` <1828884A29C6694DAF28B7E6B8A8237316E65191-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-09-20  6:06   ` Bart Van Assche
       [not found]     ` <CAO+b5-p0O5N6ZZacYGNjz4+H=W3hX6O7kw5pO=XqXSdh3FEdhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2011-09-20  6:06 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	Alex Netes (alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On Mon, Sep 19, 2011 at 11:20 PM, Hefty, Sean <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> It would be easier to maintain opensm on windows if it truly shared the same code base.  For now, I'd just like to start with a common ib_types.h file.  (There are currently hundreds, if not thousands, of lines that differ.)  ib_types.h uses #if defined(__WIN__) to separate linux from windows code.  This isn't actually used, since separate files are maintained anyway.
>
> My question is whether we should continue to use #if defined(__WIN__) or add a new ib_types_osd.h file.  Any preferences from the opensm maintainer side?

Why to test for __WIN__ instead of _WIN32 (defined both when building
32-bit and 64-bit code -- see also
http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx) ?

When creating a common header file, this might be a good start:
https://msinttypes.googlecode.com/svn/trunk/stdint.h

Bart.
--
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] 7+ messages in thread

* RE: creating common ib_types.h for linux and windows
       [not found]     ` <CAO+b5-p0O5N6ZZacYGNjz4+H=W3hX6O7kw5pO=XqXSdh3FEdhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-09-20 14:23       ` Hefty, Sean
       [not found]         ` <1828884A29C6694DAF28B7E6B8A8237316E6526F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Hefty, Sean @ 2011-09-20 14:23 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	Alex Netes (alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

> Why to test for __WIN__ instead of _WIN32 (defined both when building
> 32-bit and 64-bit code -- see also
> http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx) ?

I have no idea.  This is just what's currently in the code.  I can change this portion of the code if we want to use #ifdef's.

> When creating a common header file, this might be a good start:
> https://msinttypes.googlecode.com/svn/trunk/stdint.h

There are already shared types defined between linux and windows that opensm uses.  For the most part, there's no technical reason why windows can't use 99% of the linux ib_types.h as is.  My goal is to be able to take the file and drop it into the windows build tree without needing changes.

Btw, as background I tried to pull in the latest ibmad and ibdiags into windows.  The build broke because of new defines that had been added to ib_types.h.  Eventually we should be able to drop opensm directly into the windows build as well.

- Sean
--
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] 7+ messages in thread

* Re: creating common ib_types.h for linux and windows
       [not found]         ` <1828884A29C6694DAF28B7E6B8A8237316E6526F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-09-21 13:29           ` Alex Netes
       [not found]             ` <20110921132945.GA3767-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Netes @ 2011-09-21 13:29 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: Bart Van Assche,
	linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On 14:23 Tue 20 Sep     , Hefty, Sean wrote:
> > Why to test for __WIN__ instead of _WIN32 (defined both when building
> > 32-bit and 64-bit code -- see also
> > http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx) ?
> 
> I have no idea.  This is just what's currently in the code.  I can change this portion of the code if we want to use #ifdef's.
> 

Digging into the history, I found this patch that added __WIN__ defined for
Windows: http://www.spinics.net/lists/linux-rdma/msg00451.html

> > When creating a common header file, this might be a good start:
> > https://msinttypes.googlecode.com/svn/trunk/stdint.h
> 
> There are already shared types defined between linux and windows that opensm uses.  For the most part, there's no technical reason why windows can't use 99% of the linux ib_types.h as is.  My goal is to be able to take the file and drop it into the windows build tree without needing changes.

What is your end goal? To have one code base for OpenSM that would be able to
be compiled on both Linux and Windows based on __WIN__ definition?

> 
> Btw, as background I tried to pull in the latest ibmad and ibdiags into windows.  The build broke because of new defines that had been added to ib_types.h.  Eventually we should be able to drop opensm directly into the windows build as well.
> 
> - Sean
> --
> 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

-- 

-- Alex
--
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] 7+ messages in thread

* RE: creating common ib_types.h for linux and windows
       [not found]             ` <20110921132945.GA3767-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
@ 2011-09-21 14:15               ` Smith, Stan
  2011-09-21 15:49               ` Hefty, Sean
  1 sibling, 0 replies; 7+ messages in thread
From: Smith, Stan @ 2011-09-21 14:15 UTC (permalink / raw)
  To: Alex Netes, Hefty, Sean
  Cc: Bart Van Assche,
	linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

>-----Original Message-----
>From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Alex Netes
>Sent: Wednesday, September 21, 2011 6:30 AM
>To: Hefty, Sean
>Cc: Bart Van Assche; linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org); Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org); ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org
>Subject: Re: creating common ib_types.h for linux and windows
>
>On 14:23 Tue 20 Sep     , Hefty, Sean wrote:
>> > Why to test for __WIN__ instead of _WIN32 (defined both when building
>> > 32-bit and 64-bit code -- see also
>> > http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx) ?
>>
>> I have no idea.  This is just what's currently in the code.  I can change this portion of the code if we want to use #ifdef's.
>>
>
>Digging into the history, I found this patch that added __WIN__ defined for
>Windows: http://www.spinics.net/lists/linux-rdma/msg00451.html

Hello Alex,
  The intent was to unify the multiple ifdef tags for Windows; perhaps _WIN32 might have been a better choice.
__WIN__ clearly indicates 'all' windows variants, while _WIN32 at 1st glance tends to imply 32bit Windows for those who are not aware of the MS confusing usage of _WIN32 also defined  for _WIN64 systems.
If you feel a change is needed then OK.

Stan.

>
>> > When creating a common header file, this might be a good start:
>> > https://msinttypes.googlecode.com/svn/trunk/stdint.h
>>
>> There are already shared types defined between linux and windows that opensm uses.  For the most part, there's no technical reason why
>windows can't use 99% of the linux ib_types.h as is.  My goal is to be able to take the file and drop it into the windows build tree without
>needing changes.
>
>What is your end goal? To have one code base for OpenSM that would be able to
>be compiled on both Linux and Windows based on __WIN__ definition?
>
>>
>> Btw, as background I tried to pull in the latest ibmad and ibdiags into windows.  The build broke because of new defines that had been
>added to ib_types.h.  Eventually we should be able to drop opensm directly into the windows build as well.
>>
>> - Sean
>> --
>> 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
>
>--
>
>-- Alex
>--
>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
--
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] 7+ messages in thread

* RE: creating common ib_types.h for linux and windows
       [not found]             ` <20110921132945.GA3767-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
  2011-09-21 14:15               ` Smith, Stan
@ 2011-09-21 15:49               ` Hefty, Sean
       [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237316E66732-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Hefty, Sean @ 2011-09-21 15:49 UTC (permalink / raw)
  To: Alex Netes
  Cc: Bart Van Assche,
	linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

> What is your end goal? To have one code base for OpenSM that would be able to
> be compiled on both Linux and Windows based on __WIN__ definition?

My end goal is to decrease the maintenance cost porting opensm to Windows.  Ideally, I'd like to have a common code base for opensm, similar to what we have for ibmad and ib-diags.  Whether we achieve that using #ifdef's, OS specific header files, some other means (such as a windows specific patches to complete the conversion), or a combination of these, I don't really care.

- Sean
--
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] 7+ messages in thread

* Re: creating common ib_types.h for linux and windows
       [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237316E66732-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-09-25 10:39                   ` Alex Netes
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Netes @ 2011-09-25 10:39 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: Bart Van Assche,
	linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Hal Rosenstock (hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org),
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On 15:49 Wed 21 Sep     , Hefty, Sean wrote:
> > What is your end goal? To have one code base for OpenSM that would be able to
> > be compiled on both Linux and Windows based on __WIN__ definition?
> 
> My end goal is to decrease the maintenance cost porting opensm to Windows.  Ideally, I'd like to have a common code base for opensm, similar to what we have for ibmad and ib-diags.  Whether we achieve that using #ifdef's, OS specific header files, some other means (such as a windows specific patches to complete the conversion), or a combination of these, I don't really care.

I guess in case of ib_types.h that includes lots of #ifdef's, it would be
better to use a separate file. But for other files such as osm_base.h, it
would be much overhead to separate Windows related stuff to a different file.

-- Alex
--
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] 7+ messages in thread

end of thread, other threads:[~2011-09-25 10:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 21:20 creating common ib_types.h for linux and windows Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A8237316E65191-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-09-20  6:06   ` Bart Van Assche
     [not found]     ` <CAO+b5-p0O5N6ZZacYGNjz4+H=W3hX6O7kw5pO=XqXSdh3FEdhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-20 14:23       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A8237316E6526F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-09-21 13:29           ` Alex Netes
     [not found]             ` <20110921132945.GA3767-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
2011-09-21 14:15               ` Smith, Stan
2011-09-21 15:49               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237316E66732-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-09-25 10:39                   ` Alex Netes

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