<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Interniche Lite buffer problem in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199537#M9080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im using the Interniche Lite stack from 2006(?). It came with the MCF52235 EVB. I'm having problems with&lt;/P&gt;&lt;P&gt;what seems to be packet buffers not getting freed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After system startup i have 9 bigbufs and 5 small bufs free. Every minute or so i print the number of free buffers.&lt;/P&gt;&lt;P&gt;After some time, let's say 30 mins of traffic on the ethernet, the number of free bigbuffer goes down to 8 or 7.&lt;/P&gt;&lt;P&gt;Some time later (lets say another 30 mins) it goes down by one or two buffers more. Ultimaltily, I have no big buffers left for packet transmission,&amp;nbsp; which results in an udp_alloc error cant allocate a buffer for the packet to be sent. So, I'm thinking there must be a bug somewhere that causes this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The system can run forever if the mcf52235 is simply receiving broadcasts (No need for PC server updating ARP table?).&lt;/P&gt;&lt;P&gt;But, when the system is running with packets directed directly to the uC IP address, the problem starts.&lt;/P&gt;&lt;P&gt;My theory is that when the top side computer must send directly to the board it needs to occationaly send an ARP request&lt;/P&gt;&lt;P&gt;to the board, and that this ARP sometimes causes a problem with the buffers/ buffer descriptors not getting freed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not sure that it really is ARP related though. It may be something completely different, but I just wanted to know if anybody else has had similar problems?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon Even&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Apr 2011 18:29:42 GMT</pubDate>
    <dc:creator>JonEven</dc:creator>
    <dc:date>2011-04-19T18:29:42Z</dc:date>
    <item>
      <title>Interniche Lite buffer problem</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199537#M9080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im using the Interniche Lite stack from 2006(?). It came with the MCF52235 EVB. I'm having problems with&lt;/P&gt;&lt;P&gt;what seems to be packet buffers not getting freed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After system startup i have 9 bigbufs and 5 small bufs free. Every minute or so i print the number of free buffers.&lt;/P&gt;&lt;P&gt;After some time, let's say 30 mins of traffic on the ethernet, the number of free bigbuffer goes down to 8 or 7.&lt;/P&gt;&lt;P&gt;Some time later (lets say another 30 mins) it goes down by one or two buffers more. Ultimaltily, I have no big buffers left for packet transmission,&amp;nbsp; which results in an udp_alloc error cant allocate a buffer for the packet to be sent. So, I'm thinking there must be a bug somewhere that causes this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The system can run forever if the mcf52235 is simply receiving broadcasts (No need for PC server updating ARP table?).&lt;/P&gt;&lt;P&gt;But, when the system is running with packets directed directly to the uC IP address, the problem starts.&lt;/P&gt;&lt;P&gt;My theory is that when the top side computer must send directly to the board it needs to occationaly send an ARP request&lt;/P&gt;&lt;P&gt;to the board, and that this ARP sometimes causes a problem with the buffers/ buffer descriptors not getting freed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not sure that it really is ARP related though. It may be something completely different, but I just wanted to know if anybody else has had similar problems?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon Even&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 18:29:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199537#M9080</guid>
      <dc:creator>JonEven</dc:creator>
      <dc:date>2011-04-19T18:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Interniche Lite buffer problem</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199538#M9081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd print the contents of the "leaked buffers" and then decode the contents of the contained network packet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By seeing the addresses, protocol and type of the packet you should be able to work out what code generated or received the packet, and thereby spot the leak.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 12:05:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199538#M9081</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2011-04-20T12:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Interniche Lite buffer problem</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199539#M9082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;Jon,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;We're seeing exactly the same thing!&amp;nbsp; Are you still having a problem?&amp;nbsp; We're using an MCF52236, with the Interniche stack from 2006 as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;Through painstaking analysis, we discovered a big chunk of the problem.&amp;nbsp; It seems that the buffers are "lost" on transmit:&amp;nbsp; In fectx_internal(), transmit buffers are pulled off the FEX transmit queue (fectxq), and put into the "buffer descriptor array" called txpend[]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pkt = (PACKET)getq(&amp;amp;fectxq);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* get pkt to send */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txpend[next_txbd] = pkt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;...while the status of the buffer descriptor itself is checked in the lines before (see line with MCF_FEC_TxBD_R), the spot in the txpend[] array isn't checked for NULL-ness.&amp;nbsp; Changing the code to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pkt = (PACKET)getq(&amp;amp;fectxq);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* get pkt to send */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(txpend[next_txbd] == NULL) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txpend[next_txbd] = pkt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pk_free(pkt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 9.5px; font-family: Consolas;"&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;...helped a great deal.&amp;nbsp; This code change reduced the problem by about 90%.&amp;nbsp; This, combined with a periodic test for lost buffers (and a reset if we get in an unrecoverable situation), got us out of the woods.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9.5px; font-family: Consolas;"&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9.5px; font-family: Consolas;"&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;I would very much like to talk with you if you are still experiencing this&lt;/SPAN&gt;&lt;SPAN style="font-family: 'times new roman', times; font-size: 12pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 20:38:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Lite-buffer-problem/m-p/199539#M9082</guid>
      <dc:creator>jonathanlawry</dc:creator>
      <dc:date>2012-11-20T20:38:05Z</dc:date>
    </item>
  </channel>
</rss>

