lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Timers & Low Level Tick


From: Rick Culver
Subject: Re: [lwip-users] Timers & Low Level Tick
Date: Tue, 18 Mar 2008 09:40:09 -0500

Bill,
These are some good thoughts, thank you.  I also thought about trying to process the ethernetif_input() in an ISR triggered by the hardware when a packet is received but I had the same concerns.  Currently I have the ethernetif_input() and the timer functions called from a function (I call it lwip_check() which is simply called in my "main" loop.  I was wondering if I called lwip_check() from a low priority interrupt instead of the "main loop" if that might work.  It wouldn't step on the timer functions as they would be called at a different time from the same lwip_check() and at the same priority.  The 2 questions in my mind are 1) how often would I need to call lwip_check() and 2) would other functions in the "main loop" that try to output (tcp_write() or udp_write() ) would then have a problem being stepped on.  Any thoughts about these ideas?
Rick
----- Original Message -----
Sent: Monday, March 17, 2008 10:36 AM
Subject: RE: [lwip-users] Timers & Low Level Tick

Rick, you and I are using lwIP in a similar fashion.  I saw the same thing you did.  To significantly improve the performance, I changed ethernetif_input to return an int.  It returns 1 if it processed a packet (if low_level_input returned non NULL) and 0 if it didn’t.  When I process packets, I use:

 

while( ethernetif_input() )

    ;

 

to ensure I process all received packets.

 

I don’t believe you can reliably call ethernetif_input from an ISR.  I thought of doing the same thing on a “received a packet” interrupt, but this could interrupts tcp_fasttmr which I thought would be a bad thing.

 

Bill

 


From: address@hidden [mailto:address@hidden On Behalf Of Rick Culver
Sent: Monday, March 17, 2008 10:46 AM
To: address@hidden
Subject: [lwip-users] Timers & Low Level Tick

 

I am using the callback API with the LWIP stack.  Currently I have a function that calls the timers (etharp_tmr, tcp_slowtmr, tcp_fasttmr, etc.) and the processing of received packets.  I call this function in the main non-IRQ loop.  However, I am finding that in some cases I can not call this function frequently enough to keep up with the packets and/or timers.  I was thinking of setting up a low priority IRQ to simply call this function about every 100ms or so to process the timers and received packets.  My question is this, if I am also trying to set up calls to tcp_write at the non-IRQ level will cause problems for the stack to run my processing function at the low level IRQ interrupt?  Can this be done and/or can it be done with certain precautions in doing so?  Please advise.

Rick

 


reply via email to

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