<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:Z="urn:schemas-microsoft-com:" 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 12 (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>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@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","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        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","serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Arial","sans-serif";
        color:navy;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi everyone,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I finally got fed up with having to build in a mixed DDK/WDK
environment so I bit the bullet and decided to figure out the build issues.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>It turned out to be fairly straight forward: the compiler error
for the 32-bit builds has to do with callback prototypes being defined with the
__ptr64 attribute, i.e. anything in ib_al.h that has AL_API * __ptr64
ib_pfn_xxx.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Removing the __ptr64 attribute fixes this compiler error, though
it does affect the ABI.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m building with the 6001.18001 WDK now without issue
(had to fix some other minor issues - many of them known already, but no show
stoppers).  I haven’t tested the results of the build, though, but
at least all 6 flavors build (Windows Server 2003 x86/x64*fre/chk, Windows
Server 2008 x64*fre/chk).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Also, could the changes to eliminate the __ptr64 use be broken
down into small patches (e.g. fix all __ptr64 keyword usage in callback type
declarations, fix all ib_query_handle_t usage, etc)?  This would help keep
things readable/manageable.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-Fab<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
ofw-bounces@lists.openfabrics.org [mailto:ofw-bounces@lists.openfabrics.org] <b>On
Behalf Of </b>Leonid Keller<br>
<b>Sent:</b> Thursday, April 24, 2008 12:00 AM<br>
<b>To:</b> James Yang; 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<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Ye, you've come accross the known problems.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>branches\Connectx doesn't contain Xalex changes for WDK env
support.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>It is to be compiled in WDK 6000 for now.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Xalex will merge his changes into the OFA trunk in a couple of days
and then will merge branches\ConnectX into it.</span><o:p></o:p></p>

</div>

<blockquote style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<p class=MsoNormal><o:p> </o:p></p>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <b>On Behalf Of </b>James Yang<br>
<b>Sent:</b> Thursday, April 24, 2008 4:50 AM<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</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>I did a quick WDK(6001.1800) WS2003 build on </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>branches\ConnectX</span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'>
 core and hw directory.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>X86 is broken: <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>errors in directory c:\ib\branchx\core\al\user <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>c:\ib\branchx\core\al\al_reg_svc.c(164) : error C1001: An internal
error has occurred in the compiler.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>X64 is OK with core directory, but cannot complete hw directory
build: (mthca seems fine)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Compiling resources - mlx4\kernel\bus\bus.rc<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>errors in directory c:\ib\branchx\hw\mlx4\kernel\bus<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>c:\ib\branchx\hw\mlx4\kernel\core\ev_log.rc(2) : error RC2135 :
file not found:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>MSG00001.bin<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Compiling - mlx4\kernel\bus\drv.c<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Compiling - mlx4\kernel\bus\pci.c<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Compiling - mlx4\kernel\bus\pdo.c<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Compiling - mlx4\kernel\bus\wmi.c<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Linking Executable -
c:\ib\branchx\bin\kernel\objchk_wnet_amd64\amd64\mlx4_bus.s<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>ys<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>link : error LNK1181: cannot open input file
'c:\ib\branchx\hw\mlx4\kernel\bus\o<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>bjchk_wnet_amd64\amd64\bus.res'<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Thanks,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>James<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p> </o:p></span></p>

<div>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Alex Naslednikov
[mailto:alexn@mellanox.co.il] <br>
<b>Sent:</b> Monday, April 21, 2008 10:15 AM<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</span><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi all,<br>
I would like to repost my previous message, because I haven't received yet your
comments.<br>
Our regression seems to be stable, so we are going to commit the change into
WinOF trunk the nearest time.<br>
For you convenience, I also provide some typical changes as a patch (attached
to this mail). Please, read the explanation below before - it will help you a
lot.<br>
Be aware that all the modules not contained in Mellanox WinIB stack (like
udapl, vnic) should be also changed according to this methodology.<br>
<br>
It is very large change, so I'll appreciate your time and effort while
reviewing the methodology and the patch itself.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks,<br>
</span><br>
<b>Naslednikov Alexander (a.k.a XaleX)<br>
Windows Team<br>
Mellanox Technologies</b><o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>_____________________________________________
</span><o:p></o:p></p>

<p><b><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>From:
 </span></b> <span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Alex
Naslednikov  </span><o:p></o:p></p>

<p><b><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Sent:  </span></b>
<span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Thursday, April
10, 2008 4:09 PM</span><o:p></o:p></p>

<p><b><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>To:    </span></b>
<span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>'Smith, Stan';
Ishai Rabinovitz</span><o:p></o:p></p>

<p><b><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Cc:    </span></b>
<span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>ofw@lists.openfabrics.org</span><o:p></o:p></p>

<p><b><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Subject:       </span></b>
<span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>RE: [ofw] WDK
build environment migration thoughts</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi all,</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>It's a good
idea to clarify some points before announcing Mellanox patch for WDK porting
and __ptr64 problems.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hope, these
explanations will be informative enough and not so long.</span><o:p></o:p></p>

<p><b><u><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>1.
__ptr64 problem</span></u></b><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Briefly
speaking, this problem arises when copying 32bit len pointer into 64bit len
pointer. In this case,</span><u> </u><u><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>signed pointer extension</span></u> <span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>will take place.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>How it's
applicable to WinOF ?  A lot of pointer were declared to be __ptr64 (i.e.,
to be always "long", even in 32bit kernel systems), that's to
preserve on unique size of structs used in IOCTL calls.  The main problem
it will cause is between 32bit user applications and 64bit kernel application.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>When user
code do operation like </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>s_ptr =
&my_struct;</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>my_type*
__ptr64 ptr = s_ptr;</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Than kernel
will receive ptr with invalid upper bits data (4 bytes FF).</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>To avoid
signed pointer extension, PtrToPtr64() function should be used.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Also, I
found some other places where dangerous signed pointer extension took place,
even on 32bit kernel.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Yet another
problem that arises with __ptr64 attribute is internal compiler error
(C1001)  in WDK when using __ptr64 pointer to function (callback)</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>This problem
was described in ofw discussion, you can see also :</span><o:p></o:p></p>

<p><a href="http://blogs.msdn.com/texblog/archive/2005/10/31/487436.aspx"><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>http://blogs.msdn.com/texblog/archive/2005/10/31/487436.aspx</span></a><o:p></o:p></p>

<p><a href="http://lists.openfabrics.org/pipermail/ofw/2007-July/001613.html"><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>http://lists.openfabrics.org/pipermail/ofw/2007-July/001613.html</span></a><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'> (posted by Jan from
OFW)</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Our
solution:</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>1.
Initially, we decided to remove all __ptr64 attributes except those ones inside
IOCTL structures. After, put PtrToPtr64() conversion on every assignment to
long pointer.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>(like
my_type* __ptr64 ptr = PtrToPtr64(s_ptr);  )</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>During this
solution, we changed a huge amount of code, so patch became unreadable. And it
was difficult to validate that all long pointer (with __ptr64 attribute) were
used in a proper manner</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>2. So, we
decided about another solution:</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> All
__ptr64 occurrences were replaced by either:</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> i)
TO_LONG_PTR(type, field) macro, when occurred inside structure</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>ii)
VOID_PTR64 macro otherwise (defined as void macro)</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>#define
CONCAT(str1, str2) str1##str2</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>#define
TO_LONG_PTR(type,member_name) \</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>   
union { type member_name;  uint64_t CONCAT(member_name,_padding) ; }</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thus, we can
both preserve on a uniform shapes of structs in user and kernel and to avoid
unsafe pointer arithmetic !</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>The patch
now is much more readable, but it sill consist of thousands lines.</span><o:p></o:p></p>

