This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28M35x lwip interface should not be calling from interrupt

The Concerto interface to lwip seems to calling the stack code from its ethernet interrupt handler. After talking with people very familiar with lwip, they have warned that this is not recommended!

I've copied their comment below:

"I've seen some vendors call the netif_input functions from
interrupt code and I don't think that is safe since lwIP is single
threaded. Some functions can be reentrant, but I wouldn't take risks.
Check your Ethernet interrupt code and make sure you call the netif
input in foreground. You see, that call is a whole drive for the whole
stack, it is not a "put this frame in your buffer", the frame is
processed, the IP is extracted, then the TCP, and it gets through to
your tcp_sent() callback function. So, if you are sharing some vars
among let's say tcp_recv() and tcp_sent() callbacks, if you call
netif_input from interrupt code, then your tcp_sent() callback might end
up interrupting your tcp_recv() callback..."

By the way, I think he means background instead of foreground. It seems the safe usage of lwip is to use the ethernet handler to store the packet away and set a flag, then let the main thread call the lwip API. The current implementation on the F28M35x seems unsafe in this regard, and can lead to very hard to debug problems down the line.

As an aside, can the lwip version be updated to the latest? Concerto is still using 1.3.2, while lwip has moved to 1.4.1. The standalone TI - ARM processors seem to be using the latest version, so this should not be a difficult update.