Use the correct flag MSG_CONFIRM to detect frames generated on this
socket.
Fixes: c35ed80b3d ("canfdtest: use struct msghdr::msg_flags to detect own frames")
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
canfdtest.c was effectively raising the received signal again to run
the default signal handler. This has been declined by the maintainer
because it's over-engineering. This commit replaces it with the
method proposed by the maintainer.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Added the '-b' command line option, to be used in conjunction with the '-d'
option that enables CAN FD, to set the BRS bit in a CAN FD frame. When
enabled, the data part of the CAN FD frame is transmitted at a higher speed.
All remaining parts of the CAN FD frame use the classic CAN speed.
Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
Add the '-d' command line option that allow to transmit CAN FD frames instead
of CAN 2.0 frames. The frames content is the same.
This allows to stress test the flexible data rate part of a CAN FD network.
Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
check_frame has a return value. Make use of this in can_echo_dut which
then is evaluated and returned thereof in main()
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
This avoids having the padding in the struct can_fame contain bogus
values, which are interpreted by "candump -x" as CAN-FD BRS and ESI
values.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This way all licenses in the project will be homogenised.
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Sven Schmitt <sven.schmitt@gmx.net>
Acked-by: Oleksij Rempel <ore@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Brennan Ashton <bashton@brennanashton.com>
Acked-By: IOhannes m zmölnig <zmoelnig@iem.at>
Acked-by: Frank Theile <ftheile@grundfos.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Jeremiah Mahler <jmmahler@gmail.com>
Acked-by: Jonathan Challinger <mr.challinger@gmail.com>
Acked-by: Cheng-Lung Lee <chenglung@gmail.com>
Acked-by: Ramesh Shanmugasundaram <rashanmu@gmail.com>
Acked-by: Mans Rullgard <mans@mansr.com>
Acked-by: Søren Holm <sgh@sgh.dk>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
In some cases we can get local TX echo after remote response
for same TXed message was already received.
For applications which relay on proper order of TXed and RXed
message this will be fatal.
With this patch the package generating side will test if TX and RX are
properly ordered.
Currently with following commands, this issue can be easily
reproducible:
canfdtest -g can0 &
while(true); do chrt 40 dd if=/dev/zero of=/dev/null count=10000; done
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Scripts can be configured to handle different SIGnals and
return codes in different ways. In this case it is better
to forward received signal, instead of converting it to return 0.
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
This patch fixes this bug
https://github.com/linux-can/can-utils/issues/13
Modified the existing millisleep function to use clock_nanosleep with
MONOTONIC clock and relative timeout.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
After a few complaint about 100% CPU usage of canfdtest over our PCI
-like boards, I have had a look to the source file, and think I have
found the issue in can_echo_dut().
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
replaced strcpy(if_name, argv[x]) + ioctl by if_idx = if_nametoindex(argv[x])
to avoid overflows caused by long user input.
Signed-off-by: Sven Schmitt <sven.schmitt@gmx.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch is a pepped up version of Valdislav's canecho_gen and
canecho_dut test programs, which have prooved to be useful for
detecting out-of-order message transmisson and reception. Here
is a list of the changes and improvements:
- Both programs have been merged into on test program named
canfdtest. Message generation can be selected via the command
line option '-g'.
- The test loop count can be specified.
- A low and high verbosity level has been added.
- send/recv is used instead of write/read.
- The return code of send/recv is checked properly.
- Use Linux coding style.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>