Menu

How to use the command line to set NIC interrupts

  1. Log in to the real-time system of the intelligent machine, refer to the document How to log in and view the system

1.1 Set network interface card interrupt

The following operation method takes the SP7020H (SP7022) model as an example

  • View network interface card name
bash Copy
ip a
  • If you want to set an interrupt to CPU1 for enp8s0, use the command to check the interrupt number
bash Copy
watch -n1 cat /proc/interrupts

The green box in the picture is the network interface card corresponding to enp4s0 interrupt number

  • Switch to administrator permissions
bash Copy
sudo su
  • Set network interface card interrupt to CPU1
bash Copy
echo 2 > /proc/irq/163/smp_affinity
echo 2 > /proc/irq/164/smp_affinity
echo 2 > /proc/irq/165/smp_affinity
echo 2 > /proc/irq/166/smp_affinity
echo 2 > /proc/irq/167/smp_affinity
echo 2 > /proc/irq/168/smp_affinity

If you want to set the interrupt to CPU0: echo 1 > /proc/irq/interrupt number/smp_affinity

If you want to set the interrupt to CPU2: echo 4 > /proc/irq/interrupt number/smp_affinity

If you want to set the interrupt to CPU3: echo 8 > /proc/irq/interrupt number/smp_affinity

  • Check if the interrupt was set successfully
bash Copy
watch -n1 cat /proc/interrupts

If you see that the interrupt number under cpu1 keeps changing, it means that the setting is successful. For details, please check the video.

  • Switch to sinsegye user
bash Copy
su sinsegye
Last modified: 2025-09-08