Hello,

just start reading this thread...

On 08/17/2011 10:38 AM, "Müller, René" wrote:
> Hi all,
> 
> I have an performance issue with socketcan and an MPC5200B. My setup looks 
> like this:
>  - MPC5200B board (TQM5200)
>  - custom base board with two PCA82C251, one for each can controller
>  - linux-2.6.27.18-denx, I use the mpc52xx driver
>  - booted with uboot and kernel from flash
>  - mount root filesystem via NFS
>  - can0 with 1Mbit/s
>  - candump -l can0 to tmpfs
> 
> Now I play with the busload on can0 (generated by CANalyzer and three 
> CANcaseXL). This leads to the following results:
>  - 0% to 71% busload -> no missing frames
>  - 74% busload -> 5% missing frames
>  - 77% busload -> 10% missing frames
>  - 90% busload -> 45% missing frames

What does "cat /proc/interrupts; sleep 10; cat /proc/interrupts" report
at 90& bus load.

> The missing frames are measured by comparison of the candump log file against 
> the CANalyzer log file. The indicated busload is measured by CANalyzer. The 
> cause seems to be very simple: the cpu load is too high (or the cpu is too 
> slow). When the busload is under 71%, the cpu load is under 100%. When the 
> busload goes higher than 71%, the cpu load is 100%. This seems to be the 
> cause for the missing frames.
> 
> Has anyone else ever seen such an performance issue? Does someone use the 
> MPC5200B in high busload environments? Maybe I configured something wrong in 
> my linux.

CAN can generate a very high interrupt and packet load, especially at 1
MB/s and the tasks handling the interrupt and packets in kernel and user
space may not be able to process them fast enough. Packet losses in
hardware and software are expected to happen at high bus load,
especially on load-end processors.

> What about lincan? It has an character device approach with very little 
> overhead. Is there an chance, that this will solve my problem?

Well, the overhead is just a little better but the main issues are due
the isr and task latencies. Every measure reducing that latencies will
usually help:

- increase the priority of the user-space task
- increase the priority of the net soft irq thread
- use CONFIG_PREEMPT
- or even use CONFIG_PREEMPT_RT and prioritize the hard and soft-irq
  threads properly.

Also bigger buffers may help to some extend.

Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to