qemu can packet lost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Just in case some one has similar problem. Current QEMU with CAN support
is not totally realistic when it comes to sending frames. When the QEMU
is attached to a vcan, then it sends out the CAN frames as fast as it
could. Another QEMU attached to the same vcan tends to drop frames
during reception.

One of the ways to fix it is to send packets from QEMU with proper
packet rate. For example the hw/net/can/can_sja1000.c could delay the TX
complete interrupt based on the configured CAN bit timing and CAN frame
length.

In case some one has time to do it:

This function can be used to calculate the frame length:

  https://github.com/linux-can/can-utils/blob/master/canframelen.c#L239

I think CFL_WORSTCASE is good enough :)

and this example shows how to properly delay and interrupt call in QEMU:

  https://github.com/qemu/qemu/blob/master/hw/net/e1000.c#L270

regards,
Oleksij & Marc

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux