Logo

Linux 内核

6.16.0-rc4

快速搜索

目录

  • 开发流程
  • 提交补丁
  • 行为准则
  • 维护者手册
  • 所有开发流程文档
  • 核心 API
  • 驱动 API
  • 子系统
    • 核心子系统
    • 人机交互接口
    • 网络接口
      • 网络
      • NetLabel
      • InfiniBand
      • ISDN
      • MHI
    • 存储接口
    • 其他子系统
  • 锁
  • 许可规则
  • 编写文档
  • 开发工具
  • 测试指南
  • Hacking 指南
  • 跟踪
  • 故障注入
  • Livepatching
  • Rust
  • 管理
  • 构建系统
  • 报告问题
  • 用户空间工具
  • 用户空间 API
  • 固件
  • 固件和设备树
  • CPU 架构
  • 未分类的文档
  • 翻译

本页

  • 显示源代码

ice devlink 支持¶

本文档描述了 ice 设备驱动程序实现的 devlink 功能。

参数¶

已实现的通用参数¶

名称

模式

注释

enable_roce

runtime

与 enable_iwarp 互斥

enable_iwarp

runtime

与 enable_roce 互斥

tx_scheduling_layers

permanent

ice 硬件对 Tx 使用分层调度,调度树中具有固定数量的层。每一层都是决策点。根节点代表端口,而所有叶节点代表队列。这种配置 Tx 调度器的方式允许 DCB 或 devlink-rate(如下文档所述)等功能配置分配给任何给定队列或队列组的带宽量,从而实现精细的控制,因为调度参数可以在树的任何给定层配置。

默认的 9 层树拓扑被认为是适用于大多数工作负载的最佳拓扑,因为它提供了性能与可配置性的最佳比率。但是,对于某些特定情况,可能不需要这种 9 层拓扑。一个例子是将流量发送到非 8 的倍数的队列。由于在 9 层拓扑中最大基数限制为 8,因此第 9 个队列与其余队列具有不同的父队列,并且被赋予更多的带宽信用。当系统将流量发送到 9 个队列时,这会导致问题

tx_queue_0_packets: 24163396
tx_queue_1_packets: 24164623
tx_queue_2_packets: 24163188
tx_queue_3_packets: 24163701
tx_queue_4_packets: 24163683
tx_queue_5_packets: 24164668
tx_queue_6_packets: 23327200
tx_queue_7_packets: 24163853
tx_queue_8_packets: 91101417 < 从第 9 个队列发送的流量过多

为了解决此需求,您可以切换到 5 层拓扑,这将最大拓扑基数更改为 512。通过此增强功能,性能特征是相等的,因为所有队列都可以分配给树中的同一父队列。此解决方案的明显缺点是树的配置深度较低。

使用带有 devlink 命令的 tx_scheduling_layer 参数来更改传输调度器拓扑。要使用 5 层拓扑,请使用值 5。例如:$ devlink dev param set pci/0000:16:00.0 name tx_scheduling_layers value 5 cmode permanent 使用值 9 将其设置回默认值。

您必须对 PCI 插槽进行电源循环,才能使所选拓扑生效。

要验证该值是否已设置:$ devlink dev param show pci/0000:16:00.0 name tx_scheduling_layers

msix_vec_per_pf_max

driverinit

设置 PF 可以使用的最大 MSI-X,其余的可以用于 SRIOV。范围是从 msix_vec_per_pf_min 中设置的最小值到 2k/端口数。

msix_vec_per_pf_min

driverinit

设置 PF 将使用的最小 MSI-X。此值通知将静态分配多少 MSI-X。范围是从 2 到 msix_vec_per_pf_max 中设置的值。

已实现的驱动程序特定参数¶

名称

模式

描述

local_forwarding

runtime

通过调整调度器带宽来控制环回行为。它会影响所有类型的功能:物理功能、虚拟功能和子功能。支持的值有

enabled - 允许端口上的环回流量

disabled - 不允许此端口上的环回流量

prioritized - 环回流量在此端口上具有优先级

local_forwarding 参数的默认值为 enabled。prioritized 提供了调整环回流量速率的能力,以增加一个端口的容量,从而牺牲另一个端口的容量。用户需要禁用其中一个端口上的本地转发,以便在 prioritized 端口上增加容量。

信息版本¶

ice 驱动程序报告以下版本

已实现的 devlink 信息版本¶

名称

类型

示例

描述

board.id

fixed

K65390-000

板的产品板组件 (PBA) 标识符。

cgu.id

fixed

36

