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  WidthLnkCap:    Port #9, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <1us, L1 <8usLnkSta:    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 <8usLnkSta:    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 <8usLnkSta:    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 <8usLnkSta:    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 的.

 

转载于:https://www.cnblogs.com/xuanbjut/p/10932389.html

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

  1. linux查看vmware的版本,linux中查看系统版本信息的方法

    前言 测试环境:测试环境: centos7.2 64位 测试用户:root 查看系统位数(32位或64位) 方法1: [root@VM_0_13_centos ~]# uname -a Linux V ...

  2. Linux下的十个好用的命令工具:查看系统版本,显示目录的大小,查看硬盘HDD/SSD,硬盘测速,ssh时自动输入密码,查看程序的内存使用情况,查看I/O的速度,查看ssh密码错误日志,查找文件

    文章目录 1.查看系统版本 2.显示目录的大小 3.查看硬盘是HDD还是SSD 4.硬盘测速 5.在ssh的时候自动输入密码 6.查看程序的内存使用情况 7.查看I/O的速度 8.查看ssh密码错误日 ...

  3. linux怎么知道ping命令,教程方法;通过ping命令查看服务器类型(linux还是windows系列)电脑技巧-琪琪词资源网...

    琪琪词资源网-教程方法;通过ping命令查看服务器类型(linux还是windows系列)电脑技巧,以下是给大家带来的教程方法;通过ping命令查看服务器类型(linux还是windows系列),大家 ...

  4. Ubuntu查看系统版本信息的方法汇总

    cat /proc/version 推荐使用此方法获取Linux版本信息 查看显示内存中kernel相关的版本.编译等信息 Ubuntu和CentOS通用,可以显示内核版本同时显示发行版本 sun@u ...

  5. 如何在linux系统上查看BIOS版本、机器型号、序列号?查看网卡驱动版本?查看载体为实体机还物理机...

    biosdecode命令 BIOS版本  查看服务器型号: dmidecode | grep 'Product Name'  查看主板的序列号: dmidecode |grep 'Serial Num ...

  6. linux gcc 安装目录,Linux安装其他版本GCC的方法

    前言 有时候,在Linux中需要安装固定版本的GCC,才能满足工作要求.例如:在Fedora22中,编译OpenCV的cuda部分需要GCC 4.9.X及以下的版本,而Fedora22的GCC是在5. ...

  7. windows查看mysql版本(三种方法)

    方法一:在mysql的命令窗口状态下:status;回车即可 方法二:在cmd命令状态下:mysql --help    回车即可 方法三:在mysql命令状态下:select version();回 ...

  8. 查看mysql版本的六种方法

    1. [root@localhost ~]# mysql -V 2. [root@localhost ~]# mysql --help | grep Distrib 在mysql下有四种 3. 登陆时 ...

  9. linux 更改make版本,Linux下查看系统版本和make版本

    一.查看Linux内核版本命令(两种方法): 1.cat /proc/versionz [root@localhost ~]# cat /proc/version Linux version 2.6. ...

最新文章

  1. 《开源者说》08期:聊聊Java那些事儿
  2. 论文回顾:U2-Net,由U-Net组成的U-Net
  3. python基础十四之匿名函数
  4. 靶场练习第一天~vulnhub靶场之Me-and-My-Girlfriend-1
  5. #和##在宏替换中的作用
  6. 【开卷故意】JAVA正則表達式模版
  7. ESP8266文档阅读ESP8266 SDK 入门指南
  8. 电磁场仿真原理——5. 有限元法(FEM)
  9. java合并docx_java实现多个docx文档合并(基于docx4j)
  10. SolrCloud 初体验
  11. 超声波测距 c语言程序流程图,超声波模块测距51程序_单片机超声波测距c语言
  12. CC++数组练习题(头歌)朋友圈点赞
  13. 怎么用计算机打印出东西,怎样在电脑上打印东西_怎么用电脑打印东西
  14. AI算法工程师 | 02人工智能基础-Python基础(四)os模块_打开读取文件
  15. C++游戏编程教程(七)——改进飞机大战游戏
  16. 【翻译】--19C Oracle 安装指导
  17. adb 查看指定APP日志
  18. BI是报表?BI是可视化?BI到底是什么?
  19. 百趣代谢组学观察:中医药领域研究,探索复肾汤治疗慢性肾衰竭机制
  20. shell 脚本中双引号、单引号、反引号的区别,其他命令

热门文章

  1. Docker(14) docker-compose安装Grafana Loki日志聚合系统
  2. 一键加密:WPS(Wi-Fi Protected Setup,Wi-Fi保护设置)
  3. Python学习笔记:Python基础使用
  4. 关于intrins.h头文件的介绍,做流水灯时候更方便
  5. 离散数学实验报告三——真值表与主范式
  6. 如何定义visit函数_visit函数具体代码是什么啊
  7. linux pe无法识别硬盘,diskgenius识别不到硬盘是怎么回事?原因以及解决方法
  8. asp.net 浏览器下载文件的四种方式
  9. unity 摄像机镜头跟随鼠标拖拽
  10. java-net-php-python-jspm酒店自助入住系统计算机毕业设计程序