lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] lwIP 1.4.0.rc1: netconn_write is not returning


From: Benjamin Schelte
Subject: [lwip-users] lwIP 1.4.0.rc1: netconn_write is not returning
Date: Wed, 24 Nov 2010 10:12:49 +0100

Hi all,

 

yesterday I was facing a problem, where a call to the function netconn_write was not returning at all.

The worst thing about it was that it prevented the lwIP stack from processing other input as well.

 

The reason seems to be that lwIP was not properly configured by me.

 

In the opts I had the following:

 

/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */

#define MEMP_NUM_TCP_SEG        10

 

/* TCP receive window. */

#define TCP_WND                 (2 * TCP_MSS)  // BS+: Should be at least twice TCP_MSS

 

/* TCP receive window. */

#define TCP_WND                 (2 * TCP_MSS)  // BS+: Should be at least twice TCP_MSS

 

// BS+: The following macro should be 45, but then the size exceeds (64*1024)

// For some reason the buffer must be set quite large, if one uses sockets

/* TCP sender buffer space (bytes). */

#define TCP_SND_BUF             (44 * TCP_MSS)

 

/* TCP sender buffer space (pbufs). This must be at least = 2 *

   TCP_SND_BUF/TCP_MSS for things to work. */

#define TCP_SND_QUEUELEN        (4 * TCP_SND_BUF/TCP_MSS)

 

The experienced users might realize that MEMP_NUM_TCP_SEG is too small in this configuration.

So I tried to send more than 16k at once in my webserver by using netconn_write. As it did not return within 30 seconds my monitor task was resetting the device again and again.

The solution for me was to set the following in the options instead.

 

/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */

/* Should be at least as big as TCP_SND_QUEUELEN */

#define MEMP_NUM_TCP_SEG        (2 * TCP_SND_QUEUELEN)

 

 

I don’t know if the developers consider this as a problem due to the fact that the stack was not properly configured, but I just want to let you know.

 

Best regards,

Benjamin

 


reply via email to

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