Where are the packets?

Leon Pollak leonp at plris.com
Mon Aug 18 14:25:35 UTC 2008


Thank you Joel!

This is about 40% of the problem I have. Yes, I need to increase the default 
buffer for the UDP and I did not know about the SO_RCVBUF. Already running to 
test this.

But still there is one another problem: driver supplies packets into the 
protocol queue by ether_input() and silently drops them if there is no place 
in the queue - macro IF_DROP(inq). 

Although there is a counter which counts them, it is not printed out in any 
statistics, which is IMHO a painfull miss. I spent a lot of time looking for 
the packets, which were dropped at this point.

Just now the default size of the queue is 50. Should this number be also under 
some user control? How?

Thanks a lot.

> 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/n
>etworking00024.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




More information about the users mailing list