lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ERR MEM & TCP_OUT_ORDER


From: Kieran Mansley
Subject: Re: [lwip-users] ERR MEM & TCP_OUT_ORDER
Date: Tue, 29 Nov 2011 20:25:21 +0000

On 28 Nov 2011, at 21:57, Cellule Num wrote:

> I have a lot of error message with "ERR4N -1" so a ERR MEM but i have 
> verified the snd_buf.

You're accessing state that is not part of the API.  You should use 
tcp_sndbuf() rather than conn->snd_buf directly.  However, I don't think there 
is a way to get at the sndqueuelen field through the API so I can see why 
you've done it that way, and it doesn't explain why you get the ERR_MEM from 
tcp_write().  I think the logic you are looking for is:

if( ! ( (1440 > tcp_sndbuf(serveur1.tcp_socket)) || 
 (snd_queuelen >=TCP_SND_QUEUELEN) ||
 (snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW) ) )

which is functionally nearly the same as you have, but I think you've made an 
error when negating the clause to avoid the runtime-not (which will probably 
work out to be compile time anyway).

Try that.  If it still fails with ERR_MEM despite passing the above then let us 
know.

The other problem you have is you don't handle err=-4 or err > -9.  Rather than 
coding checks against integers like that, why not use the ERR_IS_FATAL macro?

The client acknowledging every other frame is normal.  This is the delayed ack 
algorithm working, and reducing the number of acknowledgments (and their 
associated overhead).

None of this explains why there is such a degradation in performance. Please 
send the packet capture.  And make it clear which end of the connection (i.e. 
IP address) is the lwIP device, and which end is not.  If you have a capture 
that shows the good performance and one that shows the bad performance, that 
would be great.

Kieran









reply via email to

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