I'm agree with Simon, your recvmbox should be big
enought to recv enought packets (more than TCP_WND - problem, TCP_WND
is in bytes, the recvmbox will contains packets). So, find the good
nucleus setting, or implement your own one (take a look to unix or msvc6
port).
About the CS8900A driver, take a look to these
links
----- Original Message -----
Sent: Tuesday, November 06, 2007 8:00
PM
Subject: [lwip-users] Deadlock
Hello everybody,
If you already have discussed it in
some threads please forgive me and help me with a link to that
thread.
I was porting lwIP (I am using latest code from CVS, not any
stable build) for Nucleus running on a ARM9 core uP. I am stuck with the
following problem; this looks like a deadlock:
I have a TCP client (a
single socket in a single thread) doing HTTP download from a remote server. I
have CS8900A ethernet driver (btw I have heard in some sites that there is a
CS8900A driver implementation available for lwIP, but could not find any).
posting packets throught netif->input (tcpip_input) into 'mbox' mailbox.
After receiving a few segments everything stops working. I did some
investigation and saw that tcpip_thread is waiting on conn->recvmbox to
post received packets as mailbox posts on full mailboxes are blocking. Driver
is waiting on mbox to post packets it has received. Application is waiting on
mbox to post do_recv API message. I have investigated further and found out
that in netconn_recv we should actually keep emptying conn->recvmbox in
order for the tcpip_thread to keep going.
In the case of Nucleus the
mailbox size is only four and if it so happen that to consume a single TCP
segment application thread takes as much time as 9 segments are produced
by the driver then by the time application thread comes to post do_recv into
mbox it is already filled up by driver.
I have observed that adjusting
the priority of three threads properly; it can be handled but for multiple
thread each fetching using a number of sockets will lead to the same
problem.
Please help me with some light. Am I missing something
obvious?
Thanks in advance, Bikram
-- Bikram
Chatterjee Senior Engineer Alumnus Software Limited Kolkata
_______________________________________________ lwip-users mailing
list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users
|