lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Feeding incoming packets to lwIP


From: Dan Lewis
Subject: [lwip-users] Feeding incoming packets to lwIP
Date: Tue, 14 Jan 2003 10:46:24 -0800

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






reply via email to

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