All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Grosjean <s.grosjean@peak-system.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: tom_usenet@optusnet.com.au,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [BULK]Re: [PATCH] can: fix loss of frames due to wrong assumption in raw_rcv
Date: Thu, 25 Jun 2015 10:32:18 +0200	[thread overview]
Message-ID: <558BBC92.6040906@peak-system.com> (raw)
In-Reply-To: <558B0B6F.6010304@hartkopp.net>

Hi everyone,

I follow this thread carefully and, with your permission, I'd like to 
speak in.

As we always help our customers in using the mainline drivers products 
line too, I just wanted to inform you that I currently have one who 
tells that he's facing some loss of frames with the PEAK-System PCAN-USB 
adapter, in case of "relatively"  high bus load... He's running two 
Kernels (3.19 and the last 4.1 patched with this recent "fix"). At the 
moment, he says he always notes some frame leakage, especially when he 
(for example) "resizes windows on his desktop"...

The curious things are:

0 - frames are lost when running his socket-can application over the 
mainline peak-usb driver
1 - frames are lost when running his socket-can application over our 
"pcan" driver (built in so-called "netdev" mode, that is, rx frames are 
forwarded to socket-can using netif_rx())
2 - *but* no frame are lost when running the "ioctl()" test applications 
above our "pcan" driver (built in so-called "chardev" mode, that is, rx 
frames are stored into internal fifos before being given to applications)
3 - in both cases #0 and #1, "can0" network stats don't show any 
rx_dropped nor rx_fifo_errors errors at all (even if sometimes, he says 
he notes some "real" rx_over_errors  raised up by the peak-usb driver).

I don't succeed to reproduce this issue with my "old" 3.16 Kernel at the 
moment. Before going on with installing the 3.19 Kernel, could the above 
"leakage" be explained by the last changes made in linux-can?

Many thanks for your help,

Regards,

Stéphane

Le 24/06/2015 21:56, Oliver Hartkopp a écrit :
> On 24.06.2015 04:13, Tom Evans wrote:
>> On 23/06/15 18:01, Oliver Hartkopp wrote:
>>> An alternative to force the timestamp to be set would be to add another
>>> 'counter' to struct can_skb_priv which is just increased by the 
>>> driver with
>>> every received CAN frame.
>>>
>>> But I wonder if its worth the effort in opposite to just enable 
>>> timestamping
>>> in every skb. What do you think?
>>
>>  From a programming standpoint, using a "timestamp" as a "unique 
>> identifier"
>> is opaque and a poor design. If the SKB requires a "unique 
>> identifier" then it
>> should be provided with something that has that description and purpose.
>
> Hey Tom,
>
>> The timestamp may be optional for a reason. Maybe some platforms 
>> simply don't
>> provide a high resolution timestamp, and/or the timestamp comes with 
>> a high
>> overhead. Can you guarantee that all current, future and past platforms
>> support a low overhead and high resolution timestamp?
>
> I have used the CAN stuff on two PowerPC, one ARM and several x86 
> platforms - always with enabled timestamping - without any problems in 
> performance.
>
>> A new "feature" probably shouldn't change something that was optional 
>> to being
>> compulsory. Would all existing CAN drivers need to be rewritten to 
>> add this
>> timestamping, or is the timestamp added in higher (and more generic) 
>> layers,
>> and in the one place?
>
> The point is that out-of-tree drivers (like the PEAK-System driver) 
> would need to set the timestamp too to take advantage of the joint 
> filter feature.
> The mainline drivers are adapted for now with the stable patch
>
> http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=36c01245eb8046c16eee6431e7dbfbb302635fa8 
>
>
> But I felt not very comfortable with this fix. The point is that I 
> have to take care that the processing of an incoming skb in 
> can_receive() in af_can.c is done in 'one step' with an unique skb. So 
> marking the skb for the joint filter feature in raw_rcv() can probably 
> be done in can_receive().
>
> I'm looking for a SMP save solution for this - to finally revert the 
> fix above. So thanks for the 'wake-up call' by naming the timestamping 
> solution  a 'poor design'  ;-)
>
> Best regards,
> Oliver
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183 
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--

  reply	other threads:[~2015-06-25  8:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 17:21 [PATCH] can: fix loss of frames due to wrong assumption in raw_rcv Manfred Schlaegl
2015-06-20 22:42 ` Oliver Hartkopp
2015-06-20 22:42   ` Oliver Hartkopp
2015-06-22  9:48   ` Manfred Schlaegl
2015-06-22  9:48     ` Manfred Schlaegl
2015-06-22 10:24     ` Oliver Hartkopp
2015-06-22 10:24       ` Oliver Hartkopp
     [not found]       ` <5588E6FB.5040903@optusnet.com.au>
2015-06-23  8:01         ` Oliver Hartkopp
2015-06-24  2:13           ` Tom Evans
2015-06-24 19:56             ` Oliver Hartkopp
2015-06-25  8:32               ` Stephane Grosjean [this message]
2015-06-25  9:36                 ` [BULK]Re: " Oliver Hartkopp
2015-06-29 16:13                   ` Oliver Hartkopp
2015-07-04 16:54                     ` Oliver Hartkopp
2015-07-05  1:18                       ` Tom Evans
2015-07-05 18:21                         ` Oliver Hartkopp
2015-07-06  5:44                           ` Oliver Hartkopp
2015-07-06  6:50                             ` Tom Evans
2015-07-06 17:09                               ` Oliver Hartkopp
2015-07-06  7:58                       ` [BULK]Re: " Stephane Grosjean
2015-07-06 17:14                         ` Oliver Hartkopp

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=558BBC92.6040906@peak-system.com \
    --to=s.grosjean@peak-system.com \
    --cc=linux-can@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=tom_usenet@optusnet.com.au \
    /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.