lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Socket-API and memory allocation.


From: Jonathan Larmour
Subject: Re: [lwip-users] Socket-API and memory allocation.
Date: Mon, 22 Oct 2007 13:17:48 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

address@hidden wrote:

Hello.

I'm using LwIP 1.2.0 and I've run into some problems when it comes to
the bulk of parameters that tunes LwIP when it comes to memory consumption
and performance. The current problem is if there is any document
describing the relation between all the parameters that are defined in
opts.h.

Only the comments in opts.h really. The code in CVS has some new consistency checking in it, although there's only so far that can go.

Another problem I have is how LwIP handles allocation errors (or rather
DOESNT handle them). For example when using the Socket API and calling
send(), the code ends up at the following point:

send() (or lwip_send()) ends up calling netcon_write().
netcon_write() first allocates a API_MSG, and seem to handle any failure
to do so in a good way. However, later in netcon_write() the following two
lines can bee seen:

    api_msg_post(msg);
sys_mbox_fetch(conn->mbox, NULL);
api_msg_post() begins with allocating a TCPIP_MSG, but if this fails,
conn->mbox is never ever signaled, causing the application doing the
send() to lock up for ever.

Yes, this was a known issue, and is fixed in CVS by allocating the TCPIP_MSG on the stack. However if you need to stay with 1.2.0, then all you can do is increase the number of TCPIP_MSG's.

If you want to move to using the code in CVS, there's a wiki that describes the changes required at http://lwip.scribblewiki.com although personally I've never been able to get that site working (I know what the issue is, and reported it to their admins, but they haven't done anything about it).

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.
 >>>> Visit us on stand 810 at The Embedded Systems Show 2007, NEC <<<<
 >>>> Oct 17-18 Birmingham, UK http://www.edaexhibitions.com/ess/  <<<<
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

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