linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Jander <david@protonic.nl>
To: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Wolfgang Grandegger <wg@grandegger.com>,
	linux-can@vger.kernel.org
Subject: Re: [PATCH v5] can: flexcan: Re-write receive path to use MB queue instead of FIFO
Date: Wed, 1 Oct 2014 11:19:39 +0200	[thread overview]
Message-ID: <20141001111939.163edc61@archvile> (raw)
In-Reply-To: <1952804.jDdF5Ah5L9@ws-stein>

On Wed, 01 Oct 2014 09:11:37 +0200
Alexander Stein <alexander.stein@systec-electronic.com> wrote:

> On Wednesday 01 October 2014 08:29:32, David Jander wrote:
> > On Tue, 30 Sep 2014 09:43:33 +0200
> > Alexander Stein <alexander.stein@systec-electronic.com> wrote:
> > 
> > > Hello David,
> > > 
> > > On Tuesday 30 September 2014 09:13:55, David Jander wrote:
> > > > > > Nevertheless, emptying the FIFO in the IRQ handler will still be a
> > > > > > big improvement, since the only thing that could still kill the
> > > > > > driver and cause message loss is interrupt latency, which normally
> > > > > > should not be so high. NAPI scheduling latency is probably much
> > > > > > worse, and this is the biggest issue with the current driver.
> > > > > > 
> > > > > > Any suggestion on what to do?
> > > > > 
> > > > > Get rid of NAPI and use RT-preempt with proper priorities :) But joke
> > > > > aside, which workload does increase the NAPI latency so much, an
> > > > > overrun occurs? I tested CAN bursts on i.MX35 without any loss.
> > > > 
> > > > I have seen overruns on an i.MX6 at only 250kbaud receiving
> > > > back-to-back messages of 1 byte long. I usually test bursts of 10000
> > > > messages or more.
> > > 
> > > Mh, that's odd. I have run several tests a 1MBaud on an i.MX35 with 2 CAN
> > > nodes attached each sending bursts of 250 message every 200ms with a
> > > total message count of 250000 each. No overruns, losses or message
> > > misordering.
> > 
> > Do you have any other system-load? Have you tried something like
> > flood-pinging the ethernet port at the same time?
> > Your results sound very impressive. If messages are really sent
> > back-to-back, then there's about 300 microseconds of permissible latency
> > from interrupt to NAPI... how can you not get over that limit at least
> > once? You are not running PREEMPT_RT, do you?
> 
> It has been a long time ago, but IIRC there was no load despite CAN
> reception (!), no messages were sent. I'm not sure if I ever ran this test
> on that i.MX35 without PREEMPT_RT. Currently I don't have access to this
> hardware, so I cannot use it on a non-rt kernel.

It would be very interesting to see how it performs on a non-RT kernel under
load. In my experience flood-pinging, USB traffic and some CPU-bound load
(benchmark or similar) are interesting attacks to try each on its own or in
combination while the CAN test runs.
On the CAN side, I'd recommend long bursts (10000) of short back-to-back
messages (DLC=1) at a sensible baudrate (250kbaud, 500kbaud and 1Mbaud).
I used a Peak USB-CAN dongle on my PC to generate messages with can-utils
cangen. On the target candump to a log-file and a python script to analyze the
log-file for packet-ordering and -count, and a scope to make sure there is no
space between messages.

[...]

Best regards,

-- 
David Jander
Protonic Holland.

      parent reply	other threads:[~2014-10-01  9:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 12:52 [PATCH v5] can: flexcan: Re-write receive path to use MB queue instead of FIFO David Jander
2014-09-29 13:29 ` Alexander Stein
2014-09-29 14:39   ` David Jander
2014-09-29 15:02     ` Alexander Stein
2014-09-30  7:13       ` David Jander
2014-09-30  7:43         ` Alexander Stein
2014-10-01  6:29           ` David Jander
2014-10-01  7:11             ` Alexander Stein
2014-10-01  7:15               ` Marc Kleine-Budde
2014-10-01  8:29                 ` Alexander Stein
2014-10-01  9:07                   ` David Jander
2014-10-01  9:19                     ` Alexander Stein
2014-10-01  9:34                       ` David Jander
2014-10-01  9:58                         ` Marc Kleine-Budde
2014-10-06  7:28                           ` David Jander
2014-10-06 10:00                             ` Marc Kleine-Budde
2014-10-06 11:17                               ` David Jander
2014-10-07  9:30                                 ` [RFC PATCH 1/2] can: rx-fifo: Increase MB size limit from 32 to 64 David Jander
2014-10-07  9:30                                   ` [RFC PATCH 2/2] can: rx-fifo: Add support for IRQ readout and NAPI poll David Jander
2014-10-07 13:17                                   ` [RFC PATCH 1/2] can: rx-fifo: Increase MB size limit from 32 to 64 Marc Kleine-Budde
2014-10-07 13:27                                     ` David Jander
2014-10-07 14:18                                       ` Marc Kleine-Budde
2014-10-08  9:08                               ` [PATCH v5] can: flexcan: Re-write receive path to use MB queue instead of FIFO David Jander
2014-10-08  9:56                                 ` Marc Kleine-Budde
2014-10-08 10:36                                   ` Alexander Stein
2014-10-08 10:43                                     ` Marc Kleine-Budde
2014-10-08 14:01                                   ` David Jander
2014-10-09 10:37                                     ` David Jander
2014-10-01  9:19               ` David Jander [this message]

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=20141001111939.163edc61@archvile \
    --to=david@protonic.nl \
    --cc=alexander.stein@systec-electronic.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=wg@grandegger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).