I tried to dispatch udp packet to multi-CPU over RPS/RSS, but it seems not available.
The steps are as follow:
-
list all net rx queues:
root@nvidia-orin:/# ll /sys/class/net/eth*/queues/rx-*/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-0/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-1/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-2/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-3/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-4/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-5/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-6/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-7/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-8/rps_cpus
-rw-r–r-- 1 root root 4096 6月 23 20:47 /sys/class/net/eth0/queues/rx-9/rps_cpus -
enable mult-queue (is seems the following command runs failed):
root@nvidia-orin:/# ethtool -L eth0 rx 10
Cannot get device channel parameters: Operation not supported -
run following shell script “rps_cpus.sh” as root user:
#!/bin/bash
Enable RPS (Receive Packet Steering)
rfc=4096
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
echo “rsfe: $rsfe”
sysctl -w net.core.rps_sock_flow_entries=$rsfe
for fileRps in $(ls /sys/class/net/eth*/queues/rx-/rps_cpus)
do
echo fff > $fileRps
done
for fileRfc in $(ls /sys/class/net/eth/queues/rx-/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
tail /sys/class/net/eth/queues/rx-*/{rps_cpus,rps_flow_cnt}
- detect the network rx irq by following command:
root@nvidia-orin:/# cat /proc/interrupts | grep eth0
56: 0 0 0 0 4 0 0 0 0 0 0 0 GICv3 416 Level eth0.common_irq
57: 7353 0 0 0 0 0 0 0 0 0 0 0 GICv3 417 Level eth0.vm0
58: 0 0 0 0 0 0 0 0 0 0 0 0 GICv3 418 Level eth0.vm1
59: 0 0 0 0 0 0 0 0 0 0 0 0 GICv3 419 Level eth0.vm2
60: 7 0 0 0 0 0 0 0 0 0 0 0 GICv3 420 Level eth0.vm3
61: 0 0 0 0 0 0 0 0 0 0 0 0 GICv3 421 Level eth0.vm4
- It seems all rx irq still processed by CPU0. Is there any good idea in this case? Thanks in advance.