lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Sending 2 packets with same sequence number (solved)


From: Marco Jakobs
Subject: Re: [lwip-users] Sending 2 packets with same sequence number (solved)
Date: Thu, 22 Jul 2010 15:30:17 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6

Hi Simon,

i have found the problem. It's an error in the "emacif.c" of the LwIP port, so you can sit back and relax :-)

The check of the number of required EMAC buffers had an error:

/* First check if the number of TX buffers are theoretically large enough
         * to hold this frame.
         */
        uiRequiredTxBufs = 0;
        for( q = p; q != NULL; q = q->next )
        {
            uiRequiredTxBufs += 1;
            uiLenLeft = q->len - ( q->len % ETH_TX_BUFFER_SIZE );
            uiRequiredTxBufs += uiLenLeft / ETH_TX_BUFFER_SIZE;
        }

this returned wrong buffer counts and the data was discarded as the following check meant there were not enough TX buffers left.

After correction of the calculation, the problem is solved.

/* First check if the number of TX buffers are theoretically large enough
         * to hold this frame.
         */
        uiRequiredTxBufs = 0;
        for( q = p; q != NULL; q = q->next )
        {
             uiRequiredTxBufs += ( q->len / ETH_TX_BUFFER_SIZE);
             if (q->len % ETH_TX_BUFFER_SIZE) uiRequiredTxBufs++;
        }


Marco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]