From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marek Vasut" <marex@denx.de>,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Deniz Eren" <deniz.eren@icloud.com>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
"Konrad Frederic" <frederic.konrad@adacore.com>,
"Jan Kiszka" <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far)
Date: Tue, 23 Jan 2018 22:42:31 +0100 [thread overview]
Message-ID: <201801232242.31243.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <6408e418-c2b5-61fe-be3d-137ba9fab113@amsat.org>
Hello Philippe,
On Monday 22 of January 2018 12:35:33 Philippe Mathieu-Daudé wrote:
> Hi Pavel,
>
> On 01/14/2018 05:14 PM, pisa@cmp.felk.cvut.cz wrote:
>
> I think your series is quite ready to get accepted, although I'm not
> sure through with tree it will goes.
>
> Most of my review comments are not blocking issues and might get
> addressed later (like having an abstract sja1000).
Great, I would be happy to reach acceptable state when development
can switch to incremental mode as time allows. I hope than even
actual state is usable from reports (at least for some usescases).
> The principal issue I'd like to discuss with Paolo/Marc-André is the
> chardev backend, they might say it's OK to accept it in this current
> state and refactor the CANBus backend later.
Do you think QOM based? I would like it to be implemented
that way but I need some assistance where to look how this
object kind should be implemented and from which base object
inherit from. But I prefer to left that for later work.
I would definitely like to use some mechanism which allows
to get rid of externally visible pointer and need to assign
it in the stub. It has been my initial idea and your review
sumbled across this hack as well. But I need suggestion what
is the preferred way for QEMU.
When Linux specific object file is linked in then some local
function needs to be called before QOM instances population.
I know how to do that GCC specific/non-portable way
static void __attribute__((constructor)) can_socketcan_setup_variant(void)
{
}
but I expect that something like
module_init()
in can_socketcan.c should be used.
Problem is that there is not module_init
type for plain function in include/qemu/module.h
MODULE_INIT_BLOCK,
MODULE_INIT_OPTS,
MODULE_INIT_QOM,
MODULE_INIT_TRACE,
MODULE_INIT_MAX
I expect that QOM object would solve that in future
but I would be happy to left it simple for now.
What is preferred solution there?
> I'd still avoid using directly the socket() syscall and use the QEMU
> socket API instead (also suggested by Daniel).
I have already switched to qemu_socket(), implementation
looks fine and I have tested that it works.
I have tested functionality and updated can-pci branch.
> I have been thinking a bit about how to test some frame operations
> (rather than the PCI devices) and the Linux vcan driver might be a good
> option (Virtual Local CAN Interface). This is also useful to test this
> series without having CAN hardware. How to use vcan might be worth his
> own paragraph in docs/can.txt.
>
> Do you think some of your tests can be added in the QEMU test suite
> (qtests)?
I have added some more infomation into docs file
+ The CAN interface of the host system has to be configured for proper
+ bitrate and set up. Configuration is not propagated from emulated
+ devices through bus to the physical host device. Example configuration
+ for 1 Mbit/s
+
+ ip link set can0 type can bitrate 1000000
+ ip link set can0 up
+
+ Virtual (host local only) can interface can be used on the host
+ side instead of physical interface
+
+ ip link add dev can0 type vcan
+
+ The CAN interface on the host side can be used to analyze CAN
+ traffic with "candump" command which is included in "can-utils".
+
+ candump can0
As for the automatic testing, iproute2 tools are required
on host and guest side (considering use of Linux)
and kernel with CAN drivers support.
Root access is required on the host side to setup CAN
interface. Some simple tool is required. It can be based
on can-utils code or our older canping code for example.
Best wishes,
Pavel
next prev parent reply other threads:[~2018-01-23 21:43 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-14 20:14 [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far) pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 1/7] CAN bus simple messages transport implementation for QEMU pisa
2018-01-19 12:38 ` Philippe Mathieu-Daudé
2018-01-19 13:28 ` Pavel Pisa
2018-01-19 17:04 ` Pavel Pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 2/7] CAN bus support to connect bust to Linux host SocketCAN interface pisa
2018-01-15 2:55 ` Philippe Mathieu-Daudé
2018-01-15 21:29 ` Pavel Pisa
2018-01-16 0:12 ` Philippe Mathieu-Daudé
2018-01-19 8:51 ` Pavel Pisa
2018-01-19 13:37 ` Philippe Mathieu-Daudé
2018-01-22 10:28 ` Stefan Hajnoczi
2018-01-19 13:37 ` Daniel P. Berrange
2018-01-19 12:57 ` Philippe Mathieu-Daudé
2018-01-19 13:01 ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 3/7] CAN bus SJA1000 chip register level emulation for QEMU pisa
2018-01-15 3:03 ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 4/7] CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added pisa
2018-01-15 3:09 ` Philippe Mathieu-Daudé
2018-03-06 15:29 ` Thomas Huth
2018-03-06 20:52 ` Pavel Pisa
2018-03-07 11:40 ` Paolo Bonzini
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 5/7] QEMU CAN bus emulation documentation pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 6/7] CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added pisa
2018-01-15 3:12 ` Philippe Mathieu-Daudé
2018-01-19 13:15 ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 7/7] CAN bus MIOe-3680 " pisa
2018-01-19 13:13 ` Philippe Mathieu-Daudé
2018-01-22 11:35 ` [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far) Philippe Mathieu-Daudé
2018-01-23 21:42 ` Pavel Pisa [this message]
2018-01-24 20:22 ` Pavel Pisa
2018-01-24 21:41 ` Philippe Mathieu-Daudé
2018-01-25 8:24 ` Pavel Pisa
2018-01-25 13:50 ` Deniz Eren
2018-01-25 13:58 ` Paolo Bonzini
2018-01-25 21:33 ` Pavel Pisa
2018-01-26 11:12 ` Paolo Bonzini
2018-01-28 9:02 ` Pavel Pisa
2018-01-29 7:43 ` Oleksij Rempel
2018-01-30 14:15 ` Paolo Bonzini
2018-01-30 22:12 ` Pavel Pisa
2018-01-31 0:13 ` Deniz Eren
2018-01-31 1:08 ` Paolo Bonzini
2018-01-31 1:10 ` Paolo Bonzini
-- strict thread matches above, loose matches on Subject: below --
2018-01-31 4:07 Deniz Eren
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=201801232242.31243.pisa@cmp.felk.cvut.cz \
--to=pisa@cmp.felk.cvut.cz \
--cc=deniz.eren@icloud.com \
--cc=f4bug@amsat.org \
--cc=frederic.konrad@adacore.com \
--cc=jan.kiszka@siemens.com \
--cc=marcandre.lureau@redhat.com \
--cc=marex@denx.de \
--cc=o.rempel@pengutronix.de \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=socketcan@hartkopp.net \
--cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).