From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Alexander GQ Gerasiov <gq@cs.msu.su>, linux-can@vger.kernel.org
Subject: Re: SJA1000 loopback feature
Date: Thu, 19 Jun 2014 19:43:15 +0200 [thread overview]
Message-ID: <53A32133.7050300@hartkopp.net> (raw)
In-Reply-To: <20140619200110.7427bdfe@snail>
On 19.06.2014 18:01, Alexander GQ Gerasiov wrote:
> Thu, 19 Jun 2014 16:55:40 +0200
> Oliver Hartkopp <socketcan@hartkopp.net> wrote:
>
>>>> Just to give an example how I dealed with such situation:
>>>>
>>>> 1. Let all applications run on a virtual CAN interface (e.g.
>>>> vcan0). 2. make a cross routing with can-gw netlink routes
>>>
>>> Yes, I was thinking about it. We strictly need the same order of
>>> events on both buses (local/virtual and remote/hardware), but in
>>> case of bridging (userspace, or even in-kernel one) race is
>>> possible. So we'd better use one bus (to rule them all =))
>>>
>>
>> You have a strict order on vcan0. And this order is then transfered
>> to the real can0. OTOH the order on can0 is forwarded to vcan0. Where
>> do you see a problem here?
> Correct me if I'm wrong, but if I'm quite sure, there will be the
> following problem:
>
> Application works on vcan and initiate transmit A on time T.
> Another (hardware) node initiate transmit B on physical bus on the same
> T.
So your hosts are absolutely synchronized (via ntp)??
>
> On vcan you will see A (on T+dt1), B (on T+dt1+dt2).
How do you get the timestamp information then?
E.g. you can configute the routing rule with '-t' option to preserve the
src_dev rx timestamp. You would see the timestamp from the real CAN tnen.
> On bus you will see B (on T+dt3), A (on T+dt3+dt4).
Hm - i wonder if you would really see a difference as the networking stack is
not real-time anyway. When sending on vcan (which has no receive queue) the rx
is performed instantly which leads to en-queue the frame into the real CAN
interface immediately.
>
> As we develop testbench environment, the order of events our software
> see (and logs) should be the same as hardware nodes see.
>
Looks interesting. Your experiences are welcome :-)
Regards,
Oliver
next prev parent reply other threads:[~2014-06-19 17:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 16:20 SJA1000 loopback feature Nikita Edward Baruzdin
2014-06-16 18:56 ` Oliver Hartkopp
2014-06-17 11:41 ` Nikita Edward Baruzdin
2014-06-17 12:13 ` Alexander GQ Gerasiov
2014-06-18 19:51 ` Oliver Hartkopp
2014-06-19 12:44 ` Alexander GQ Gerasiov
2014-06-19 14:55 ` Oliver Hartkopp
2014-06-19 16:01 ` Alexander GQ Gerasiov
2014-06-19 17:43 ` Oliver Hartkopp [this message]
2014-06-19 18:07 ` Alexander GQ Gerasiov
2014-06-19 20:32 ` vcan to can0 bridging Kurt Van Dijck
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=53A32133.7050300@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=gq@cs.msu.su \
--cc=linux-can@vger.kernel.org \
/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.