<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>RE: [ofw] WDK build environment migration thoughts</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle19
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>What exactly are FUNC_PTR64 and
VOID_PTR64? Given:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>typedef struct _ib_qp* VOID_PTR64
ib_qp_handle_t;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ib_qp_handle_t qp;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>What does sizeof(qp) return?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>We did the following (major steps):<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>4. Several other minor steps<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font><font size=2 color=green face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:green'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>XaleX<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;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:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>Q2.</span></font><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=3 color="#339966" face="Times New Roman"><span
style='font-size:12.0pt;color:#339966'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Q3. How is the padded space initialized?</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Please, see my next mail with examples
from the code</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>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 size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=green face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:green'>- Sean<o:p></o:p></span></font></p>
</div>
</div>
</div>
</div>
</body>
</html>