All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Alexander GQ Gerasiov <gq@cs.msu.su>,
	Nikita Edward Baruzdin <nebaruzdin@gmail.com>
Cc: linux-can@vger.kernel.org
Subject: Re: SJA1000 loopback feature
Date: Wed, 18 Jun 2014 21:51:03 +0200	[thread overview]
Message-ID: <53A1EDA7.7040504@hartkopp.net> (raw)
In-Reply-To: <20140617161347.25cb639e@snail>

Hello Alexander,

On 17.06.2014 14:13, Alexander GQ Gerasiov wrote:
> Tue, 17 Jun 2014 15:41:14 +0400
> Nikita Edward Baruzdin <nebaruzdin@gmail.com> wrote:
> 
>>
>> You see, we, for instance, don't really need hardware loopback for
>> our case. What we need is to have software loopback working. And for
>> that STM is necessary. If we enable SRR feature as well, we'll have
>> each message loopbacked twice: once by software
>> (can_{put|get}_echo_skb() functions) and once by hardware (message in
>> controller's RX buffer). Thus we'll probably have to disable the
>> software loopback per socket (CAN_RAW_LOOPBACK option) which is not
>> really convenient.
> 
> Just to clarify situation, Nikita is working on distributed system,
> where N components are working on M physical hosts (N >> M) and should
> be able to intercommunicate with each other via can bus even if M==1.
> In such case, ACKs are absent on the bus, but frames are transmited
> between several components within one host.
> 
> So we want to be able to tune CAN subsystem to ignore ACK absence.
> As we understand, SJA1000 has the mode we are looking for (but lacks
> support in driver/subsystem).

If we would find a name for it, it could be:

#define CAN_CTRLMODE_PRESUME_ACK        0x40    /* ignore missing CAN ACKs */

> 
> As LOOPBACK option for interface means that TX should be passed to RX,
> thats not exactly what we need. (As for loopback we already have it
> on the socket with CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.) I think
> we could add one more interface mode "ignore-no-ack", but we'd like to
> stay as much closer to vanilla kernel as possible and contribute our
> modifications, so we need your opinion on
> 
> Is this the common situation? Do you interested in such mode and our
> modifications? How should we realize thees modifications?
> 

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

E.g.
cangw -s vcan0 -d can0 -e
cangw -s can0 -d vcan0 -e

The cross routing can be done with netlink socket configuration (without using
the cangw tool). In any case the applications run in a stable CAN environment
on the virtual CAN interface. And when there's traffic on can0 it is forwarded
to vcan0 and vice versa.

Regards,
Oliver

  reply	other threads:[~2014-06-18 19:51 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 [this message]
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
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=53A1EDA7.7040504@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=gq@cs.msu.su \
    --cc=linux-can@vger.kernel.org \
    --cc=nebaruzdin@gmail.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.