lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] calculating memory #define(s) in lwip


From: Rejean Groleau
Subject: Re: [lwip-users] calculating memory #define(s) in lwip
Date: Wed, 22 Apr 2009 15:02:05 -0700 (PDT)

You might be short on PBUFs:
your PBUF size is 256 bytes,
you have 16 static PBUFs + 16 dynamic PBUFs,
which makes 8192 bytes available in total.

This includes incoming and outgoing packets,
and considering your output queue size of 8192 bytes,
nothing would be left even just for SYN packets.

If you want to investigate more on that subject,
you could either step through the LwIP tcp_write()
and tcp_enqueue() functions to see where it fails,
or you could just enable the LWIP_DEBUG macros
for your specific platform.

Most likely you'll see some messages like:
"memp_malloc: out of memory in pool PBUF_TCP".

Your MEMP_NUM_PBUF should be at least twice
its actual value, plus some headroom just in case.

On a side note: it is normal that your send buffer gets full.
It's up to you to decide of its size, and whether or not
you want to max it up in both your TCP applications.

You could always test if it's half-full, and act accordingly,
to balance the available bandwidth between your applications.


bandu wrote:
> 
> #define MEM_SIZE                        (24 * 1024)
> #define MEMP_NUM_PBUF                   16
> #define PBUF_POOL_SIZE                     16
> #define TCP_WND                                 (8 * 1024)
> #define TCP_MSS                                1024
> #define TCP_SND_BUF                         (8 * TCP_MSS)
> #define TCP_SND_QUEUELEN               (MEMP_NUM_TCP_SEG) *4
> #define PBUF_POOL_BUFSIZE             256
> 

-- 
View this message in context: 
http://www.nabble.com/calculating-memory--define%28s%29-in-lwip-tp23166173p23177250.html
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

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