From: Harald Mommer <hmo@opensynergy.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>, linux-can@vger.kernel.org
Subject: Re: MSG_CONFIRM RX messages with SocketCAN known as unreliable under heavy load?
Date: Mon, 28 Jun 2021 15:47:41 +0200 [thread overview]
Message-ID: <c2e9eb39-bb88-2542-2b3b-bac62c1dd3d2@opensynergy.com> (raw)
In-Reply-To: <4b02188f-b3bd-4e80-5d1c-9ace05f54c1d@hartkopp.net>
Hello Oliver,
Am 24.06.21 um 20:45 schrieb Oliver Hartkopp:
>
> What is this 'device application' in the sketch below?
The device application provides the virtio CAN device. It provides a
virtio CAN device using an existing CAN device (here vcan).
>
>>> Can you sketch a quick block diagram showing guest, host, Virtio
>>> device,
>>> Virtio driver, etc...
>>
>> I hope this arrives on the list as is been sent and not garbled:
>>
>> Guest 2 | Guest3
>> ---------------- | ----------------
>> ! cangen, ! | ! cangen, !
>> ! candump, ! | ! candump, !
>> ! cansend ! | ! cansend !
>> ! using vcan0 ! | ! using can0 !
>> ---------------- | ----------------
>> ^ | ^
>> ! --------------------- | !
>> ! ! Service process ! | !
>> ! ! in user space ! | !
>> ! ! virtio-can device ! | !
>> ! ! forwarding vcan0 ! | !
>> ! --------------------- | !
>
> Hopefully not this "Service process in user space" ???
The virtio CAN device is the "Service process in user space".
>
> If so, this is a very questionable approach!
>
> To route/forward/manipulate CAN frames between CAN network interfaces
> there is a CAN gateway module 'can-gw' which can be controlled over
> PF_NETLINK.
>
> The can-gw runs super efficient and fast inside kernel space in the
> SOFTIRQ context.
>
> E.g. 22.000 CAN frames/s with 6% sys load on a 2 core i7 from 2012,
> here: https://youtu.be/O3eOjfTl1yk?t=89
>
> Just type cangw from the can-utils to get an impression of the powerful
> options.
>
> You can even calculate E2E CRCs and XOR checksums after doing content
> mods on the fly.
>
>> ! ^ ^ | !
>> ! ! ! | !
>> --------------------------------------------------
>> ! ! Device side ! kernel | Driver side ! kernel
>> v v v | v
>> ---------------- -------------- | ----------------
>> ! Device Linux ! ! HV support ! | ! Driver Linux !
>> ! VCan ! ! module ! | ! Virtio CAN !
>> ! vcan0 ! ! on device ! | ! can0 !
>> ! ! ! side ! | ! !
>> ---------------- -------------- | ----------------
>> ^ ^ | ^
>> ! ! | !
>> --------------------------------------------------
>> ! ! ! Hypervisor
>> v v v
>> --------------------------------------------------
>> ! COQOS-HV !
>> --------------------------------------------------
>>
>
> (..)
>
>> can be handled. Need the command line switch anyway now to do
>> experiments.
>
> Now with cangw ?!? ;-)
No. We cannot do this here with something which already exists like CAN
GW. We are not talking about user processes running on the same Linux
instance which want to communicate to each other. This might have been
the misunderstanding here.
We are talking about two different virtual machines both running
different OS instances under a hypervisor! And one or two VMs may not
even run Linux as the OS. The device VM could in a future setup run
under an RTOS using maybe an AUTOSAR CAN driver as backend which might
even come from a 3rd party.
In the current setup we have 2 VMs running different instances of Linux
on the same physical machine under hypervisor control. Only the left VM,
the device VM has access to any hardware (like a CAN controller). The
right VM has no direct access to any hardware at all. To be able to send
and receive frames in the right (driver) VM we have to do something to
be able to get out to the external world. Currently there exists nothing
to do this for CAN so we must do the new virtio CAN device which allows
the access to a (physical) CAN controller via Virtio means.
>
> Regards,
> Oliver
>
Regards
Harald
next prev parent reply other threads:[~2021-06-28 13:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 12:22 MSG_CONFIRM RX messages with SocketCAN known as unreliable under heavy load? Harald Mommer
2021-06-18 9:16 ` Marc Kleine-Budde
2021-06-18 18:23 ` Oliver Hartkopp
2021-06-19 21:42 ` Marc Kleine-Budde
2021-06-24 15:21 ` Harald Mommer
2021-06-24 18:45 ` Oliver Hartkopp
2021-06-28 13:47 ` Harald Mommer [this message]
2021-06-25 9:19 ` review of virtio-can (was: Re: MSG_CONFIRM RX messages with SocketCAN known as unreliable under heavy load?) Marc Kleine-Budde
2021-06-29 17:14 ` Harald Mommer
2021-07-14 7:15 ` [virtio-dev] " Michael S. Tsirkin
2021-07-15 16:04 ` Harald Mommer
2021-06-25 9:39 ` MSG_CONFIRM RX messages with SocketCAN known as unreliable under heavy load? Marc Kleine-Budde
-- strict thread matches above, loose matches on Subject: below --
2021-06-29 19:39 Harald Mommer
2021-06-30 7:27 ` 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=c2e9eb39-bb88-2542-2b3b-bac62c1dd3d2@opensynergy.com \
--to=hmo@opensynergy.com \
--cc=linux-can@vger.kernel.org \
--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