Where are the packets?

Joel Sherrill joel.sherrill at OARcorp.com
Mon Aug 18 13:57:05 UTC 2008


Leon Pollak wrote:
> Hello.
>
> I need to properly receive ethernet bursts of 4000 UDP packets in my
> application. For this I changed the driver tasks priorities to be higher
> (lower by value) then the stack task (ntwk).
>
> My MPC8260 FCC driver properly receives all 4000 packets and passes them to
> the ether_input(...). I also check the memory state in the driver by:
>         if ((mmbfree == 0) || (mclfree == 0)){....
> and did not observed this situation even once.
>
> But still the application (that does nothing but recv(...)) receives only 28
> packets.
>
> How can I trace/know what happened to the rest 3972?
>
>   
This from the 4.9 release notes might help.
==============
Addition of network stack configuration parameters to control default 
buffer sizes for sockets. This addresses the issue that was described in 
http://www.rtems.org/ml/rtems-users/2004/february/msg00200.html in which 
the default socket buffer tend to be large in comparison to the amount 
of memory users configure for mbufs. This leads to a starvation and 
TCP/IP "freeze". This scenario can be created with just a handful of 
sockets and fairly light traffic and is worsened by use of UDP sockets 
which default to larger buffering than TCP sockets. See the Network 
Supplement for more details on each of the following parameters:

    * sb_efficiency - buffering factor or multiplier
    * udp_tx_buf_size - default size of transmit buffers for UDP sockets
    * udp_rx_buf_size - default size of receive buffers for UDP sockets
    * tcp_tx_buf_size - default size of transmit buffers for TCP sockets
    * tcp_rx_buf_size - default size of receive buffers for TCP sockets


==============

and
https://www.rtems.org/onlinedocs//doc-current/share/rtems/html/networking/networking00024.html
for the configuration on default buffering on sockets.  I believe you
have fallen into this pit.  It can take a surprisingly large amount of
memory. 

If you don't want to lower the default socket buffering, there are
portable ioctl's to control this on a per socket basis.

FWIW I think the configuration parameters to change the default
for all sockets is only on the CVS head and not in 4.8
> Many many thanks ahead.
> ---
> Leon
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list