lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Unable to allocate TCP_SEG


From: Josh Rothstein
Subject: RE: [lwip-users] Unable to allocate TCP_SEG
Date: Thu, 17 Jan 2008 16:51:31 -0800

The problem does not seem be in the TCP/IP thread being starved or blocked.
It is actually running properly.  It looks like the problem lies within the
ethernetif task that handles all the input from the MAC driver.  I am
getting stuck in low_level_input().

It looks like there is a packet waiting but:

p = pbuf_alloc( PBUF_RAW, len, PBUF_POOL ); 

returns NULL once I have transmitted a few times.
 
pbuf_alloc()is returning NULL because pbuf_pool == NULL. How did this
happen?

Any ideas?

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Jonathan Larmour
Sent: Wednesday, January 16, 2008 5:41 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Unable to allocate TCP_SEG

Josh Rothstein wrote:
> 
> 
> One more behavioral thing I noticed:
> 
>  
> 
> If I do lwip_send() and watch the debug output I will see the TCP header 
> information showing the stack received an ack for that packet.   If I do 
> a couple more lwip_send(), I will eventually stop seeing the TCP header 
> information and the tcp_enqueue() will begin to fill with TCP_SEGs.  I 
> if then close() the socket all the pending receives will then come 
> through the debug output. How can I stop this bottleneck?

Sounds like your tcpip_thread is getting stuck somewhere. Can you stop it 
and see where it is? Have you got a safe implementation of SYS_ARCH_PROTECT?

> Further examination shows that the problem lies within tcpip.c. For some 
> reason tcpip_input() fails when trying to memp_malloc(MEMP_TCPIP_MSG). 
> This occurs before tcp_enqueue() fills the MEMP_TCP_SEG pool. 
> tcpip_thread() does call memp_free(MEMP_TCPIP_MSG, msg) at the end of 
> the loop, so I am at a loss as to why the MEMP_TCPIP_MSG pool fills up.

This also points to tcpip_input blocking on something. What happens when 
mailboxes on your system fill up... does the relevant thread block? You 
may want to output a diagnostic in your port's sys_mbox_post function to 
check if this is what's happening.

Alternatively is your tcpip thread getting starved by some other busy 
thread in the system and never actually able to run and make progress with 
processing the packets?

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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