Increase performance of the Ethernet

Hi,
I need to send and receive an Ethercat frame every millisecond.

In my customized operating system, RT patches have been enabled. I have a thread that sends a frame and the second thread that receives frames. The network is Ethercat so when I send the frame this is modified on the fly and I receive it instantly. Both threads are configured as SCHED_FIFO and RT priority. The first thread sends the frame and is suspended on semaphore. The semaphore will be freed from the second thread when the frame is received.

[First Thread]

  • get time start
  • send frame
  • wait semaphore
  • get time end
  • wait until to 1 millisecond

[Second Thread]

  • wait Ethercat frame
  • free semaphore

Normally I have a time (end time - start time) of about 600usec between sending and receiving (I can wait for 400usec), but sometimes I have 1.5msec frames. How can I avoid these 1.5 msec frames? Is there a way to increase the priority of the IRQ and / or interrupt thread? Do you have any advice?

Regards Davide

PS: I don’t have any applications with UI, but for now in my image there is LXDE. In addition to system ones, I have no other applications.

hi @Davide1976

Is there a reason, that you set the question to private? With private question, the community cannot provide you any feedback.

Best regards, Jaski

hi @Davide1976

Normally I have a time (end time - start time) of about 600usec between sending and receiving (I can wait for 400usec), but sometimes I have 1.5msec frames. How can I avoid these 1.5 msec frames? Is there a way to increase the priority of the IRQ and / or interrupt thread? Do you have any advice?

Are you sending always same amount of data? How often do you have 1.5ms frames?

PS: I don’t have any applications with UI, but for now in my image there is LXDE. In addition to system ones, I have no other applications.

If you don’t have any UI, you could switch also to the Console Image.

Best regards, Jaski

Jaski, you’re right I’m wrong to set it as private.

Yes, I always send about 1500 bytes. It can happen 1/2 times every 5 minutes. However the frequency is random.

Surely I will switch to a console image, but for the development I am comfortable to have the graphical interface.

Regards Davide

Hi

Thanks for this information.

I think you need to find using tracing tools like LTTng which part/process of your application is doing this delay. Further you can try to set the priority of your application to highest possible.

Best regards, Jaski

Ok, thank you very much. I try.
Regards Davide

Perfect. Let us know about your results.