<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Consolas" size="2"><span style="font-size:10.5pt;">
<div>Hello Stan,</div>
<div>You are right - we have the following code for the regular flow (prior calling to ipoib_port_send()):</div>
<div> <b>// Important issue, break the connection between the different nbls</b></div>
<div> <b>NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list) = NULL;</b></div>
<div>Of course, when we get into bad flow, the assertion mentioned by Fab is no longer valid.</div>
<div>Thus, to avoid big changes, we can simply modify the code of NdisMSendNetBufferListsCompleteX in a following manner:</div>
<div> </div>
<div>#if DBG </div>
<div> </div>
<div> if (NET_BUFFER_LIST_STATUS(NetBufferLists) != NDIS_STATUS_SUCCESS) {</div>
<div> IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ALL,</div>
<div> ("NBL completed with error %d to NDIS\n",</div>
<div> NET_BUFFER_LIST_STATUS(NetBufferLists)));</div>
<div> <b>}</b><b> else {</b></div>
<div> <b>ASSERT(NET_BUFFER_LIST_NEXT_NBL(NetBufferLists) == NULL);</b></div>
<div> <b>}</b></div>
<div> IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,</div>
<div> ("Completing NBL=%x, g_NBL=%d, g_NBL_completed=%d \n",</div>
<div> NetBufferLists, g_NBL, g_NBL_complete) );</div>
<div>#endif</div>
<div> </div>
<div>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)</div>
<div> </div>
<div>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.</div>
<div>I am ok with both of them</div>
<div> </div>
<div>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</div>
<div> </div>
<div>>-----Original Message-----</div>
<div>>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</div>
<div>>Tillier</div>
<div>>Sent: Monday, February 28, 2011 4:46 PM</div>
<div>>To: ofw@lists.openfabrics.org</div>
<div>>Subject: [ofw] [IPoIB] NdisMSendNetBufferListCompleteX assert</div>
<div>></div>
<div>>The assertion at line 1122 in ipoib_port.h seems wrong since the following code dereferences the NBL.</div>
<div>>Is it wrong, or there to cause an assert because of a send error?</div>
<div>></div>
<div>>If the latter, a comment would help make the intent clear, as the code looks wrong as is.</div>
<div>></div>
<div>>-Fab</div>
<div> </div>
<div>NdisMSendNetBufferListsCompleteX() is completing a 'single' NBL (NetworkBufferList); not a list of NBLs.</div>
<div>The code is correctly used in ipoib_port.cpp @ ipoib_port_send().</div>
<div> </div>
<div>Although it's usage in ipoib_driver.cpp @ ipoib_send_net_buffer_list() after label 'compl_status:' is incorrect.</div>
<div>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.</div>
<div>The dispatch check should be done once prior to entering the for()loop.</div>
<div> </div>
<div>Tzachi, Alex - do you agree?</div>
<div> </div>
<div>Stan.</div>
<div> </div>
<div>>_______________________________________________</div>
<div>>ofw mailing list</div>
<div>>ofw@lists.openfabrics.org</div>
<div>><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw</a></div>
<div>_______________________________________________</div>
<div>ofw mailing list</div>
<div>ofw@lists.openfabrics.org</div>
<div><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw</a></div>
<div> </div>
</span></font>
</body>
</html>