[翻译自Mellanox官网]从最大性能角度来理解PCIE的配置.

Understanding PCIe Configuration for Maximum Performance
原文:
https://community.mellanox.com/docs/DOC-2496

从最大性能角度来理解PCIE的配置.

我们为什么使用PCIE?

PCIE可以用在任何系统中,用于不同modules之间的通信.
网络适配器需要与CPU和内存进行通信.
这意味着,为了处理网络流量,通过PCIe通信的不同设备应该被配置.
当连接到PCIe口的网络适配器时,PCIE支持自动协商网络适配器和CPU之间的最大能力.

PCIe Attributes

译者注:如下的4个指标是PCIE口的参数,不是HCA卡的参数.


1.PCIe Width ----类似于高速公路车道的个数?
PCIe width determines the number of PCIe lanes that can be used in parallel by the device for communication.
The width is marked as xA, where A is the number of lanes (e.g. x8 for 8 lanes). Mellanox adapters support x8 and x16 configurations, depending on their type.
# lspci -s 04:00.0 -vvv | grep Width
             LnkCap: Port #0, Speed 8GT/s, Width x8, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited
             LnkSta: Speed 8GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

注意上面两行的不同含义: 

the device capabilities (under LnkCap)

 their current status (under LnkSta


2.PCIe Speed ----类似于高速公路每条车道的通行能力?
Determines the number of PCIe transactions possible
The speed is measured in GT/s which stands for "billion transactions per second". 

Together with the PCIe width, the maximal PCIe bandwidth is determined (speed * width).

# lspci -s 04:00.0 -vvv | grep Speed
             LnkCap: Port #0, Speed 8GT/s, Width x8, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited
             LnkSta: Speed 8GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

PCIe speeds are identified as "generations", 

where 2.5GT/s is referred as "gen1", 5GT/s as "gen2", and 8GT/s as "gen3".
Most Mellanox products support all generations. 
You can view the PCIe generation by using the command lspci as well:

# lspci -s 04:00.0 -vvv | grep PCIeGen
                        [V0] Vendor specific: PCIeGen3 x8


3.PCIe Max Payload(有效载荷)Size -----类似以太网卡的MTU?


The PCIe Max Payload Size determines the maximal size of a PCIe packet, 
or PCIe MTU (similar to networking protocols)
This means that larger PCIe transactions are broken into PCIe MTU sized packets. 
This parameter is set only by the system and depends on the chipset architecture (e.g. x86_64, Power8, ARM, etc). 
You can view the PCIe Max Payload Size by using the command lspci (specified under DevCtl).
lspci -s 04:00.0 -vvv | grep DevCtl: -C 2
                DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
                        ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+ Unsupported-
                        RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ FLReset-
                        MaxPayload 256 bytes, MaxReadReq 4096 bytes

4.PCIe Max Read Request
PCIe Max Read Request determines the maximal PCIe read request allowed.
A PCIe device usually keeps track of the number of pending read requests due to having to prepare buffers for an incoming response.
The size of the PCIe max read request may affect the number of pending requests (when using data fetch larger than the PCIe MTU). 
Again, use the command lspci in order to query for the Max Read Request value:


计算PCIE的限制值.

The maximum possible PCIe bandwidth is calculated by multiplying the PCIe width and speed.
From that number we reduce ~1Gb/s for error correction protocols and the PCIe headers overhead. The overhead is determined by both the PCIe encoding (see PCIe speed for details), and the PCIe MTU:
Maximum PCIe Bandwidth = SPEED * WIDTH * (1 - ENCODING) - 1Gb/s.
For example, a gen 3 PCIe device with x8 width will be limited to:
Maximum PCIe Bandwidth = 8G * 8 * (1 - 2/130) - 1G = 64G * 0.985 - 1G = ~62Gb/s.
Another example - a gen 2 PCIe device with x16 width will be limited to:
Maximum PCIe Bandwidth = 5G * 16 * (1 - 1/5) - 1G = 80G * 0.8 - 1G = ~63Gb/s.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
配置 Mellanox 交换机需要通过命令行界面 (CLI) 访问设备。以下是一些常见的 Mellanox 交换机配置命令示例: 1. 连接到 Mellanox 交换机: ``` ssh admin@<交换机IP地址> ``` 替换 `<交换机IP地址>` 为您的 Mellanox 交换机的实际 IP 地址。输入管理员用户名和密码以连接到设备。 2. 配置管理接口 IP 地址: ``` configure interface management 1/1 ip address <IP地址>/<子网掩码> exit ``` 将 `<IP地址>` 和 `<子网掩码>` 替换为您要为管理接口配置的实际 IP 地址和子网掩码。 3. 创建 VLAN: ``` configure vlan create <VLAN ID> name <VLAN名称> interface vlan <VLAN ID> ip address <IP地址>/<子网掩码> exit ``` 将 `<VLAN ID>` 替换为您要创建的 VLAN 的实际 ID,`<VLAN名称>` 替换为 VLAN 的名称,`<IP地址>` 和 `<子网掩码>` 替换为 VLAN 接口的 IP 地址和子网掩码。 4. 配置端口: ``` configure interface ethernet 1/1 description <描述> switchport mode access switchport access vlan <VLAN ID> exit ``` 将 `ethernet 1/1` 替换为您要配置的实际端口,`<描述>` 替换为您想要为端口设置的描述,`<VLAN ID>` 替换为要将端口分配给的 VLAN ID。 5. 保存配置: ``` copy running-configuration startup-configuration ``` 此命令将当前运行的配置保存到设备的启动配置中。 请注意,以上命令只是示例,实际配置可能会因设备型号和固件版本而有所不同。请参考 Mellanox 交换机的文档以了解更多详细的配置命令和选项。在配置交换机之前,请确保您已熟悉设备文档并了解所需的配置

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值