<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:odc="urn:schemas-microsoft-com:office:odc" 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:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" 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:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" 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:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" 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: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;}
@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: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:purple;
text-decoration:underline;}
p.emailquote, li.emailquote, div.emailquote
{mso-style-name:emailquote;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:1.0pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
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 WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Alex,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> One could fix the g_NBL accounting in ipoib_driver.cpp by counting the number of NBLs being completed, subtract 1 from the total (NdisMSendNetBufferListsCompleteX does ++) and then add total to g_NBL; not pretty although correct and debug only.<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'>The completion logic is, if NDIS_STATUS_SUCCESS, then allow only one NBL to be completed; if status != NDIS_STATUS_SUCCESS, then allow 1 or more NBLs to be completed.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>A comment, per Fab’s recommendation, would be good.<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'>Stan.<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><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><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>Smith, Stan<br><b>Sent:</b> Tuesday, March 01, 2011 5:41 PM<br><b>To:</b> Alex Naslednikov; Fab Tillier; ofw@lists.openfabrics.org<br><b>Subject:</b> Re: [ofw] [IPoIB] NdisMSendNetBufferListCompleteX assert<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Alex,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> I like your patch, in that a single call to NDIS is made. I do not see the path to keeping g_NBL correct without a for loop?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Below is a slight modification</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>, such</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> that ‘Completing NBL….’ message is not output two times and the NDIS error code is output in hex to make it easier to find in ndis.h<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><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>#if DBG <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> if (NET_BUFFER_LIST_STATUS(NetBufferLists) != NDIS_STATUS_SUCCESS) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ALL,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> ("NBL completed with error %#x to NDIS\n",<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> NET_BUFFER_LIST_STATUS(NetBufferLists)));<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>} else {</b><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>ASSERT(NET_BUFFER_LIST_NEXT_NBL(NetBufferLists) == NULL);</b><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> ("Completing NBL=%x, g_NBL=%d, g_NBL_completed=%d \n",<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> NetBufferLists, g_NBL, g_NBL_complete) );<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>}</b><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>#endif<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 style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><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"'> Alex Naslednikov [mailto:xalex@mellanox.co.il] <br><b>Sent:</b> Tuesday, March 01, 2011 12:42 AM<br><b>To:</b> Smith, Stan; Fab Tillier; ofw@lists.openfabrics.org<br><b>Subject:</b> RE: [IPoIB] NdisMSendNetBufferListCompleteX assert<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.5pt;font-family:Consolas'>Hello Stan,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>You are right - we have the following code for the regular flow (prior calling to ipoib_port_send()):<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>// Important issue, break the connection between the different nbls</b><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list) = NULL;</b><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Of course, when we get into bad flow, the assertion mentioned by Fab is no longer valid.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Thus, to avoid big changes, we can simply modify the code of NdisMSendNetBufferListsCompleteX in a following manner:<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>#if DBG <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> if (NET_BUFFER_LIST_STATUS(NetBufferLists) != NDIS_STATUS_SUCCESS) {<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ALL,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> ("NBL completed with error %d to NDIS\n",<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> NET_BUFFER_LIST_STATUS(NetBufferLists)));<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>} else {</b><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>ASSERT(NET_BUFFER_LIST_NEXT_NBL(NetBufferLists) == NULL);</b><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <b>}</b><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> ("Completing NBL=%x, g_NBL=%d, g_NBL_completed=%d \n",<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> NetBufferLists, g_NBL, g_NBL_complete) );<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>#endif<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>In addition, we should take into account that g_NBL was increased by an actual numbers of NBLs inside the list. Thus, g_NBL_completed should be increased accordingly (and not only once)<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>The other possibility was proposed by Stan. In this case the change will be even smaller, but we will call to NDIS several times instead of one call only.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>I am ok with both of them<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>From: ofw-bounces@lists.openfabrics.org [<a href="mailto:ofw-bounces@lists.openfabrics.org">mailto:ofw-bounces@lists.openfabrics.org</a>] On Behalf Of Smith, Stan<br>Sent: Tuesday, March 01, 2011 3:42 AM<br>To: Fab Tillier; ofw@lists.openfabrics.org<br>Subject: Re: [ofw] [IPoIB] NdisMSendNetBufferListCompleteX assert<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>-----Original Message-----<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>From: ofw-bounces@lists.openfabrics.org [<a href="mailto:ofw-bounces@lists.openfabrics.org">mailto:ofw-bounces@lists.openfabrics.org</a>] On Behalf Of Fab<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>Tillier<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>Sent: Monday, February 28, 2011 4:46 PM<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>To: ofw@lists.openfabrics.org<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>Subject: [ofw] [IPoIB] NdisMSendNetBufferListCompleteX assert<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>The assertion at line 1122 in ipoib_port.h seems wrong since the following code dereferences the NBL.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>Is it wrong, or there to cause an assert because of a send error?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>If the latter, a comment would help make the intent clear, as the code looks wrong as is.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>-Fab<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>NdisMSendNetBufferListsCompleteX() is completing a 'single' NBL (NetworkBufferList); not a list of NBLs.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>The code is correctly used in ipoib_port.cpp @ ipoib_port_send().<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Although it's usage in ipoib_driver.cpp @ ipoib_send_net_buffer_list() after label 'compl_status:' is incorrect.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Appears the comment is wrong w.r.t. NdisMSendNetBufferListsCompleteX() and the for() loop should be extended down to encompass the NdisMSendNetBufferListsCompleteX() call with a single NBL.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>The dispatch check should be done once prior to entering the for()loop.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Tzachi, Alex - do you agree?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Stan.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>_______________________________________________<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>ofw mailing list<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>>ofw@lists.openfabrics.org<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw</a><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>_______________________________________________<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>ofw mailing list<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>ofw@lists.openfabrics.org<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw</a><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'> <o:p></o:p></span></p></div></div></div></div></body></html>