[Top][All Lists]

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

Re: [lwip-users] lwIP reentrancy issues and TCP

From: Simon Goldschmidt
Subject: Re: [lwip-users] lwIP reentrancy issues and TCP
Date: Sat, 25 Jun 2011 09:26:43 +0200

Peter Montgomery <address@hidden> wrote:

> You say that lwIP was designed to be run entirely from foreground (FG for 
> short) code, with the Ethernet hardware interrupt handler merely setting a 
> flag that the FG code polls.  So the entire system was designed to be run in 
> a polled mode?  I guess this presupposes that the FG would never get stuck 
> doing something that took a little too long, and fail to poll in a timely 
> manner.  That seems awfully hard to guarantee.

Well, I should have mentioned that an ISR may pull packets off the hardware and 
put them into a queue which is then processed by FG code. You can do this by 
either preallocating pbufs for RX packets or by correctly implementing 
SYS_LIGHTWEIGHT_PROT and calling pbuf_alloc(PBUF_POOL) from the ISR.

> You also say Stellaris is a bad example of an lwIP implementation.

I didn't mean to say that Stellaris is bad. It's a perfectly working way to use 
lwIP (as far as I know: I haven't been using it, only had a quick look at the 
freely downloadable code and heard what users said on this list). However, 
using lwIP this way is a bit confusing for lwIP beginners, that's all I meant 
to say.

> Since Stellaris has lwIP running completely in interrupts, what's the best 
> way for me to get messages from the FG to lwIP's interrupt code?

And this question is the reason I said it's "a bit confusing for lwIP 

Hmm, the easiest way might be to disable the ethernet interrupt while calling 
into lwIP from FG code. However, I can't really help you here as I don't really 
know the implementation detailed enough to guide you.


reply via email to

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