<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:v =
"urn:schemas-microsoft-com:vml"><HEAD><!--[if !mso]><TITLE>RE: [ofw] WDK build environment migration thoughts</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if !mso]>
<STYLE>st1\:* {
BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: blue; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle18 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle19 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle20 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
</STYLE>
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY lang=EN-US vLink=blue link=blue>
<DIV><FONT face=Arial color=#000080 size=2><SPAN class=155301820-21042008>Please
note that the reason Alex did things in the order mentioned is because of the
size of his patch. He had to go all over the code, and look for __ptr64 and
there have been more than 600 directs instances of it and many others were
hidden in typedefs.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><SPAN class=155301820-21042008>This
forced Alex to use a very formal way of fixing things.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#000080>FUNC_PTR64 and
VOID_PTR64<SPAN class=155301820-21042008> are defined as nothing. They are only
comments that help us check that Alex did a good
job.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080 size=2><SPAN
class=155301820-21042008>One day or the other they should be removed. You can
think of them as comments.</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN
class=155301820-21042008>> </SPAN>What does sizeof(qp) return?</SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p><SPAN
class=155301820-21042008>It will return 4 on 32 bits systems and 8 on 64
systems.</SPAN></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p><SPAN
class=155301820-21042008><FONT
color=#000080></FONT></SPAN></o:p></SPAN> </P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p><SPAN
class=155301820-21042008>I believe that compatibility is broken in the user-user
and kernel-kernel level on 32 bits systems. This is because at the past
functions that have received pointers received them as __ptr64 which means that
the size of the pointer was 64 bits. Today they will be 32 bits only. The
portability in the move between user to kernel still exists as the structs in
the ioctls are still 64 bits.</SPAN></o:p></SPAN></P>
<DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000080 size=2><SPAN class=155301820-21042008>Please
also note that if we want to support little endian machines as well as big
endian machines than only one Macro has to change. This should put the padding
before the value and not after it.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2></FONT> </DIV>
<DIV><SPAN class=155301820-21042008><FONT face=Arial color=#000080
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=155301820-21042008><FONT face=Arial color=#000080
size=2>Tzachi</FONT></SPAN></DIV>
<DIV><BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Sean
Hefty<BR><B>Sent:</B> Monday, April 21, 2008 10:48 PM<BR><B>To:</B> Alex
Naslednikov; Smith, Stan; Ishai Rabinovitz<BR><B>Cc:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> RE: [ofw] WDK build environment
migration thoughts<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">What exactly are
FUNC_PTR64 and VOID_PTR64? Given:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">typedef struct
_ib_qp* VOID_PTR64 ib_qp_handle_t;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">ib_qp_handle_t
qp;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">What does sizeof(qp)
return?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">As for the steps, I’m
missing something. Step 1 looks like it breaks compatibility. Step
3 looks like it undoes what step 1 did, so I’m not sure why step 1 was
done. Were these just intermediate steps that you used to create the
actual patch?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
<st1:PersonName w:st="on">Alex Naslednikov</st1:PersonName>
[mailto:alexn@mellanox.co.il] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, April 21, 2008 12:31
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <st1:PersonName
w:st="on">Hefty, Sean</st1:PersonName>; <st1:PersonName w:st="on">Smith,
Stan</st1:PersonName>; Ishai Rabinovitz<BR><B><SPAN
style="FONT-WEIGHT: bold">Cc:</SPAN></B> ofw@lists.openfabrics.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [ofw] WDK build environment
migration thoughts</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">Question: It’s still
not clear to me how you maintain binary compatibility with the IBAL APIs.
The IBAL calls take 64-bit pointers as input parameters. What are
the definitions for the ib_blah_handle_t
types?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">We did the following
(major steps):<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">1. Replace all
ib_<type>_handle_t types by its direct invocation, say struct
_ib_<type>_ *<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">2. Next, replace all
__ptr64 either by TO_LONG_PTR macro (if used inside struct definition), or one
of void macros (FUNC_PTR64, VOID_PTR64 etc)
otherwise<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">Typedefs now looks
like : typedef struct _ib_qp* VOID_PTR64
ib_qp_handle_t;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">3. Next, replace
back all appearances of (struct ib_<type>_*) by ib_<type>_handle_t
inside function declarations (because of "const" modifier
problems)<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">4. Several other
minor steps<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> </SPAN></FONT><FONT face=Arial color=green
size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">XaleX<o:p></o:p></SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Sean
Hefty [mailto:sean.hefty@intel.com] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, April 21, 2008 9:01
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <st1:PersonName
w:st="on">Alex Naslednikov</st1:PersonName>; <st1:PersonName w:st="on">Smith,
Stan</st1:PersonName>; Ishai Rabinovitz<BR><B><SPAN
style="FONT-WEIGHT: bold">Cc:</SPAN></B> ofw@lists.openfabrics.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [ofw] WDK build environment
migration thoughts</SPAN></FONT><o:p></o:p></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">Q2.</SPAN></FONT><FONT
face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Does TO_LONG_PTR work
for both big endian and little endian
systems?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">TO_LONG_PTR works
only with little endian, because we do not support PPC platform
</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Currently, there's no
need to extend it to support big endian</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=#339966 size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: #339966"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">OFA does support PPC
platforms, plus Itanium can be configured for either little or big endian
format. I’m fine deferring adding this support, but the code should not
assume that it will always be little endian.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Q3. How is the padded
space initialized?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Inside sdp, all
padded space was initialized by class constructor (except one specific
case)</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">In all other code,
that not C++, padded space was initialized by cl_memclr before setting
the field and before calling to ioctl
procedure</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Please, see my next
mail with examples from the code</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">It’s kind of ugly to
require setting padded fields to specific values. This only needs to be
done when crossing from a 32-bit to 64-bit boundary, so we can restrict this
to the kernel proxy. (Btw, you can replace the unnamed union and add
padding to structures only if compiling in 32-bit
mode.)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">It’s still not clear
to me how you maintain binary compatibility with the IBAL APIs. The IBAL
calls take 64-bit pointers as input parameters. What are the definitions
for the ib_blah_handle_t types?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial">-
Sean<o:p></o:p></SPAN></FONT></P></DIV></DIV></DIV></DIV></BLOCKQUOTE></BODY></HTML>