The error is most likely caused by a long IP packet in my LAN. Flow of events:
* MSS_MAC_rx_packet returns a negative number ( FreeRTOS/Demo/CORTEX_A2F200_SoftConsole/MicroSemi_Code/drivers/mss_ethernet_mac/mss_ethernet_mac.c line 585)
* vuIP_task only handles positive return values ( FreeRTOS/Demo/CORTEX_A2F200_SoftConsole/uIP_Task.c line 180 )
* The supposedly-too-large packet is never acknowledged, and hence all subsequent packets are lost.
* webserver no longer serves anything, as IP receive queues is stuck. I do not know who generates the those too large packets in 1st packet; my LAN is large and noisy and the error is rather infrequent. Artificially they can be generated e.g. with ping -s Where and how should this be fixed ?
The following seems to make the problem go away, but I am not sure if this is the best way.
--- Demo/CORTEX_A2F200_SoftConsole/MicroSemi_Code/drivers/mss_ethernet_mac/mss_ethernet_mac.c 2011-12-20 16:12:18.000000000 +0200
+++ Demo/CORTEX_A2F200_SoftConsole/MicroSemi_Code/drivers/mss_ethernet_mac/mss_ethernet_mac.c 2011-12-20 16:12:54.000000000 +0200
@@ -582,6 +582,7 @@
frame_length -= 4u;
if( frame_length > macBUFFER_SIZE ) {
+ MSS_MAC_prepare_rx_descriptor();
return MAC_NOT_ENOUGH_SPACE;
}