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:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller (rev 06)
00:01.1 PCI bridge: Intel Corporation Haswell PCI Express x8 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Haswell HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host Controller (rev 05)
00:16.0 Communication controller: Intel Corporation Lynx Point MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #2 (rev 05)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1 (rev d5)
00:1c.4 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #5 (rev d5)
00:1c.5 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #6 (rev d5)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 05)
00:1f.2 IDE interface: Intel Corporation Lynx Point 4-port SATA Controller 1 [IDE mode] (rev 05)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation Lynx Point Thermal Management Controller (rev 05)
01:00.0 PCI bridge: PLX Technology, Inc. Unknown device 8724 (rev ca)
02:01.0 PCI bridge: PLX Technology, Inc. Unknown device 8724 (rev ca)
02:02.0 PCI bridge: PLX Technology, Inc. Unknown device 8724 (rev ca)
02:08.0 PCI bridge: PLX Technology, Inc. Unknown device 8724 (rev ca)
02:09.0 PCI bridge: PLX Technology, Inc. Unknown device 8724 (rev ca)
03:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
03:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
03:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
03:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
04:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
04:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
04:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
04:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
07:00.0 PCI bridge: PLX Technology, Inc. PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch (rev ca)
08:01.0 PCI bridge: PLX Technology, Inc. PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch (rev ca)
08:08.0 PCI bridge: PLX Technology, Inc. PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch (rev ca)
08:09.0 PCI bridge: PLX Technology, Inc. PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch (rev ca)
08:0a.0 PCI bridge: PLX Technology, Inc. PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch (rev ca)
09:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
09:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
0e:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
0f:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
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 82599
06:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
09:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
09:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
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 06:00.0
06:00.0 0200: 8086:10fb (rev 01)
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 8086:10fb -vvv | grep --color  Width
LnkCap: Port #9, 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 #9, 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 #1, 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 #1, 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 的.

 

【转载】Linux查看PCIe版本及速率【方法】PCIE的X4X8X16 查看 数量 怎么看的更多相关文章

  1. Linux查看PCIe版本及速率

    Linux查看PCIe版本及速率 PCIE有四种不同的规格,通过下图来了解下PCIE的其中2种规格 查看主板上的PCI插槽 # dmidecode | grep --color "PCI&q ...

  2. Linux查看PCIe版本及速率# lspci -vvv |grep Width -i

    Linux查看PCIe版本及速率 https://www.cnblogs.com/lsgxeva/p/9542975.html# lspci -vvv |grep Width -i # lspci | ...

  3. [转载]Linux下终端字体颜色设置方法

    原文地址:Linux下终端字体颜色设置方法作者:router 网上类似的文章有很多,但是都是转来转去的,没有经过测试,按照很多文章的方法会造成你设置之后的终端在换行和删除输入字符时终端显示会乱七八糟, ...

  4. Linux命令 -- 查看系统版本的各种方法

    适用于CentOS

  5. [转载]Linux软件包及dpkg\apt等方法

    Linux软件安装 来源:https://segmentfault.com/a/1190000011200004?share_user=1030000007255638 一.安装包分类 在Linux平 ...

  6. [转载]linux下清除Squid缓存的方法记录

    在日常运维工作中,只要用到squid缓存服务,就会常常被要求清理squid缓存. 比如公司领导要求删一篇新闻,新闻是生成的静态.运维人员把服务器上静态的新闻页面删除了后,不料代理服务器上缓存还有.缓存 ...

  7. NVIDIA TX2--3--NVIDIA Jetson TX2 查看系统版本参数状态及重要指令

    NVIDIA Jetson TX2 查看系统参数状态. 当前博主的TX2更新的版本为:Jetpack 3.3, cuda 9.0.252, cudnn7.0, opencv3.3.1, TensorR ...

  8. [Linux Kernel]查看CentOS版本方法

    查看CentOS版本方法  有以下命令可以查看:   # lsb_release -a LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics- ...

  9. Linux中查看系统版本的方法

    一.Linux系统中,XShell连接进去之后,查看系统版本的方法如下: 1.查找release文件 find /etc/ -name *-release 例如: 或者 2.查看release文件 c ...

随机推荐

  1. Apache SkyWalking 告警配置指南

    Apache SkyWalking Apache SkyWalking是分布式系统的应用程序性能监视工具(Application Performance Management,APM),专为微服务.云 ...

  2. 使用 EPPlus 封装的 excel 表格导入功能 (.net core c#)

    使用 EPPlus 封装的 excel 表格导入功能 前言 最近做系统的时候有很多 excel导入 的功能,以前我前后端都做的时候是在前端解析,然后再做个批量插入的接口 我觉着这样挺好的,后端部分可以 ...

  3. Html5新增了什么

    h5新增了些什么 介绍 HTML5 是下一代的 HTML, 将成为 HTML.XHTML 以及 HTML DOM 的新标准. 起步 HTML5 是 W3C 与 WHATWG 合作的结果. 为 HTML ...

  4. 考前自救题库NABCD分析

    考前自救题库NABCD分析 项目 内容 这个作业属于哪个课程 2021春季软件工程(罗杰 任健) 这个作业的要求在哪里 团队项目-初次邂逅,需求分析 项目名称:考前自救题库(暂定) 项目简介:本产品计 ...

  5. 记一次metasploitable2内网渗透之samba服务的攻击

    80端口中对应一些web靶场,在这里不记录 111端口的利用是向rpcbind服务的UDP套接字发送60字节载荷,便可填充目标内存,搞崩主机系统.在这里也不记录 Samba服务简介 Samba是在Li ...

  6. Mysql无法通过临时密码访问

    在Linux上安装Mysql: [步骤一]:将mysql的安装文件上传到Linux的服务器. [步骤二]:安装MYSQL服务端 [步骤三]:安装MYSQL客户端 我在步骤三遇到了问题,所以直接从步骤三 ...

  7. LAMP架构上线动态网站WordPress

    第一步,一键安装LAMP架构所需要的程序 yum install -y httpd mariadb-server php php-mysql 第二步,配置httpd,修改主配置文件/etc/httpd ...

  8. 14. VUE 子组件修改父组件的值

    在 Vue 当中,父组件 -> 子组件 传值,都是通过属性的形式传递的. 子组件 修改 传递数据 直接操作父组件传递过来的值,用是可以用的,但是打开控制台后,会发现 Vue 有个警告:你不要直接 ...

  9. 敏捷史话(十五):我发明了敏捷估算扑克牌 —— James Greening

    雪鸟会议 雪鸟会议前夕,James Grenning 在 Object Mentor 与 Robert C. Martin 一同工作,彼时组织雪鸟会议的 Bob 大叔盛情邀请 James,告知他会议的 ...

  10. ServletConfig和ServletContext接口

    ServletConfig 在web.xml文件中使用一个或多个init-param元素进行配置后,Tomcat初始化Servlet时,都会将该Servlet的配置信息封装到一个ServletConf ...