lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Implementing sys_arch on lwip 1.3.2


From: Luca Ottaviano
Subject: Re: [lwip-users] Implementing sys_arch on lwip 1.3.2
Date: Mon, 23 May 2011 19:55:12 +0200

On lun, 2011-05-23 at 18:16 +0200, Simon Goldschmidt wrote:
> Luca Ottaviano <address@hidden> wrote:
> > Ah, maybe that's the misunderstanding; I'm initializing the interface
> > using:
> > netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, ip_input)
> > 
> > So my ethernet thread is calling ip_input() directly instead of
> > tcpip_input().
> 
> Well, that's a bug in your port then. The (often repeated) principle of lwIP 
> is that only one thread may be active in lwIP at a time. And if you are using 
> NO_SYS==0 (so you are using the tcpip_thread), you *must* use tcpip_input to 
> pass packets into the stack. Using ip_input does not work in that case (and 
> BTW, you should have used ethernet_input to prevent coding the ARP processing 
> yourself).
> 
> Unless I understood you wrong and you're not calling lwip_init() or 
> tcpip_init() at startup or you're not using NO_SYS==0.

Hi Simon,
thank you very much for the support.
I'm indeed using threads and tcpip_init() is called. The problem was in
my port (of course, I would say :), inside the ethernetif_input() I was
doing too much processing which is done in upper layers.

Unfortunately, too many people have touched the same code in a long time
frame with only partial knowledge on what they were doing...

I have only one remark: I guess that since you're developing a stack for
embedded systems you have a working port done on your reference
platform, don't you? Is it possible to include an 'official' working
port with the source code releases? That's because contributed ports
tend to lag behind and they are not aligned with the current version
best practices.

Thanks,
-- 
Luca Ottaviano - address@hidden
Develer S.r.l. - http://www.develer.com/
.hardware .software .innovation
Tel.: +39 055 3986627 - ext.: 218




reply via email to

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