Networking ixgbe:设置接收/发送队列的数量

Networking ixgbe:设置接收/发送队列的数量,networking,linux-device-driver,affinity,nic,irq,Networking,Linux Device Driver,Affinity,Nic,Irq,我想设置Intel 10G NIC使用的RX/TX队列数。让我解释一下原因: 我正在Dell R720系统上使用X520类型的Intel 10G NIC。我使用的是ixgbe版本3.6.7-k。Ubuntu 3.2.0-59中的内核 我正在计算机上24个内核中的4个上运行我的网络应用程序。目前NIC正在使用flow director,因此我有24个TX和RX队列,而大多数IRQ最终运行在运行应用程序的4个内核上 但是,我看到一些IRQ正在其他20个队列上运行(这可能是因为flow directo

我想设置Intel 10G NIC使用的RX/TX队列数。让我解释一下原因:

我正在Dell R720系统上使用X520类型的Intel 10G NIC。我使用的是ixgbe版本3.6.7-k。Ubuntu 3.2.0-59中的内核

我正在计算机上24个内核中的4个上运行我的网络应用程序。目前NIC正在使用flow director,因此我有24个TX和RX队列,而大多数IRQ最终运行在运行应用程序的4个内核上

但是,我看到一些IRQ正在其他20个队列上运行(这可能是因为flow director对大约20%的流量进行了采样,所以一些流量通过常规RSS)。现在,我不希望在其他20个内核上运行任何IRQ,因为它们正在执行一个不同的任务,而IRQ的运行会破坏这个任务

我尝试将中断的关联性仅设置为我使用的4个核心,但这对flow director不起作用。我想更好的方法是只使用4个RX/TX队列,并将它们分配给专用核心。但是我找不到在ixgbe驱动程序中设置RX/TX队列数量的方法(尽管这对于我熟悉的其他10G驱动程序来说非常简单,比如Broadcom的bnx2x)


有什么想法吗?

最新Linux内核源代码中的ixgbe版本(目前为3.19.1-k)(从3.18.0-rc1开始)不可能做到这一点

您需要从中获取最新的ixgbe驱动程序(当前为3.22.3),该驱动程序支持RSS参数。从modinfo ixgbe开始:

parm:RSS:接收端缩放描述符队列的数量,默认值0=CPU的数量(int数组)

因此,如果您有一个ixgbe NIC,并且想要4个队列,则需要在modprobe.conf(或发行版中的等效项)中添加这样一行代码:


然后,您需要为与您的NIC匹配的/proc/中断中的irq设置/proc/irq/*/smp\u亲和cpu掩码。

linux内核中包含的某些版本的ixgbe驱动程序(自2013年起,3.9内核,“3.11.33-k”版本的ixgbe)可以在运行时更改RSS(队列)计数,即使没有RSS模块选项。有更改网卡参数的选项,有更改通道的选项:

   ethtool -l|--show-channels devname

   ethtool -L|--set-channels devname [rx N] [tx N] [other N]
          [combined N]


   -l --show-channels
          Queries the specified network device for the numbers of
          channels it has.  A channel is an IRQ and the set of queues
          that can trigger that IRQ.

   -L --set-channels
          Changes the numbers of channels of the specified network
          device.

       rx N   Changes the number of channels with only receive queues.

       tx N   Changes the number of channels with only transmit queues.

       other N
              Changes the number of channels used only for other
              purposes e.g. link interrupts or SR-IOV co-ordination.

       combined N
              Changes the number of multi-purpose channels.
使用
ethtool-l eth1
测试ixgbe eth1的当前通道(RSS、队列)计数,并使用
ethtool-l eth1组合4
ethtool-l eth1 rx 2 tx 2
进行更改

net/ethernet/intel/ixgbe/ixgbe_ethtool.c
中实现: 静态常量结构ethtool_ops ixgbe_ethtool_ops={。。。 .get_channels=ixgbe_get_channels, .set_channels=ixgbe_set_channels,…}

ixgbe\u get\u频道

ixgbe\u set\u频道
更改
适配器->振铃功能[ring\u F\u RSS]。限制

自3.9版Linux内核(大约2013年)开始实施: * *[RFC,v2,09/10]ixgbe:添加显示发送/接收通道数的支持
*“[RFC,v2,10/10]ixgbe:添加对set_工具操作diffmbox的支持”

实际上这是可能的,因为3.9版本的内核(2013)和“3.11.33-k”版本的ixgbe驱动程序来自内核(不是来自e1000 sf net)
ethtool-L eth1组合4
将更改队列号(据我所知,部分重新初始化卡)。是否可以将其增加到默认硬件设置之外?目前,我的Amazon Linux实例有8个RX和8个TX。当我尝试
ethtool-L eth1 RX 10 TX 10
时,它抛出
无法设置设备通道参数:操作不受支持。是否有增加排队的解决办法?由于实例有更多的CPU核,我想通过增加队列来利用它们。
   ethtool -l|--show-channels devname

   ethtool -L|--set-channels devname [rx N] [tx N] [other N]
          [combined N]


   -l --show-channels
          Queries the specified network device for the numbers of
          channels it has.  A channel is an IRQ and the set of queues
          that can trigger that IRQ.

   -L --set-channels
          Changes the numbers of channels of the specified network
          device.

       rx N   Changes the number of channels with only receive queues.

       tx N   Changes the number of channels with only transmit queues.

       other N
              Changes the number of channels used only for other
              purposes e.g. link interrupts or SR-IOV co-ordination.

       combined N
              Changes the number of multi-purpose channels.