linux网卡多队列和绑定cpu

1. 查看eth0网卡当前设置

ethtool -l eth0

输出:

Channel parameters for eth0:
Pre-set maximums:
RX: 0
TX: 0
Other: 1
Combined: 63
Current hardware settings:
RX: 0
TX: 0
Other: 1
Combined: 24

2. 设置网卡当前使用多队列

ethtool -L eth0 combined  N为要使能的队列数

3. 查看网卡对应的中断号

cat /proc/interrupts

4. 查看中断号对(例如24)应的cpu亲和性

cat /proc/irq/24/smp_affinity

输出:

0001
表示24号中断绑定在cpu0上了

5. 绑定中断号到某个cpu上,下面是把24号绑定到cpu1

echo 2 > /proc/irq/24/smp_affinity

6. 参考:

  1. https://www.cnblogs.com/lsgxeva/p/11124762.html
  2. https://xixiliguo.github.io/post/multi-queue/
  3. https://www.jianshu.com/p/d82d1dbfc7a2

你可能感兴趣的:(linux网卡多队列和绑定cpu)