This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4379: How to change interrupt priority for Ethernet

Part Number: AM4379

Tool/software: Linux

Hi, Everyone

I have a question about RTLinux for AM437x using AM437xSK.

My customer develop for EtherCAT Master using RTLinux.
They want to change interrupt proority.

They see 2 Ethernet interrupt using "cat /proc/interrupts"command.

==
173: 0 WUGEN 41 Level 4a100000.ethernet
174: 0 WUGEN 42 Level 4a100000.ethernet
==

and They looked for SoftIrqHandler of Ethernet using "ps –A | grep irq" command.

==
PID TTY TIME CMD
3 ? 00:00:00 ksoftirqd/0
19 ? 00:00:00 irq/20-l3-dbg-i
20 ? 00:00:00 irq/21-l3-app-i
21 ? 00:00:00 irq/36-44e07000
23 ? 00:00:00 irq/69-4804c000
24 ? 00:00:00 irq/102-4832000
25 ? 00:00:00 irq/135-4832200
30 ? 00:00:00 irq/24-49000000
31 ? 00:00:00 irq/26-49000000
54 ? 00:00:00 irq/180-4808000
68 ? 00:00:00 irq/171-mmc0
70 ? 00:00:00 irq/186-OMAP DI
72 ? 00:00:00 irq/168-44e0b00
73 ? 00:00:00 irq/219-tps6521
74 ? 00:00:00 irq/169-4802a00
75 ? 00:00:00 irq/170-mmc1
76 ? 00:00:00 irq/43-48060000
261 ? 00:00:00 irq/23-wkup_m3_
262 ? 00:00:00 irq/32-wkup_m3
300 ? 00:00:00 irq/33-rtc0
307 ? 00:00:00 irq/34-rtc0
343 ? 00:00:00 irq/179-4831000
351 ? 00:00:00 irq/184-vpfe_ca
354 ? 00:00:00 irq/181-dwc3-om
355 ? 00:00:00 irq/182-dwc3-om
361 ? 00:00:00 irq/68-edt-ft53
374 ? 00:00:00 irq/176-5310000
451 ? 00:00:00 irq/141-matrix-
453 ? 00:00:00 irq/142-matrix-
620 ? 00:00:00 irq/181-dwc3-ot
621 ? 00:00:00 irq/181-s-dwc3-
624 ? 00:00:00 irq/222-xhci-hc
733 ? 00:00:00 irq/30-44e09000
==

but We do not find Ethernet interrupt in SoftIrqHandler.
If we find, I guess we can change priority. but we do not see this interrupt.

Can you tell me how to change Ethernet interrupt priority ?

Best Regards
Hiroyasu

  • I will have to verify but the cpsw network stack processing is not necessarily triggered by an interrupt, it has its own scheduler. This might explain why the user cannot locate the pid for the thread.

    Could you explain in more detail the reason for wanting to raise the priority? The cpsw ports are the interrupts listed, is that the port needing to prioritized? On which port is the ethercat master running?

    Which kernel version is being used and is the source of the kernel a TI SDK?

  • Hi, Schuyler

    Thank you for your reply, and I'm sorry. It was late.

    My customer want to develop EtherCAT Master product.
    They use software of kernel and general Ethernet driver in RTLinux SDK.
    and evaluate on AM437xSK board.

    It is communicate with slave when Cyclic frequency is 1ms.
    but when Cyclic frequency is 0.5ms, It can not communicate with slave.

    We believe it is success by raising priority of Ethernet when 0.5ms.
    and need to know about this way.

    and My customer use RTLinux SDK Version 03.03.00.04.

    Best Regards
    Hiroyasu
  • With later releases of the SDK Linux RT Preempt kernel there are not unique threads created for Ethernet that have a priority that can be raised later. The network processing is put into a single ksoftirqd thread along with other kernel softirq threads. Raising this ksoftirqd will raise the priority of threads running in the ksoftirqd. Here is an example on how to raise the ksoftirqd thread’s priority.

     

    This is similar to the what the customer is trying:

     

    ps -A | grep ksoftirq

     

    This should return a PID number, on my board it was 3. So now the priority can be raised to a value above the kernel priority (which is 50) but below the application. This example here I am raising PID 3 to priority 51:

     

    chrt -p 51 3

     

    Use this command to make sure the priority changed.

    chrt -p 3

     

    The scheduling policy will change as well to Round Robin as part of the priority change.

     

    Please note that raising the ksoftirqd thread priority may have unintended side effects. Therefore it is recommending that the customer testing is completely redone.

  • Hi, Schuyler

    Thank you for your great support!!
    It is working when period is 0.5ms and 0.25ms!

    Best Regards
    Hiroyasu