[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Unable to allocate TCP_SEG
From: |
Jonathan Larmour |
Subject: |
Re: [lwip-users] Unable to allocate TCP_SEG |
Date: |
Thu, 17 Jan 2008 01:40:56 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515) |
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