KVM 配置Linux网卡多队列

想为虚拟机配置多网卡队列,发现有报错

# ethtool -L ens3 combined 16

Cannot set device channel parameters: Invalid argument

配置的方法就是编辑虚拟机的配置文件.xml,添加 <driver name='vhost' queues='16'/>

# virsh list --all --title

# virsh edit S-Nginx2

    <interface type='bridge'>

      <mac address='52:54:00:6e:4e:e6'/>

      <source bridge='br3803'/>

      <model type='virtio'/>

      <driver name='vhost' queues='16'/> # 添加或者修改这一行

      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

    </interface>

保存配置文件之后,并不能立即生效,需要重启系统(不能是virsh reboot)

# 生效
# virsh shutdown S-Nginx2

# 验证配置文件
# virsh dumpxml S-Nginx2 | grep queues
      <driver name='vhost' queues='16'/>

# virsh start S-Nginx2

# 登录虚拟机验证
# ethtool -L ens3 combined 16
# ethtool -l ens3
Channel parameters for ens3:
Pre-set maximums:
RX:             0
TX:             0
Other:          0
Combined:       16

Current hardware settings:
RX:             0
TX:             0
Other:          0
Combined:       16

磁盘阵列卡 2025-10-21
服务器更换坏盘后的异常问题 2025-09-23

评论区