From: Oliver Hartkopp <socketcan@hartkopp.net>
To: "Ira W. Snyder" <iws@ovro.caltech.edu>,
Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH 0/3] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS
Date: Tue, 10 Jul 2012 21:19:17 +0200 [thread overview]
Message-ID: <4FFC8035.6040101@hartkopp.net> (raw)
In-Reply-To: <20120710152212.GA29637@ovro.caltech.edu>
Hello Wolfgang, hello Ira,
On 10.07.2012 17:22, Ira W. Snyder wrote:
> On Tue, Jul 10, 2012 at 08:59:09AM +0200, Wolfgang Grandegger wrote:
>>>> Since we are now storing packets even in the non-loopback case, there is
>>>> some extra memory overhead, to store the extra packets between the calls
>>>> to can_put_echo_skb() and can_get_echo_skb().
>>>
>>> Well, I don't like such device specific quirk going into the common
>>> interface.
>>
>> Be aware, all other drivers will suffer from that change!
>>
>
> I understand that. If you prefer, I can copy can_put_echo_skb() and
> can_get_echo_skb() with my modifications into the janz-ican3 driver
> itself, and leave the generic ones alone.
>
i also thought about probable impacts on other drivers and to me the idea to
include the changes in the ican3 driver is ok.
The general infrastucture of echo_skb[] can be re-used - but the access to
these skbs can be done ican3 specific. E.g. the BUG_ON() statements may become
obsolete then.
>>>> After this patch series is applied, the SocketCAN tst-rcv-own-msgs test
>>>> passes.
>>>>
>>>> Performance is rougly 15% less than using the previously posted patch:
>>>> [PATCH ALTERNATE VERSION 1/1] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS
>>
>> Are the 15% only relevant if CAN_RAW_RECV_OWN_MSGS is off?
>>
>
> The performance difference happens in all cases. The ican3 hardware
> doesn't have a TX-done interrupt, but the programming guide does promise
> that the hardware loopback will not return the echo packet until it has
> been successfully transmitted onto the bus. It does appear to work
> correctly.
>
> I talked with my coworker who is more knowledgable about the CAN bus. We
> decided we like this patch as written, since we will be able to get more
> accurate timing information by sending a packet and timing how long it
> takes to receive it back using CAN_RAW_RECV_OWN_MSGS.
>
Good choice :-)
From the practical point you get into problems, when your CAN driver doesn't
support IFF_ECHO (e.g. the slcan driver or the legacy PEAK drivers) as people
call you on the phone and talk about traffic seen by candump but no traffic on
the bus %-(
I would suggest to have about 2-3 echo_skbs in flight. This allows to push the
tx side of the ican3 to it's max. throughput.
On the receiver side you just need to compare up to 3 frames then and when
>= 2 echo_skbs become free (NULL) you restart the tx queue.
Should be feasible with low effort ...
>> What about a device specific solution where you do the dropping of
>> looped back messages only if CAN_RAW_RECV_OWN_MSGS is off.
>>
>
> Isn't this option per-socket, rather than per-device?
yes.
>
> I don't have any idea how I'd implement this suggestion.
>
> Thanks,
> Ira
Regards,
Oliver
next prev parent reply other threads:[~2012-07-10 19:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 19:56 [PATCH 0/3] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS Ira W. Snyder
2012-07-09 19:56 ` [PATCH 1/3] can: make the echo stack keep packet information longer Ira W. Snyder
2012-07-09 21:09 ` Oliver Hartkopp
2012-07-09 19:56 ` [PATCH 2/3] can: add can_cmp_echo_skb() for echo skb comparison Ira W. Snyder
2012-07-09 19:56 ` [PATCH 3/3] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS Ira W. Snyder
2012-07-09 20:57 ` Oliver Hartkopp
2012-07-09 21:16 ` Ira W. Snyder
2012-07-10 6:40 ` Wolfgang Grandegger
2012-07-09 21:05 ` [PATCH 0/3] " Oliver Hartkopp
2012-07-09 21:29 ` Ira W. Snyder
2012-07-10 6:09 ` Wolfgang Grandegger
2012-07-10 6:59 ` Wolfgang Grandegger
2012-07-10 15:22 ` Ira W. Snyder
2012-07-10 19:19 ` Oliver Hartkopp [this message]
2012-07-10 20:34 ` Wolfgang Grandegger
-- strict thread matches above, loose matches on Subject: below --
2012-07-12 16:15 Ira W. Snyder
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=4FFC8035.6040101@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=iws@ovro.caltech.edu \
--cc=linux-can@vger.kernel.org \
--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 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.