linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Evans <tom_usenet@optusnet.com.au>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Mirza Krak <mirza.krak@hostmobility.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: rx-fifo: add implmentation and switch flexcan driver to use it
Date: Fri, 13 May 2016 21:44:45 +1000	[thread overview]
Message-ID: <5735BE2D.7090807@optusnet.com.au> (raw)
In-Reply-To: <5732F76E.6080804@hartkopp.net>

On 11/05/2016 7:12 PM, Oliver Hartkopp wrote:
>
>
> On 05/10/2016 02:55 PM, Mirza Krak wrote:
>> 2016-05-10 10:27 GMT+02:00 Mirza Krak <mirza.krak@hostmobility.com>:
>>> 2016-05-09 12:52 GMT+02:00 Marc Kleine-Budde <mkl@pengutronix.de>:
>>>> Hello,
>>>>
>>>> this patch add support for a software bases rx-fifo implementation 
>>>> (patches
>>>> 1+2). The remaining patches modify the flexcan driver to make use 
>>>> of it. imx6
>>>> and vf610 SoCs can make use of the 64 mailbox software FIFO, while 
>>>> older SoCs
>>>> still use flexcan's 6 mailbox deep hardware FIFO.
>>>>
>>>> Testing on any flexcan core is highly appreciated.
>>>
>>> Hi Marc.
>>>
>>> Tested your patch series on a vf610 SOC. I ran 2 x CAN @ 1Mbit, 
>>> 80-90 % busload.
>>>
>>> I do no longer get any "overrun" errors, which I got without your
>>> patch series. And it seems to be stable, unlike previous patch series.
>>> Improvement!
>>>
>>> However I ran a simple sequence test and there seems to be some
>>> ordering issues. I have some memory of that similar issues have been
>>> discussed earlier on the mailing list and I am not quite sure if this
>>> is related to your patch series but I get following:
>>>
>>> root@mx4-v61-1000000:~/test/can_test# uname -a
>>> Linux mx4-v61-1000000 4.1.15-00056-ge0b8ccc-dirty #12 Mon May 9
>>> 15:59:54 CEST 2016 armv7l GNU/Linux
>>> root@mx4-v61-1000000:~/test/can_test# ./cansequence -r can1
>>> interface = can1, family = 29, type = 3, proto = 1
>>> received wrong sequence count. expected: 60, got: 61
>>> received wrong sequence count. expected: 62, got: 60
>>> received wrong sequence count. expected: 61, got: 62
>>> received wrong sequence count. expected: 118, got: 119
>>> received wrong sequence count. expected: 120, got: 118
>>> received wrong sequence count. expected: 119, got: 120
>>> received wrong sequence count. expected: 76, got: 77
>>> received wrong sequence count. expected: 78, got: 76
>>> received wrong sequence count. expected: 77, got: 78
>>>
>>> One strange thing is that the sequence errors only occur on can1, can0
>>> does not show any errors.
>
> Hello Marc,
>
> is it possible that the indirection irq -> rx-fifo -> napi can shuffle 
> the CAN frames when the can1 irq is served by different CPUs?
>
> We can probably set the processing CPU number into can_frame.__res0 
> for a test and print it in cansequence then.
>
> Regards,
> Oliver
I've read through all the patches and can't work out how the code 
guarantees in-order reception. Freescale's original recommendation for 
using the MBs this way has always been to read them all, then SORT then 
based on the hardware timestamp to get them in order. They didn't do 
this in their Linux 2.6.35 driver and it certainly received out of order.

I've read through the patches and can't work out from there how 
reception order is guaranteed, but I have noticed the following can go 
wrong:

     netdev_warn(fifo->dev, "%s: RX order cannot be guaranteed.

Is there any background on the "software fifo" anywhere, or in any 
previous posts on the list I've missed?

Tom


      parent reply	other threads:[~2016-05-13 11:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 10:52 rx-fifo: add implmentation and switch flexcan driver to use it Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 01/10] can: rx-fifo: Add support for simple irq offloading Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 02/10] can: rx-fifo: introduce software rx-fifo implementation Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 03/10] can: flexcan: calculate default value for imask1 during runtime Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 04/10] can: flexcan: make TX mailbox selectable " Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 05/10] can: flexcan: make use of rx-fifo's irq_offload_simple Marc Kleine-Budde
2016-05-20 11:31   ` Mirza Krak
2016-05-09 10:52 ` [PATCH 06/10] can: flexcan: add missing register definitions Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 07/10] can: flexcan: activate individual RX masking and initialize reg_rximr Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 08/10] can: flexcan: add quirk FLEXCAN_QUIRK_ENABLE_EACEN_RRS Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 09/10] can: flexcan: add support for rx-fifo based software FIFO implementation Marc Kleine-Budde
2016-05-09 10:52 ` [PATCH 10/10] can: flexcan: switch imx6 and vf610 to software based fifo Marc Kleine-Budde
2016-05-09 10:54 ` rx-fifo: add implmentation and switch flexcan driver to use it Marc Kleine-Budde
2016-05-10  8:27 ` Mirza Krak
2016-05-10 12:55   ` Mirza Krak
2016-05-11  9:12     ` Oliver Hartkopp
     [not found]       ` <CAJ=nTssNPDeGW+pEAHTpa+5ARQCQHfXumE=a=cr9prmjhgeJxQ@mail.gmail.com>
2016-05-11 19:07         ` Mirza Krak
2016-05-13 11:44       ` Tom Evans [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=5735BE2D.7090807@optusnet.com.au \
    --to=tom_usenet@optusnet.com.au \
    --cc=linux-can@vger.kernel.org \
    --cc=mirza.krak@hostmobility.com \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.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;
as well as URLs for NNTP newsgroup(s).