lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Length of the packet from low_level_input()


From: Martin Velek
Subject: Re: [lwip-users] Length of the packet from low_level_input()
Date: Wed, 8 Dec 2010 09:59:25 +0100

> Can two threads enter into the low_level() functions? (I am
> running lwip with an OS, with a socket based model, and I am using an
> Ethernet RX worker task that will run after an RX interrupt)

(taken from ethernetif.c example)
If you think functions like
low_level_output(struct netif *netif, struct pbuf *p)
low_level_init(struct netif *netif)
low_level_input(struct netif *netif)
........................
low_level_init  & low_level_output are called from the lwip tcp_ip
thread, so that you should not call it if there is not any
synchronization point.

low_level_input is called from ethernetif_input what is generally a
"RX worker task that will run after an RX interrupt". If the
low_level_input only grabs data from Ethernet device and gets preemted
you could have a problem. Data from low_level_input are passed to
tcp_ip thread with netif->input(p, netif). I think you can call
netif->input(), get preempted and call it again because you are
sending only messages to tcp_ip thread.


Martin



reply via email to

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