<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1409040133;
        mso-list-type:hybrid;
        mso-list-template-ids:1973948148 -1008573216 403243011 403243013 403243009 403243011 403243013 403243009 403243011 403243013;}
@list l0:level1
        {mso-level-start-at:510;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        color:windowtext;}
@list l1
        {mso-list-id:2003313042;
        mso-list-type:hybrid;
        mso-list-template-ids:-658072050 1486665136 403243011 403243013 403243009 403243011 403243013 403243009 403243011 403243013;}
@list l1:level1
        {mso-level-start-at:510;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am attempting to use winverbs (winOF 4.2 Mellanox release for windows 2012), from a kernel mode NDIS protocol test driver.  Initialization code for connection to “device\winverbs” is listed:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       status = IoGetDeviceObjectPointer (&wvDevName, </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>FILE_READ_ACCESS</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, &pwvFileObj, &pwvDevObj);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       KeInitializeEvent (&wvEvent, </span><span style='font-size:9.5pt;font-family:Consolas;color:darkslategray;background:white;mso-highlight:white'>NotificationEvent</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>FALSE</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       pIrp = IoBuildDeviceIoControlRequest (WV_IOCTL_GUID_QUERY, pwvDevObj, </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NULL</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, 0, gl, </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>sizeof</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>(gl), <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>TRUE</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, &wvEvent, </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NULL</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>); <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       pwvIrpStack = IoGetNextIrpStackLocation(pIrp);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       pwvIrpStack->FileObject = pwvFileObj;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       status = </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>IoCallDriver</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>(pwvDevObj, pIrp);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>while</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (status == </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>STATUS_PENDING</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              waitEvent.QuadPart = -10*1000; </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>// 1 ms</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              waitStatus = KeWaitForSingleObject(&wvEvent, </span><span style='font-size:9.5pt;font-family:Consolas;color:darkslategray;background:white;mso-highlight:white'>Executive</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:darkslategray;background:white;mso-highlight:white'>KernelMode</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>FALSE</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, &waitEvent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              status = pIrp->IoStatus.Status;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (</span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NT_SUCCESS</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (waitStatus)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>                     </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DEBUGP</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (</span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DL_EXTRA_LOUD</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, (</span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"winverbsInit - 1 ms wait status=%#lx\n"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, status));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              } </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>else</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>                     </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DEBUGP</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (</span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DL_ERROR</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, (</span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"winverbsInit - 1 ms wait failed error %#lx, IRP status=%#lx\n"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, waitStatus, status));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (status != </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>STATUS_SUCCESS</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DEBUGP</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>(</span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DL_ERROR</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, (</span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"winverbsInit - WV_IOCTL_GUID_QUERY failed %#lx\n"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, status));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       }<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This code fails - <span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>STATUS_INVALID_DEVICE_REQUEST</span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A'>.  </span><o:p></o:p></p><p class=MsoNormal>(building with  <wv_ioctl.h> from win OFED 3.2 RC3 release,  since winverbs.h provided with Mellanox winOF SDK is aimed at user mode)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Question:<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span><![endif]>Is winverbs interface supported from kernel mode?  Is it only supported with winOFED distribution and not by Mellanox? (i.e. above code should work on windows 2008 r2 and also when win OFED 3.3 is available?).<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span><![endif]>What is the recommended interface to use from kernel mode drivers – winverbs, complib & ibal that statically link into the driver?  (Any other options ?).<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span><![endif]>Any sample code for using rdma from kernel mode (windows)?  (Looking into ipoib.sys code, test tools from winOFED 3.2 RC3, with goals to build for win 8)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any help and suggestions are appreciated – thanks in advance.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Deepak Rawal<o:p></o:p></p></div></body></html>