某些版本的 ixgbe 驱动程序包含在 linux 内核中(自 2013 年以来,3.9 内核,ixgbe 的“3.11.33-k”版本)即使没有 RSS 模块选项也可以在运行时更改 RSS(队列)计数。有更改网卡参数的ethtool
工具,有更改频道的选项:
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.
用 或测试 ixgbe eth1 的当前频道(RSS、队列)计数ethtool -l eth1
并用ethtool -L eth1 combined 4
或改变ethtool -L eth1 rx 2 tx 2
。
实施于net/ethernet/intel/ixgbe/ixgbe_ethtool.c
:http :
//elixir.free-electrons.com/linux/v4.12/source/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c#L3442 static const struct ethtool_ops ixgbe_ethtool_ops = { ... .get_channels = ixgbe_get_channels,.set_channels = ixgbe_set_channels,... }
ixgbe_get_channels
:http ://elixir.free-electrons.com/linux/v4.12/source/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c#L3127
ixgbe_set_channels
改变adapter->ring_feature[RING_F_RSS].limit
:http ://elixir.free-electrons.com/linux/v4.12/source/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c#L3164
自 3.9 版 Linux 内核(2013 年左右)开始实施: * http://elixir.free-electrons.com/linux/v3.9/ident/ixgbe_get_channels
* https://patchwork.ozlabs.org/patch/211119/ “ [RFC,v2,09/10] ixgbe: 添加对显示 Tx/Rx 通道数量的支持" * https://patchwork.ozlabs.org/patch/211120/ "[RFC,v2,10/10] ixgbe:添加对 set_channels ethtool 操作 diffmbox 的支持"