NVIDIA MLNX OFED的以太网接口
以太接口
端口类型管理/VPI 卡配置
ConnectX-4 及以上适配卡的端口可单独配置为 InfiniBand 或以太网端口。默认情况下,两个 VPI 端口都初始化为 InfiniBand 端口。如果您希望更改端口类型,请在加载驱动程序后使用 mlxconfig 脚本。有关如何设置端口类型的更多信息,请参阅 MFT 用户手册(nvidia.com/en-us/networking/ → 产品 → 软件 → InfiniBand/VPI 软件 → MFT—固件工具)
计数器
计数器用于提供有关操作系统、应用程序、服务或驱动程序执行情况的信息。计数器数据有助于确定系统瓶颈并微调系统和应用程序性能。操作系统、网络和设备提供应用程序可以使用的计数器数据,以便为用户提供系统执行情况的图形视图。计数器索引是在 QP 上下文中给出的队列对 (QP) 属性。多个 QP 可能与同一个计数器集相关联。如果多个 QP 共享同一个计数器,则计数器值将代表累计总数。
RoCE 计数器
- RoCE 计数器只能通过位于以下位置的 sysfs 获得:
- # /sys/class/infiniband/<device>/ports/*/counters/
- # /sys/class/infiniband/<device>/ports/*/hw_counters/
有关 mlx5 端口和 RoCE 计数器,请参阅了解 mlx5 Linux 计数器社区帖子。
SR-IOV 计数器
物理功能还可以通过位于 # /sys/class/net/<interface_name>/device/sriov/<index>/stats/ 下的 sysfs 读取虚拟功能的端口计数器
ethtool 计数器
ethtool 计数器在不同的位置进行计数,并根据它们进行分组。每个计数器组也可以有不同的计数器类型。
有关支持的 ethtool 计数器的完整列表,请参阅了解 mlx5 ethtool 计数器 社区帖子。
持久命名
为避免在启动或驱动程序重新启动后重命名网络接口,请创建一个文件名“/etc/udev/rules.d/85-net-persistent-names.rules”,其中包含设置显式接口名称的规则(数字 85,必须是超过 83 个)。
- 以太网接口示例:
#PCI device 15b3:1019 (mlx5_core) #NAME:="some name" , := is used to make sure that device name will be persistent. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:02:c9:fa:c3:50", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME:="eth1" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:02:c9:fa:c3:51", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME:="eth2"
- IPoIB 接口示例:
1. ATTR{type}=="32" is IPoIB interfaces #2. Find address value for each IB interfaces: #cat /sys/class/net/ib0/address | head -1 | cut -d":" -f"13-" #24:8a:07:03:00:a5:29:38 #Use above output to place into ATTR{address}. #Address match must start with ?* and only reference the last 8 bytes of the address SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*24:8a:07:03:00:a5:29:38", NAME:="ib0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*24:8a:07:03:00:a5:29:39", NAME:="ib1"
中断请求 (IRQ) 命名
一旦驱动程序分配了 IRQ,它们就被命名为mlx5_comp<x>@pci:<pci_addr>
. 与正在使用的通道对应的 IRQ 被重命名为<interface>-<x>
,而其余的保持默认名称。mlx5_core 驱动程序在加载期间分配所有 IRQ 以支持最大可能的通道数。一旦驱动程序启动,就不会释放或分配更多的 IRQ。更改工作通道的数量不会重新分配或释放 IRQ。
以下示例演示了减少通道数量如何影响 IRQ 名称。
$ ethtool -l ens1 Channel parameters for ens1: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 12 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 12 $ cat /proc/interrupts 98: 0 0 0 0 0 0 7935 0 0 0 0 0 IR-PCI-MSI-edge mlx5_async@pci:0000:81:00.0 99: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-0 100: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-1 101: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-2 102: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-3 103: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-4 104: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-5 105: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-6 106: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-7 107: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-8 108: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-9 109: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-10 110: 0 0 0 0 0 0 1 0 0 0 0 0 IR-PCI-MSI-edge ens1-11 $ ethtool -L ens1 combined 4 $ ethtool -l ens1 Channel parameters for ens1: … Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 4 $ cat /proc/interrupts 98: 0 0 0 0 0 0 8455 0 0 0 0 0 IR-PCI-MSI-edge mlx5_async@pci:0000:81:00.0 99: 0 0 0 0 0 0 1 2 0 0 0 0 IR-PCI-MSI-edge ens1-0 100: 0 0 0 0 0 0 1 0 2 0 0 0 IR-PCI-MSI-edge ens1-1 101: 0 0 0 0 0 0 1 0 0 2 0 0 IR-PCI-MSI-edge ens1-2 102: 0 0 0 0 0 0 1 0 0 0 2 0 IR-PCI-MSI-edge ens1-3 103: 0 0 0 0 0 0 1 0 0 0 0 1 IR-PCI-MSI-edge mlx5_comp4@pci:0000:81:00.0 104: 0 0 0 0 0 0 2 0 0 0 0 0 IR-PCI-MSI-edge mlx5_comp5@pci:0000:81:00.0 105: 0 0 0 0 0 0 1 1 0 0 0 0 IR-PCI-MSI-edge mlx5_comp6@pci:0000:81:00.0 106: 0 0 0 0 0 0 1 0 1 0 0 0 IR-PCI-MSI-edge mlx5_comp7@pci:0000:81:00.0 107: 0 0 0 0 0 0 1 0 0 1 0 0 IR-PCI-MSI-edge mlx5_comp8@pci:0000:81:00.0 108: 0 0 0 0 0 0 1 0 0 0 1 0 IR-PCI-MSI-edge mlx5_comp9@pci:0000:81:00.0 109: 0 0 0 0 0 0 1 0 0 0 0 1 IR-PCI-MSI-edge mlx5_comp10@pci:0000:81:00.0 110: 0 0 0 0 0 0 2 0 0 0 0 0 IR-PCI-MSI-edge mlx5_comp11@pci:0000:81:00.0
