Linux CAN drivers development
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Luka Rahne <luka.rahne@gmail.com>
Cc: info@gerhard-bertelsmann.de, Michael Luxen <mluxen@gmx.net>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: AW: Receiving messages issue
Date: Fri, 05 Jul 2013 12:18:54 +0200	[thread overview]
Message-ID: <51D69D8E.6060803@pengutronix.de> (raw)
In-Reply-To: <CAOHwv555mUTjXQsB2KGPAEjdVkS1fOeWZxvTb+XEk-8HjkANwQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]

On 07/05/2013 12:07 PM, Luka Rahne wrote:
> I was able to include this driver in my project but first test shows
> that there is no significant improvement.
> 
> I also had to patch driver in order to compile and work.
> Can someone more experienced check patch for some fatal issues?

Just the tx_bytes calculation isn't correct, see inline. But that will
not cause bad performance.

>  Testing results:
> Test -> sending 520 messages in total (each burst had 65 unique ID
> messages of length 8 ) @ 100k baud.
> USB-PEAK-CAN used for listening only, confirms all messages on sent bus.
> 
> New spi async drivers mcp2515.c had 3% packet loss and stable stock
> driver mcp251x.c included in kernel 3.0.81 had 5% losts messages.

That's about 40% less packet loss.

> Decreasing baud on 50k had no packet loss for handling packets of
> length 8 bytes (stock driver), but there is still issue on receiving
> messages of length 0. (tested with stock driver only)
> As expected shorter messages generates more interrupts, since they
> takes less time to transfer.
> 
> Does anyone has any ideas what should I try, because I dont have lot
> more ideas to try with.

If I remember correct the i.mx spi driver uses a workqueue internally
and in newer kernels there isn't a kthread directly associated with that
workqueue. You can patch the spi driver to create a special kthread
based workqueue, which you can boost in priority via chrt in userspace
later.

> Is there any chip on market that has more than few RX buffers and can
> better handle high baud bus?

If you have access to the data and address bus on your processor you can
attach an sja1000 (you need a bunch of level shifters, too), that works
pretty good. Another option is to use some USB based CAN adapter.

regards,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

      reply	other threads:[~2013-07-05 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25  7:43 AW: Receiving messages issue Michael Luxen
2013-06-25 12:00 ` Gerhard Bertelsmann
2013-06-25 12:58   ` wg
2013-06-25 13:36   ` Marc Kleine-Budde
2013-07-05 10:04     ` Luka Rahne
2013-07-05 10:07     ` Luka Rahne
2013-07-05 10:18       ` Marc Kleine-Budde [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=51D69D8E.6060803@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=info@gerhard-bertelsmann.de \
    --cc=linux-can@vger.kernel.org \
    --cc=luka.rahne@gmail.com \
    --cc=mluxen@gmx.net \
    /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