时钟生成单元 (CGU) 硬件修订标识符。

fw.mgmt

running

2.1.7

设备嵌入式管理处理器上运行的管理固件的 3 位版本号。它控制 PHY、链接、对设备资源的访问等。Intel 文档将其称为 EMP 固件。

fw.mgmt.api

running

1.5.1

由管理固件通过 AdminQ 导出的 API 的 3 位版本号(major.minor.patch)。驱动程序使用它来识别支持哪些命令。内核的历史版本仅显示 2 位版本号(major.minor)。

fw.mgmt.build

running

0x305d955f

管理固件源的唯一标识符。

fw.undi

running

1.2581.0

包含 UEFI 驱动程序的 Option ROM 的版本。该版本以 major.minor.patch 格式报告。每当发生重大的中断性更改时,或者当次要版本将溢出时,主要版本就会递增。次要版本针对非中断性更改递增,并在主要版本递增时重置为 1。补丁版本通常为 0,但在针对较旧的基本 Option ROM 交付修复作为补丁时递增。

fw.psid.api

running

0.80

定义闪存内容格式的版本。

fw.bundle_id

running

0x80002ec0

加载到设备上的固件映像文件的唯一标识符。也称为 NVM 的 EETRACK 标识符。

fw.app.name

running

ICE OS 默认包

设备中处于活动状态的 DDP 包的名称。DDP 包由驱动程序在初始化期间加载。DDP 包的每个变体都有一个唯一的名称。

fw.app

running

1.3.1.0

设备中处于活动状态的 DDP 包的版本。请注意,唯一标识包需要名称(如 fw.app.name 报告)和版本。

fw.app.bundle_id

running

0xc0000001

设备中加载的 DDP 包的唯一标识符。也称为 DDP 跟踪 ID。可用于唯一标识特定的 DDP 包。

fw.netlist

running

1.1.2000-6.7.0

网表模块的版本。此模块定义了设备的以太网功能和默认设置,并由管理固件用作管理链路和设备连接的一部分。

fw.netlist.build

running

0xee16ced7

网表模块内容哈希的前 4 个字节。

fw.cgu

running

8032.16973825.6021

时钟生成单元 (CGU) 的版本。格式:<CGU 类型>.<配置版本>.<固件版本>。

闪存更新¶

ice 驱动程序使用 devlink-flash 接口实现对闪存更新的支持。它支持使用包含 fw.mgmt、fw.undi 和 fw.netlist 组件的组合闪存映像更新设备闪存。

支持的覆盖模式列表¶

位

行为

DEVLINK_FLASH_OVERWRITE_SETTINGS

不要保留存储在正在更新的闪存组件中的设置。这包括覆盖端口配置,该配置确定设备将使用多少个物理功能进行初始化。

DEVLINK_FLASH_OVERWRITE_SETTINGS 和 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS

不要保留设置或标识符。使用提供的映像中的内容覆盖闪存中的所有内容,而不执行任何保留。这包括覆盖设备识别字段,如 MAC 地址、VPD 区域和设备序列号。预计此组合将与为特定设备定制的映像一起使用。

ice 硬件不支持仅覆盖标识符同时保留设置,因此单独的 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS 将被拒绝。如果不提供覆盖掩码,固件将被指示在更新时保留所有设置和识别字段。

重新加载¶

ice 驱动程序支持使用带有 DEVLINK_RELOAD_ACTION_FW_ACTIVATE 操作的 DEVLINK_CMD_RELOAD 在闪存更新后激活新固件。

$ devlink dev reload pci/0000:01:00.0 reload action fw_activate

通过发出设备特定的嵌入式管理处理器重置来激活新固件,该重置请求设备重置并重新加载 EMP 固件映像。

该驱动程序当前不支持通过 DEVLINK_RELOAD_ACTION_DRIVER_REINIT 重新加载驱动程序。

端口拆分¶

ice 驱动程序仅支持端口 0 的端口拆分,因为 FW 具有整个设备的预定义可用端口拆分选项集。

需要系统重启才能应用端口拆分。

以下命令将选择具有 4 个端口的端口拆分选项

$ devlink port split pci/0000:16:00.0/0 count 4

在每个 split 和 unsplit 命令之后,所有可用端口选项的列表将打印到动态调试。第一个选项是默认选项。

ice 0000:16:00.0: Available port split options and max port speeds (Gbps):
ice 0000:16:00.0: Status  Split      Quad 0          Quad 1
ice 0000:16:00.0:         count  L0  L1  L2  L3  L4  L5  L6  L7
ice 0000:16:00.0: Active  2     100   -   -   - 100   -   -   -
ice 0000:16:00.0:         2      50   -  50   -   -   -   -   -
ice 0000:16:00.0: Pending 4      25  25  25  25   -   -   -   -
ice 0000:16:00.0:         4      25  25   -   -  25  25   -   -
ice 0000:16:00.0:         8      10  10  10  10  10  10  10  10
ice 0000:16:00.0:         1     100   -   -   -   -   -   -   -

可能存在多个具有相同端口拆分计数的 FW 端口选项。当再次发出相同的端口拆分计数请求时,将选择具有相同端口拆分计数的下一个 FW 端口选项。

devlink port unsplit 将选择拆分计数为 1 的选项。如果没有拆分计数为 1 的可用 FW 选项,您将收到错误。

区域¶

ice 驱动程序实现了以下区域来访问内部设备数据。

已实现的区域¶

名称

描述

nvm-flash

整个闪存芯片的内容,有时称为设备的非易失性存储器。

shadow-ram

Shadow RAM 的内容,它是从闪存的开头加载的。虽然内容主要来自闪存,但此区域还包含设备启动期间生成的数据,这些数据未存储在闪存中。

device-caps

设备固件的功能缓冲区的内容。用于确定设备的当前状态和配置。

可以在没有快照的情况下访问 nvm-flash 和 shadow-ram 区域。device-caps 区域需要快照,因为内容由固件发送,并且无法拆分为单独的读取。

用户可以通过 DEVLINK_CMD_REGION_NEW 命令请求立即捕获所有三个区域的快照。

$ devlink region show
pci/0000:01:00.0/nvm-flash: size 10485760 snapshot [] max 1
pci/0000:01:00.0/device-caps: size 4096 snapshot [] max 10

$ devlink region new pci/0000:01:00.0/nvm-flash snapshot 1
$ devlink region dump pci/0000:01:00.0/nvm-flash snapshot 1

$ devlink region dump pci/0000:01:00.0/nvm-flash snapshot 1
0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30
0000000000000010 0000 0000 ffff ff04 0029 8c00 0028 8cc8
0000000000000020 0016 0bb8 0016 1720 0000 0000 c00f 3ffc
0000000000000030 bada cce5 bada cce5 bada cce5 bada cce5

$ devlink region read pci/0000:01:00.0/nvm-flash snapshot 1 address 0 length 16
0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30

$ devlink region delete pci/0000:01:00.0/nvm-flash snapshot 1

$ devlink region new pci/0000:01:00.0/device-caps snapshot 1
$ devlink region dump pci/0000:01:00.0/device-caps snapshot 1
0000000000000000 01 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00
0000000000000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000020 02 00 02 01 32 03 00 00 0a 00 00 00 25 00 00 00
0000000000000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000040 04 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
0000000000000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000060 05 00 01 00 03 00 00 00 00 00 00 00 00 00 00 00
0000000000000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000080 06 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
0000000000000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000000a0 08 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000000c0 12 00 01 00 01 00 00 00 01 00 01 00 00 00 00 00
00000000000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000000e0 13 00 01 00 00 01 00 00 00 00 00 00 00 00 00 00
00000000000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000100 14 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
0000000000000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000120 15 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
0000000000000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000140 16 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
0000000000000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000160 17 00 01 00 06 00 00 00 00 00 00 00 00 00 00 00
0000000000000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000180 18 00 01 00 01 00 00 00 01 00 00 00 08 00 00 00
0000000000000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000001a0 22 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00
00000000000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000001c0 40 00 01 00 00 08 00 00 08 00 00 00 00 00 00 00
00000000000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000000000001e0 41 00 01 00 00 08 00 00 00 00 00 00 00 00 00 00
00000000000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000000000000200 42 00 01 00 00 08 00 00 00 00 00 00 00 00 00 00
0000000000000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

$ devlink region delete pci/0000:01:00.0/device-caps snapshot 1

Devlink 速率¶

ice 驱动程序实现了 devlink-rate API。它允许将分层 QoS 卸载到硬件。它使用户能够在树结构中对虚拟功能进行分组,并将支持的参数:tx_share、tx_max、tx_priority 和 tx_weight 分配给树中的每个节点。因此,用户可以有效地控制为每个 VF 组分配多少带宽。这稍后由 HW 执行。

假定此功能与 FW 和 ADQ 中执行的 DCB 或任何会触发 QoS 更改的驱动程序功能(例如创建新的流量类)互斥。如果用户开始使用 devlink-rate API 对节点进行任何更改,驱动程序将阻止 DCB 或 ADQ 配置。要配置这些功能,需要重新加载驱动程序。相应地,如果将配置 ADQ 或 DCB,则驱动程序将根本不会导出层次结构,或者将在层次结构导出后但在进行任何更改之前启用这些功能时删除未触及的层次结构。

此功能还依赖于系统中启用的 switchdev。这是必需的,因为 devlink-rate 需要 devlink-port 对象的存在,并且这些对象仅在 switchdev 模式下创建。

如果驱动程序设置为 switchdev 模式,它将在创建 VF 时立即导出内部层次结构。树的根始终由 node_0 表示。用户无法删除此节点。叶节点和具有子节点的节点也无法删除。

支持的属性¶

名称

描述

tx_max

树节点要消耗的最大带宽。速率限制是一个绝对数字,指定一个节点在一秒内可以消耗的最大字节数。速率限制保证链路不会过度饱和远程端的接收器,并且还强制执行订户和网络提供商之间的 SLA。

tx_share

分配给树节点的最小带宽(当它未被阻塞时)。它指定一个绝对 BW。虽然 tx_max 定义了节点可以消耗的最大带宽,但 tx_share 标记了节点的承诺 BW。

tx_priority

允许在同级之间使用严格优先级仲裁器。只要节点保持在其带宽限制内,此仲裁方案就会尝试根据其优先级调度节点。范围 0-7。优先级为 7 的节点具有最高优先级并首先被选中,而优先级为 0 的节点具有最低优先级。具有相同优先级的节点被同等对待。

tx_weight

允许在同级之间使用加权公平队列仲裁方案。此仲裁方案可以与严格优先级同时使用。范围 1-200。只有相对值对仲裁很重要。

tx_priority 和 tx_weight 可以同时使用。在这种情况下,具有相同优先级的节点形成同级组中的 WFQ 子组,并且它们之间的仲裁基于分配的权重。

# enable switchdev
$ devlink dev eswitch set pci/0000:4b:00.0 mode switchdev

# at this point driver should export internal hierarchy
$ echo 2 > /sys/class/net/ens785np0/device/sriov_numvfs

$ devlink port function rate show
pci/0000:4b:00.0/node_25: type node parent node_24
pci/0000:4b:00.0/node_24: type node parent node_0
pci/0000:4b:00.0/node_32: type node parent node_31
pci/0000:4b:00.0/node_31: type node parent node_30
pci/0000:4b:00.0/node_30: type node parent node_16
pci/0000:4b:00.0/node_19: type node parent node_18
pci/0000:4b:00.0/node_18: type node parent node_17
pci/0000:4b:00.0/node_17: type node parent node_16
pci/0000:4b:00.0/node_14: type node parent node_5
pci/0000:4b:00.0/node_5: type node parent node_3
pci/0000:4b:00.0/node_13: type node parent node_4
pci/0000:4b:00.0/node_12: type node parent node_4
pci/0000:4b:00.0/node_11: type node parent node_4
pci/0000:4b:00.0/node_10: type node parent node_4
pci/0000:4b:00.0/node_9: type node parent node_4
pci/0000:4b:00.0/node_8: type node parent node_4
pci/0000:4b:00.0/node_7: type node parent node_4
pci/0000:4b:00.0/node_6: type node parent node_4
pci/0000:4b:00.0/node_4: type node parent node_3
pci/0000:4b:00.0/node_3: type node parent node_16
pci/0000:4b:00.0/node_16: type node parent node_15
pci/0000:4b:00.0/node_15: type node parent node_0
pci/0000:4b:00.0/node_2: type node parent node_1
pci/0000:4b:00.0/node_1: type node parent node_0
pci/0000:4b:00.0/node_0: type node
pci/0000:4b:00.0/1: type leaf parent node_25
pci/0000:4b:00.0/2: type leaf parent node_25

# let's create some custom node
$ devlink port function rate add pci/0000:4b:00.0/node_custom parent node_0

# second custom node
$ devlink port function rate add pci/0000:4b:00.0/node_custom_1 parent node_custom

# reassign second VF to newly created branch
$ devlink port function rate set pci/0000:4b:00.0/2 parent node_custom_1

# assign tx_weight to the VF
$ devlink port function rate set pci/0000:4b:00.0/2 tx_weight 5

# assign tx_share to the VF
$ devlink port function rate set pci/0000:4b:00.0/2 tx_share 500Mbps
©内核开发社区。 | 由 Sphinx 5.3.0 & Alabaster 0.7.16 提供支持 | 页面来源