All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Paul Lever <svjeorgia@gmail.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: candump error flags
Date: Sat, 08 Nov 2014 17:44:22 +0100	[thread overview]
Message-ID: <545E4866.1070003@hartkopp.net> (raw)
In-Reply-To: <CAHuoerk0S9FxsoQiCm-gc5ohvAGqjVnVpSJ2ev1jD8e31-5_Dw@mail.gmail.com>

On 11/08/2014 04:34 PM, Paul Lever wrote:

>> In this case the -d option should work.
>> But just for the records: The -d option detects drops from the network layer
>> to the application which opened the socket (here: candump).
>>
>> So it basically detects problems when your user space application is not fast
>> enough to read and handle the CAN frames. It does NOT detect whether the CAN
>> driver dropped any frames.
> 
> 
> Thanks for the info. Is there an easy way to detect driver level
> packet drops or overruns?The CANBUS is at 250,000 bitrate.

When the CAN driver supports it, there's a bit in the error message

	CAN_ERR_CRTL_RX_OVERFLOW

for that.

See:
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/include/uapi/linux/can/error.h?h=linux-3.17.y#n63

Looking for it in the tree:
http://lxr.free-electrons.com/ident?i=CAN_ERR_CRTL_RX_OVERFLOW


It is used in c_can_handle_lost_msg_obj()

http://lxr.free-electrons.com/source/drivers/net/can/c_can/c_can.c#L348

So it should also increase rx_errors and rx_over_errors.

I'm not familiar with c_can - but can you see these statistics increasing the
values in your setup?

ip -stats link show can0

should display them.

Regards,
Oliver

  reply	other threads:[~2014-11-08 16:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 13:57 candump error flags Paul Lever
2014-11-07 14:13 ` Andri Yngvason
2014-11-07 14:30 ` Marc Kleine-Budde
2014-11-07 14:56   ` Oliver Hartkopp
2014-11-08 14:47     ` Paul Lever
2014-11-08 15:00       ` Oliver Hartkopp
2014-11-08 15:14         ` Paul Lever
2014-11-08 15:29           ` Oliver Hartkopp
2014-11-08 15:34             ` Paul Lever
2014-11-08 16:44               ` Oliver Hartkopp [this message]
2014-11-09 14:50                 ` Paul Lever
2014-11-08 16:46           ` Marc Kleine-Budde
2014-11-09 14:52             ` Paul Lever
2014-11-09 15:01               ` Marc Kleine-Budde
2014-11-09 15:23                 ` Paul Lever
2014-11-10  5:29                   ` Pankajkumar Misra (RBEI/EEA2)
2014-11-13 10:20                     ` mcp251x (was: Re: candump error flags) Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545E4866.1070003@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=svjeorgia@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.