lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Feeding incoming packets to lwIP


From: Ed Sutter
Subject: Re: [lwip-users] Feeding incoming packets to lwIP
Date: Tue, 14 Jan 2003 14:18:39 -0500

Dan,
First let me say that this is an "unqualified answer".  I've been using lwIP for
about 1.5 weeks, so I'll share what I "think" I know...

I do something very similar to what you are doing...
A separate task to intercept the interrupt through a uC/OS message queue, then 
that task
calls ethernet_input() (which ultimately calls tcpip_input).
The tcpip_input() function uses mailbox to post the event to the main 
tcpip_thread,
so I beleive this is the correct way to do it.  Actually, I've found this to be 
quite
convenient because in early stages of my driver work, I used that same task to 
simply
poll the ethernet interface periodically for incoming packets.  

Anyway, if anyone else is listening, and thinks this is wrong, please let us 
both know!!

Ed



Dan Lewis wrote:
> 
> Dear lwIP people,
> 
> What's the recommended way to feed incoming packets up to lwIP in an 
> interrupt-driven multi-threaded implmentation?
> 
> The interrupt service routine in my current implementation merely signals the 
> arrival of a packet by posting to a uC/OS mailbox. I created a separate 
> thread that contains an infinite loop that pends on that mailbox, and then 
> calls ethernetif_input to read the packet from the NIC (using 
> low_level_input) and pass it on to lwIP (using netif->input, which is a call 
> to tcpip_input).
> 
> So the real question is this: Is it safe to initiate the call to tcpip_input 
> from an independent thread in a preemptive multi-threaded system? I.e., does 
> tcpip_input use kernel calls to pass the packet on to lwIP (which is running 
> in a different thread)?  Or do I need to worry about critical sections in 
> this scenario?
> 
> Note that in addition to tcpip_input, ethernetif_input also calls 
> arp_ip_input, arp_arp_input, pbuf_header, and pbuf_free. Are these routines 
> also thread-safe?
> 
> Is there a better way to feed incoming packets to lwIP in this kind of 
> environment?
> 
> Thanks in advance!
> 
> Dan Lewis, Chair
> Computer Engineering
> Santa Clara University
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-users

Attachment: els.vcf
Description: Card for Ed Sutter


reply via email to

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