<p><b><u><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>2.
Migration to WDK</span></u></b><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Main issue
here was to preserve on backward compatibility with DDK</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>We were able
to compile our stack with WDK, while the main problems we found were :</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>1. WDK uses
newer version of SDK (SDK Vista). So, when using 2 or more versions of SDK on
the same build machine, one has to update </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>PLATFORM_SDK_PATH
variable to point on the proper version of SDK (for example,
PLATFORM_SDK_PATH=%sysdrive%:\PROGRA~1\MI2578~1\windows\v6.1)</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>2.verify.src
script in WDK (new add-on) checks if your SOURCES file is in appropriate
format.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>For example,
you can't set implicitly path to system .dll in TARGETLIBS, but to use
USE_<MODULE_NAME> =1 macro</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Example:</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Old code : </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> ....</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>TARGETLIBS=
\</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  
$(CRT_LIB_PATH)\msvcprt.lib\</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  
$(SDK_LIB_PATH)\Ws2_32.lib\</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  
$(TARGETPATH)\*\mtcr.lib</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>New code :</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>USE_MSVCRT=1</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>USE_NTDLL=1</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>TARGETLIBS=
\</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  
$(SDK_LIB_PATH)\Ws2_32.lib\</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  
$(TARGETPATH)\*\mtcr.lib</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>3. Some
other problems, like mulitple includes error in .rc files, or problem with
substituing more than one symbol constant into string in Makefiles (some
version of WDK)</span><o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Currently,
we continue testing and will advertise these patches right after the testing
will finish</span><o:p></o:p></p>

<p><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Naslednikov
Alexander (a.k.a XaleX)</span></b><o:p></o:p></p>

<p><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Windows
Team</span></b><o:p></o:p></p>

<p><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Mellanox
Technologies</span></b> <o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-----Original
Message-----</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>From:
ofw-bounces@lists.openfabrics.org [</span><a
href="mailto:ofw-bounces@lists.openfabrics.org"><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>mailto:ofw-bounces@lists.openfabrics.org</span></a><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>] On Behalf Of Smith,
Stan</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Sent:
Tuesday, April 08, 2008 4:10 PM</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>To: Ishai
Rabinovitz</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Cc:
ofw@lists.openfabrics.org</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Subject:
[ofw] WDK build environment migration thoughts</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hello,</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  I
strongly believe it would help the WinOF community in transitioning to the WDK
build environment if the connectX branch</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>(svn:gen1\branches\ConnectX)
was used as a WDK build environment staging grounds prior to merging the WDK
modifications into the mainline trunk.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>This has
been talked about before although it still (as of last Friday) does not build
using the latest WDK version.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>One week
prior to merging the WDK fixes into the mainline trunk, if you were to push all
the WDK fixes into the ConnectX branch and then advertise on the ofw mailing
list the availability of a WDK build branch along with</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  1)
how to build in the WDK environment,</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>    
which version of the WDK is required + a URL link where to get the WDK.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  2) An
explanation of why and how the __ptr64 attributes were removed along with how</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>    
others should correct their codes containing __ptr64 attributes.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>  3)
updates to the WinOF wiki page describing how to build in the WDK env.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Let this
branch exist for one week, receiving feedback from the list and then merge into
the mainline trunk.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Using this
approach is certainly community friendly and may prevent developer surprises.</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>ConnectX
branch availability dates plus when the actual WDK fixes would be merged into
the mainline trunk would be published beforehand.</span><o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks for
your consideration,</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Stan.</span><o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>_______________________________________________</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>ofw mailing
list</span><o:p></o:p></p>

<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>ofw@lists.openfabrics.org</span><o:p></o:p></p>

<p><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw"><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw</span></a><o:p></o:p></p>

</blockquote>

</div>

</body>

</html>