From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19208 invoked by alias); 8 Dec 2008 13:38:51 -0000 Received: (qmail 19193 invoked by uid 22791); 8 Dec 2008 13:38:50 -0000 X-Spam-Check-By: sourceware.org Received: from mail01.solnet.ch (HELO mail01.solnet.ch) (212.101.4.135) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Dec 2008 13:37:55 +0000 Received: from mail01.solnet.ch ([127.0.0.1]) by localhost (mail01.solnet.ch [127.0.0.1]) (SolNet-Check, port 10024) with LMTP id 9cMWYIZdKm44 for ; Mon, 8 Dec 2008 13:37:47 +0000 (UTC) Received: from beta.intefo.ch (static-212-101-18-64.adsl.solnet.ch [212.101.18.64]) by mail01.solnet.ch (Postfix) with ESMTP id A60595C538 for ; Mon, 8 Dec 2008 13:34:20 +0000 (UTC) Received: from beta.intefo.ch ([127.0.0.1]) by localhost (beta.intefo.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rnEGLVaMr3m3 for ; Mon, 8 Dec 2008 14:34:18 +0100 (CET) Received: from [192.168.1.20] (simon.intefo.ch [192.168.1.20]) by beta.intefo.ch (Postfix) with ESMTP id 1FD5B7700E7 for ; Mon, 8 Dec 2008 14:34:18 +0100 (CET) Message-ID: <493D2264.2050204@intefo.ch> Date: Mon, 08 Dec 2008 16:30:00 -0000 From: Simon Kallweit User-Agent: Thunderbird 2.0.0.18 (X11/20081125) MIME-Version: 1.0 To: eCos Disuss Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] lwIP 1.3 port X-SW-Source: 2008-12/txt/msg00064.txt.bz2 Hi I've invested a bit of time into porting lwIP 1.3 to eCos. I got a basic port up and running (using the synth ethernet driver). I have more or less completely rewritten the CDL script, having most of the lwIP configuration options in the CDL. I also adapted the system architecture, the tests, and changed some of the glue code. The glue code is where I'm not quite happy right now. lwIP offers two modes of operation, a single-thread model (using the event API) as well as a threaded model, using the sequential API (netconn or sockets). lwIP is primeraly used when resources are low, and the single-threaded model is the preferred mode of operation in that scenario. Let me outline what I have in mind for implementation, and let me know if you have any concerns, criticism or hints. Multi-threaded operation: In this mode, lwIP implicitly creates a thread called "tcpip" which basically processes incoming messages on an event queue. These events contain requests from the sequential APIs (netconn, sockets) as well as requests to process ethernet packets. The current eCos glue code adds another thread for ethernet packet delivery. All this thread does is waiting on a counting semaphore (posted by the ethernet drivers when packets arrive), receive the packets on reception, and post an event to the tcpip thread for processing. This model is quite wasteful on resources, as the two threads could probably be consolidated into one, but this would require changes in the lwIP code base, which I would like to avoid, so I guess the current model is OK. Single-threaded operation: In this mode, a single thread is used for all handling of the stack. In the current port, the user needs to initialize lwIP "by hand", setup timeouts etc. I would like to write some glue code to simplify usage of lwIP in this mode. The glue code should implement an initialization routine as well as the basic operation of the lwip thread (similar to what the tcpip thread in the threaded version provides). Basic timeouts of the protocols should automatically be handled when enabled in the configuration, and ethernet drivers should be polled. I would also like to integrate SLIP and PPP support. As these have to run in a separate thread (for serial communication), we need a simple queue to pass received packets to the main thread. If this all sounds a big vague, I'm sorry, I'm just trying to lay it all out in my head. I guess I'll have to implement it and see where it goes. If anyone is interested in the current port, you can get it at https://hg.inthemill.ch/hg/ecos but it is all work in progress and subject to change. Simon -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss