如何在 linux/Qemu/KVM 中设置 Rx Queue = N?

如何在 linux/Qemu/KVM 中设置 Rx Queue = N?

我已经在我的 CentOS VM 盒(在 KVM 上运行)上配置了 8 个多队列。

<interface type='direct' trustGuestRxFilters='yes'>
  <source dev='ens113f0' mode='passthrough'/>
  <model type='virtio'/>
  <driver name='vhost' queues='8'/>
</interface>

我发现使用 ethtool 在 VM 上创建了 8 个队列。

[centos@vm ~]$ ethtool -l eth1
Channel parameters for eth1:
Pre-set maximums:
RX:     0
TX:     0
Other:      0
Combined:   8
Current hardware settings:
RX:     0
TX:     0
Other:      0
Combined:   4

现在,我想为我的 DPDK 应用程序限制 1 个 RX 队列和 2 个 TX 队列。我尝试使用 ethtool 设置相同的内容,但它抛出了以下错误:

[centos@vm ~]$ sudo ethtool -L eth1 rx 1 tx 2
Cannot set device channel parameters: Invalid argument

我可以设置组合队列 = 2,但不能设置特定的 RX / TX 队列。

[centos@vm ~]$ sudo ethtool -L eth1 combined 2
[centos@vm ~]$ ethtool -l eth1
Channel parameters for eth1:
Pre-set maximums:
RX:     0
TX:     0
Other:      0
Combined:   8
Current hardware settings:
RX:     0
TX:     0
Other:      0
Combined:   2

有什么理由/理由吗?

还有其他方法可以在 Linux 中设置 RX 队列和 TX 队列吗?

有什么方法可以在 libvirt XML / Qemu 命令中指定 RX 和 TX 队列大小吗?我在发布此问题之前搜索过,但什么也没找到。

谢谢。

相关内容