@
FabricPath tx 看起来好一些。txq0-txq3 都有,txq4-txq7 没有。
root@OpenWrt:~# ethtool -S eth0 |grep txq
txq_0_desc_enqueue: 20993833
txq_0_desc_enqueue_to_ddr: 0
txq_0_buff_euqueue_to_ddr: 20993833
txq_0_desc_hardware_forwarded: 0
txq_0_packets_dequeued: 20989169
txq_0_queue_full_drops: 0
txq_0_packets_early_drops: 0
txq_0_packets_bm_drops: 0
txq_0_packets_rep_bm_drops: 0
txq_1_desc_enqueue: 4127091
txq_1_desc_enqueue_to_ddr: 0
txq_1_buff_euqueue_to_ddr: 4127091
txq_1_desc_hardware_forwarded: 0
txq_1_packets_dequeued: 4127023
txq_1_queue_full_drops: 0
txq_1_packets_early_drops: 0
txq_1_packets_bm_drops: 0
txq_1_packets_rep_bm_drops: 0
txq_2_desc_enqueue: 3610058
txq_2_desc_enqueue_to_ddr: 0
txq_2_buff_euqueue_to_ddr: 3610058
txq_2_desc_hardware_forwarded: 0
txq_2_packets_dequeued: 3609977
txq_2_queue_full_drops: 0
txq_2_packets_early_drops: 0
txq_2_packets_bm_drops: 0
txq_2_packets_rep_bm_drops: 0
txq_3_desc_enqueue: 1103662
txq_3_desc_enqueue_to_ddr: 0
txq_3_buff_euqueue_to_ddr: 1103662
txq_3_desc_hardware_forwarded: 0
txq_3_packets_dequeued: 1103615
txq_3_queue_full_drops: 0
txq_3_packets_early_drops: 0
txq_3_packets_bm_drops: 0
txq_3_packets_rep_bm_drops: 0
txq_4_desc_enqueue: 0
txq_4_desc_enqueue_to_ddr: 0
txq_4_buff_euqueue_to_ddr: 0
txq_4_desc_hardware_forwarded: 0
txq_4_packets_dequeued: 0
txq_4_queue_full_drops: 0
txq_4_packets_early_drops: 0
txq_4_packets_bm_drops: 0
txq_4_packets_rep_bm_drops: 0
txq_5_desc_enqueue: 0
txq_5_desc_enqueue_to_ddr: 0
txq_5_buff_euqueue_to_ddr: 0
txq_5_desc_hardware_forwarded: 0
txq_5_packets_dequeued: 0
txq_5_queue_full_drops: 0
txq_5_packets_early_drops: 0
txq_5_packets_bm_drops: 0
txq_5_packets_rep_bm_drops: 0
txq_6_desc_enqueue: 0
txq_6_desc_enqueue_to_ddr: 0
txq_6_buff_euqueue_to_ddr: 0
txq_6_desc_hardware_forwarded: 0
txq_6_packets_dequeued: 0
txq_6_queue_full_drops: 0
txq_6_packets_early_drops: 0
txq_6_packets_bm_drops: 0
txq_6_packets_rep_bm_drops: 0
txq_7_desc_enqueue: 0
txq_7_desc_enqueue_to_ddr: 0
txq_7_buff_euqueue_to_ddr: 0
txq_7_desc_hardware_forwarded: 0
txq_7_packets_dequeued: 0
txq_7_queue_full_drops: 0
txq_7_packets_early_drops: 0
txq_7_packets_bm_drops: 0
txq_7_packets_rep_bm_drops: 0
receive-hashing 也有,但默认关闭了。
root@OpenWrt:~# ethtool -k eth0 |grep hash
receive-hashing: off
开启之后,rx 可以均匀分布了,但是还是全部在一个 cpu 上,能跑到 900 多。
root@OpenWrt:~# ethtool -S eth0 |grep rxq
rxq_0_desc_enqueue: 26346082
rxq_0_queue_full_drops: 95608
rxq_0_packets_early_drops: 0
rxq_0_packets_bm_drops: 0
rxq_1_desc_enqueue: 2242533
rxq_1_queue_full_drops: 2057
rxq_1_packets_early_drops: 0
rxq_1_packets_bm_drops: 0
rxq_2_desc_enqueue: 2389831
rxq_2_queue_full_drops: 1742
rxq_2_packets_early_drops: 0
rxq_2_packets_bm_drops: 0
rxq_3_desc_enqueue: 4022202
rxq_3_queue_full_drops: 50
rxq_3_packets_early_drops: 0
rxq_3_packets_bm_drops: 0
如果在此基础上,使用下列命令,最好的情况(恰好 loading 被均匀分布)可以跑到 2100+。此时 cpu 1 和 cpu2 被吃满了。
for rxq in /sys/class/net/eth[01]/queues/rx*; do echo 6 > $rxq/rps_cpus; done
03:06:23 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
03:06:25 all 0.00 0.00 0.25 0.00 0.00 56.00 0.00 0.00 0.00 43.75
03:06:25 0 0.00 0.00 0.50 0.00 0.00 17.00 0.00 0.00 0.00 82.50
03:06:25 1 0.00 0.00 0.00 0.00 0.00 100.00 0.00 0.00 0.00 0.00
03:06:25 2 0.00 0.00 0.00 0.00 0.00 100.00 0.00 0.00 0.00 0.00
03:06:25 3 0.00 0.00 0.50 0.00 0.00 7.00 0.00 0.00 0.00 92.50
https://www.speedtest.net/result/c/d143eb75-99a3-4625-900e-3c77cb9172e9我想把 rps 分布到 cpu1 ,cpu2 ,cpu3 ,这样可能还可以提一提. 不知道为什么 echo 14 会出错。echo 8 可以
root@OpenWrt:~# for rxq in /sys/class/net/eth[01]/queues/rx*; do echo 14 > $rxq/rps_cpus; done
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type
ash: write error: Value too large for data type