Linux查看PCIe版本及速率
Linux查看PCIe版本及速率
PCIE有四种不同的规格,通过下图来了解下PCIE的其中2种规格

查看主板上的PCI插槽
# dmidecode | grep --color "PCI"

不同PCIe版本对应的传输速率如下:

传输速率为每秒传输量GT/s,而不是每秒位数Gbps,因为传输量包括不提供额外吞吐量的开销位;
比如PCIe 1.x和PCIe 2.x使用8b/10b编码方案,导致占用了20% (= 2/10)的原始信道带宽。
GT/s —— Giga transation per second (千兆传输/秒),即每一秒内传输的次数。重点在于描述物理层通信协议的速率属性,可以不和链路宽度等关联。
Gbps —— Giga Bits Per Second (千兆位/秒)。GT/s 与Gbps 之间不存在成比例的换算关系。
PCIe 吞吐量(可用带宽)计算方法:
吞吐量 = 传输速率 * 编码方案
例如:PCI-e2.0 协议支持 5.0 GT/s,即每一条Lane上支持每秒钟内传输5G个Bit;但这并不意味着 PCIe 2.0协议的每一条Lane支持 5Gbps 的速率。
为什么这么说呢?因为PCIe 2.0 的物理层协议中使用的是8b/10b的编码方案。 即每传输8个Bit,需要发送10个Bit;这多出的2个Bit并不是对上层有意义的信息。
那么,PCIe 2.0协议的每一条Lane支持 5 * 8 / 10 = 4 Gbps = 500 MB/s 的速率。
以一个PCIe 2.0 x8的通道为例,x8的可用带宽为 4 * 8 = 32 Gbps = 4 GB/s。
PCI-e3.0 协议支持 8.0 GT/s, 即每一条Lane 上支持每秒钟内传输 8G个Bit。
而PCIe 3.0 的物理层协议中使用的是 128b/130b 的编码方案。 即每传输128个Bit,需要发送130个Bit。
那么, PCIe 3.0协议的每一条Lane支持 8 * 128 / 130 = 7.877 Gbps = 984.6 MB/s 的速率。
一个PCIe 3.0 x16的通道,x16 的可用带宽为 7.877 * 16 = 126.031 Gbps = 15.754 GB/s。
在 Linux 下要如何得知 PCI-E Bus 使用的是 Gen(Generation) 1 還是 Gen2 還是新一代的 Gen 3 雖然使用
#lspci 只要可以看到目前系統所有的裝置.但是好像看不到 PCI-E Bus 所採用的是哪一代的 PCI-E.
root@XXX# lspci
:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev )
:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller (rev )
:01.1 PCI bridge: Intel Corporation Haswell PCI Express x8 Controller (rev )
:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev )
:03.0 Audio device: Intel Corporation Haswell HD Audio Controller (rev )
:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host Controller (rev )
:16.0 Communication controller: Intel Corporation Lynx Point MEI Controller # (rev )
:1a. USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller # (rev )
:1c. PCI bridge: Intel Corporation Lynx Point PCI Express Root Port # (rev d5)
:1c. PCI bridge: Intel Corporation Lynx Point PCI Express Root Port # (rev d5)
:1c. PCI bridge: Intel Corporation Lynx Point PCI Express Root Port # (rev d5)
:1d. USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller # (rev )
:1f. ISA bridge: Intel Corporation Lynx Point LPC Controller (rev )
:1f. IDE interface: Intel Corporation Lynx Point -port SATA Controller [IDE mode] (rev )
:1f. SMBus: Intel Corporation Lynx Point SMBus Controller (rev )
:1f. Signal processing controller: Intel Corporation Lynx Point Thermal Management Controller (rev )
:00.0 PCI bridge: PLX Technology, Inc. Unknown device (rev ca)
:01.0 PCI bridge: PLX Technology, Inc. Unknown device (rev ca)
:02.0 PCI bridge: PLX Technology, Inc. Unknown device (rev ca)
:08.0 PCI bridge: PLX Technology, Inc. Unknown device (rev ca)
:09.0 PCI bridge: PLX Technology, Inc. Unknown device (rev ca)
:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev )
:00.0 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.0 PCI bridge: PLX Technology, Inc. PEX -lane, -Port PCI Express Gen (8.0 GT/s) Switch (rev ca)
:01.0 PCI bridge: PLX Technology, Inc. PEX -lane, -Port PCI Express Gen (8.0 GT/s) Switch (rev ca)
:08.0 PCI bridge: PLX Technology, Inc. PEX -lane, -Port PCI Express Gen (8.0 GT/s) Switch (rev ca)
:09.0 PCI bridge: PLX Technology, Inc. PEX -lane, -Port PCI Express Gen (8.0 GT/s) Switch (rev ca)
:0a. PCI bridge: PLX Technology, Inc. PEX -lane, -Port PCI Express Gen (8.0 GT/s) Switch (rev ca)
:00.0 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
0e:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev )
0f:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev )
root@XXX#
root@XXX# lspci -tv
-[0000:00]-+-00.0 Intel Corporation Haswell DRAM Controller
+-01.0-[0000:01-06]----00.0-[0000:02-06]--+-01.0-[0000:03]--+-00.0 Intel Corporation I350 Gigabit Network Connection
| | +-00.1 Intel Corporation I350 Gigabit Network Connection
| | +-00.2 Intel Corporation I350 Gigabit Network Connection
| | \-00.3 Intel Corporation I350 Gigabit Network Connection
| +-02.0-[0000:04]--+-00.0 Intel Corporation I350 Gigabit Network Connection
| | +-00.1 Intel Corporation I350 Gigabit Network Connection
| | +-00.2 Intel Corporation I350 Gigabit Network Connection
| | \-00.3 Intel Corporation I350 Gigabit Network Connection
| +-08.0-[0000:05]--
| \-09.0-[0000:06]--+-00.0 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
| \-00.1 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
+-01.1-[0000:07-0c]----00.0-[0000:08-0c]--+-01.0-[0000:09]--+-00.0 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
| | \-00.1 Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
| +-08.0-[0000:0a]--
| +-09.0-[0000:0b]--
| \-0a.0-[0000:0c]--
+-02.0 Intel Corporation Haswell Integrated Graphics Controller
+-03.0 Intel Corporation Haswell HD Audio Controller
+-14.0 Intel Corporation Lynx Point USB xHCI Host Controller
+-16.0 Intel Corporation Lynx Point MEI Controller #1
+-1a.0 Intel Corporation Lynx Point USB Enhanced Host Controller #2
+-1c.0-[0000:0d]--
+-1c.4-[0000:0e]----00.0 Intel Corporation I210 Gigabit Network Connection
+-1c.5-[0000:0f]----00.0 Intel Corporation I210 Gigabit Network Connection
+-1d.0 Intel Corporation Lynx Point USB Enhanced Host Controller #1
+-1f.0 Intel Corporation Lynx Point LPC Controller
+-1f.2 Intel Corporation Lynx Point 4-port SATA Controller 1 [IDE mode]
+-1f.3 Intel Corporation Lynx Point SMBus Controller
\-1f.6 Intel Corporation Lynx Point Thermal Management Controller
root@XXX#
如果有裝置是 unknown 的,需要更新 /usr/local/share/pci.ids.gz 請參考更新方式 http://benjr.tw/node/88
先查询 Inetl 82599EB 网卡的识别号(bus:device.function)
root@XXX# lspci | grep --color
:00.0 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.0 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
:00.1 Ethernet controller: Intel Corporation 82599EB -Gigabit SFI/SFP+ Network Connection (rev )
root@XXX#
在 PCI 的裝置使用三個編號用來當作識別值,個別為 1. "匯流排(bus number)", 2. "裝置(device number) 以及 3. "功能(function number)".
所以剛剛的 06:00.0 就是 bus number = 06 ,device number = 00 function = 0 .
這3個編號會組合成一個 16-bits 的識別碼,
匯流排(bus number) 8bits 2^8 至多可連接 256 個匯流排(0 to ff),
裝置(device number) 5bits 2^5 至多可接 32 種裝置(0 to 1f) 以及
功能(function number) 3bits 2^3 至多每種裝置可有 8 項功能(0 to 7).
關於更多 #lspci 的資訊請參考 http://benjr.tw/node/543
然后查看vendor id和device id
root@XXX# lspci -n | grep -i :00.0
:00.0 : :10fb (rev )
root@XXX#
Linux 使用 Class ID + Vendor ID + Device ID 來代表裝置,如剛剛的 0200: 8086:10fb 所代表裝置名稱為 (Class ID = 0200 , Vendor ID = 8086, Device ID = 10fb)
最后查看指定PCI设备的带宽
root@XXX# lspci -n -d :10fb -vvv | grep --color Width
LnkCap: Port #, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <1us, L1 <8us
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
LnkCap: Port #, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <1us, L1 <8us
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
LnkCap: Port #, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <1us, L1 <8us
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
LnkCap: Port #, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <1us, L1 <8us
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
root@XXX#
LnkSta : 目前系統所提供的速度 PCI-Express 2.0 ( 5GT/s )
LnkCap : 裝置目前所採用的速度.
LnkSta 和 LnkCap 這兩個速度有可能不一樣 , 典型情况下: 系統所提供的是 PCI Express 是 3.0 但裝置還是使用 2.0 的.
======================== End
Linux查看PCIe版本及速率的更多相关文章
- Linux查看PCIe版本及速率# lspci -vvv |grep Width -i
Linux查看PCIe版本及速率 https://www.cnblogs.com/lsgxeva/p/9542975.html# lspci -vvv |grep Width -i # lspci | ...
- 【转载】Linux查看PCIe版本及速率【方法】PCIE的X4X8X16 查看 数量 怎么看
Linux查看PCIe版本及速率 PCIE有四种不同的规格,通过下图来了解下PCIE的其中2种规格 查看主板上的PCI插槽 # dmidecode | grep --color "P ...
- linux查看内核版本、系统版本、系统位数(32or64)
linux查看内核版本.系统版本.系统位数(32or64) 2011-05-01 22:05:12 标签:linux 内核版本 休闲 系统版本 系统位数 1. 查看内核版本命令: 1) [root@ ...
- linux查看操作系统版本信息
linux查看操作系统版本信息 摘自:https://www.cnblogs.com/vaelailai/p/7545166.html 一.linux下如何查看已安装的centos版本信息: 1.L ...
- Linux查看操作系统版本的几种方式
Linux查看操作系统版本的几种方式: 1.uname -a 2.lsb_release -a 3.cat /etc/issue 4.cat /proc/version 5.cat /etc/redh ...
- Linux 查看Tomcat版本信息
Linux 查看Tomcat版本信息 如果我们想运行在 Linux 下的 Tomcat 版本信息,只需要在 Tomcat 的 bin/ 目录下,运行 version.sh 脚本即可. 1.使用如下命令 ...
- Linux 查看操作系统版本信息 uname
Linux 查看操作系统版本信息 uname uname 命令用于显示当前系统的版本信息. 带 -a 选项的 uname 命令会给出当前操作系统的所有有用信息. 命令如下: [root@node1 / ...
- Linux 查看系统版本及位数
1. 查看内核版本命令: 1) [root@www ~]# cat /proc/version Linux version 2.6.9-22.ELsmp (bhcompile@crowe.dev ...
- linux查看系统版本
RHEL7.0以下,查看系统版本的方式: [rusky@rheltest1 ~]$ cat /proc/version Linux version -.el6.x86_64 (mockbuild ...
随机推荐
- 3668: [Noi2014]起床困难综合症
3668: [Noi2014]起床困难综合症 https://www.lydsy.com/JudgeOnline/problem.php?id=3668 分析: 每一位分开考虑. 算出每一位为1,计算 ...
- libevent学习四(Working with events)
1.事件的分类 文件可写 文件可读 超时发生 信号发生 用户触发事件 2事件的生命周期 --非 persistent ...
- JS中String对象常用的方法
1. stringObject.charAt(index) 参数:index 必需,即字符在字符串中的下标. 返回值: 返回在指定位置的字符.返回的字符是长度为 1的字符串.(length属性 ...
- JMeter自学笔记3-创建自己的第一个测试用例
一.写在前面的话: 上篇我们已经认识了JMeter的图形界面,大家应该都是很懵的.那么这篇,我们将学习使用JMeter创建第一个属于自己测试用例. 二.创建自己的第一个测试用例: 1.新建一个Thre ...
- 关于java中的“error: bad operand types for binary operator ”
今天做这个题目的时候(142. O(1) Check Power of 2),遇到一个错误“ bad operand types for binary operator '&' ”. 先贴一下 ...
- java 流 文件 IO
Java 流(Stream).文件(File)和IO Java.io 包几乎包含了所有操作输入.输出需要的类.所有这些流类代表了输入源和输出目标. Java.io 包中的流支持很多种格式,比如:基本类 ...
- CsvHelper文档-1前言
CsvHelper文档-1前言 英文文档链接地址:CsvHelper Document 开源项目地址:CsvHelper 翻译于2018-1-5,原本可能会随时更新: 每一段代码都是经过我实际测试的, ...
- 水仙花数---基于python
# coding:utf-8"""水仙花数是指一个 n 位数(n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身(例如:1^3 + 5^3+ 3^3 = 153) ...
- puppet学习笔记
puppet优势:容易理解.用户较多.门槛低.简单.安装配置文件较少 puppet使用Ruby语言开发,安装puppet需要安装Ruby puppet运行环境:Redhat.Centos.Window ...
- c# 四则运算出错
不同类型值之间不可直接相减,long和short得出的差继续参与运算出错. 有待深究.