Wolfgang Grandegger wrote:
> Christian Keydel wrote:

>> Can someone give me any hints on how to troubleshoot this? Is there any
>> debug output available that could help? Right now I don't even know at which
>> level the frames are dropped.
> 
> What does ifconfig show you? Also you can enable the kernel option
> CAN_DEBUG_DEVICES and look for CAN kernel messages using dmesg.
> Furthermore, you find some CAN network statistics in /proc/net/can.
> 
> It could happen that the socket receive buffer gets full. You could
> trying to increase the receive buffer size setsockopt(..SO_RCVBUF..).
> Looking to the code (raw.c) it seems that the skb is dropped silently.
> It would be nice to increment some statistics or to use a dev_dbg(), at
> least. Or have I missed something?

Yes. When the socket receive buffer is getting full (when the CAN application
has not that scheduled time to read an process the CAN frames), the
socket-buffers are dropped silently.

There are two approaches to deal with that topic:

1. increase the per-socket receive buffer:

The latest 'candump' has a commandline option '-r <size>' for that reason.

search for "setsockopt(s[i], SOL_SOCKET, SO_RCVBUF" in

   trunk/can-utils/candump.c

to see the according code to increase the per-socket receivebuffer.

2. detect the drops of socket-buffers:

I had a longer discussion on the linux-netdev mailing list about a general
feature to detect dropped socket-buffers on socket level (not to be silent
anymore ...).

The result is a new control message for all sockets:

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=3b885787ea4112eaa80945999ea0901bf742707f

This patch becomes part of 2.6.33 and i personally wanted to port this back to
2.6.28.10 which we use in one of our PowerPC hardware. And of course i plan to
support this new feature in 'candump' (e.g. to print dropcount information to
stderr).

Unfortunately this is not highest prio on my list - but i will do ;-)

I hope, these two ideas will help so far.

Regards,
Oliver

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to