lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Choosing the right lwip API...


From: Jonathan Larmour
Subject: Re: [lwip-users] Choosing the right lwip API...
Date: Wed, 28 Jan 2009 23:50:59 +0000
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515)

DownyTif wrote:
I do have some more questions on this topic... I decided to test the speed
improvements using the RAW API. This API allows me to use only one thread to
do whatever I want instead of two threads using the sequential API because
the "recv" is blocking and I need to send data in the idle time.

1- I just read from the Wiki that the RAW API can only be used by the main
thread?? In my project, I need the main thread to call
"vTaskStartScheduler()" to run FreeRTOS for multithreading, which never
returns. So, I can't use my main thread to manage the RAW API, but I can
call "tcp_new", "tcp_bind", "tcp_listen" and "tcp_accept" before. Is that
sufficient?

It just means a single thread. It doesn't have to be the thread used for main(). What really matters is that nothing can call into lwIP core code from more than one context at the same time, whether it be another thread, interrupt handler, etc.

2- What do I need to call to use/init the RAW API? For the sequential, I was
using sys_init(), mem_init(), memp_init(), pbuf_init(), netif_init(),
tcpip_init(EthernetConfigInterface, NULL). I'm not sure if I still need
those... or if I'm missing something.

What version of lwIP are you using? For 1.3.0, you can use lwip_init() instead for much of it, except for tcpip_init (which is specific to when using the sequential or sockets APIs). See src/core/init.c. I would have hoped it would be in the wiki, but from a look around I'm not sure it's there yet.

Actually it should also be described in doc/rawapi.txt in the source distribution. Patches welcome from anyone who's tried it recently!

3-
I haven't found it, so I think it would be good to have a little resume of
what are the #defines needed by all the API. For example, if I want to use
the RAW API, I must absolutly define some values in the lwipopts.h file.
Personally, I'm not sure I have everything configured ok..

Most of the defines are still relevant when using the raw API. And the ones that aren't relevant are ignored. After all, the sequential API is essentially just a user of the raw API itself.

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




reply via email to

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