网站运营
位置:首页>> 网站运营>> Linux查看PCIe版本及速率的方法

Linux查看PCIe版本及速率的方法

作者:lsgxeva  发布时间:2023-08-31 04:14:56 

标签:Linux,PCIe,速率

PCIE有四种不同的规格,通过下图来了解下PCIE的其中2种规格

Linux查看PCIe版本及速率的方法

 

查看主板上的PCI插槽

# dmidecode | grep --color "PCI"

Linux查看PCIe版本及速率的方法

 

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

Linux查看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 的.

来源:https://www.cnblogs.com/lsgxeva/p/9542975.html

0
投稿

猜你喜欢

  • IXWebHosting怎么样?自从我的网站上线以后就有人不断的发邮件问我这个问题,但是要简单的回复这个问题却不容易,因为不同的人有不同的需
  • 下面介绍3种类型的软文给大家,希望能够有所帮助:第一篇·论坛篇写软文之前,我们需要先研究媒体和目标用户,正所谓知己知彼百战不殆。论坛是互联网
  • 1、经常换网站程序。有很多新手在接触网站的时候,因为对SEO没有太深的了解,往往凭借个人喜好,经常变更网站程序。殊不知网站建成之初,蜘蛛就形
  • 很多站长都是通过Google Adsense来赚钱的,选一个好词进行优化这个时候就显的重要了,在SEO选词上可谓“失之毫厘、差之千里” ,所
  • 货源的代理分销顾名思义即有货源优势的商家通过网店将货源提供给那些无货源优势的淘宝、拍拍平台店主以及专注于本地化网络购物的零售网商。随着业务的
  • 网络赚钱一定要找准自己的方向,现在在网上赚钱的人越来越多。谈起网赚大家也不陌生了,而却越来越多的人都能接受。网络赚钱大家应该还是比较认同做网
  • 1.域名和空间域名对排名的影响是非常小,但对网站整体来说却是很重要,因为一个好的域名会给我们带来很大流量和知名度,选择的时候,以短小易记为原
  • 我们用到的比较多的可能是Limit的使用,Limit大致有以下动作,基本能覆盖全部的权限了。CMD:Change Working Direc
  • 1、简介说明在安装Procmail及Sanitizer后,系统都只能处理寄进服务器内的信件,无法处理利用邮件服务器来寄出病毒信,因此在安装P
  • centos7进行ip和端口限制1、限制指定IP访问本机编辑hosts.allow和hosts.deny两个文件,保存即生效。1.1、编辑e
  • 1、技术不值钱,只有思维模式最有价值。2、英语最起码要学好。3、多去gg百度搜索。4、网赚并不难,它只是一个工具,不要有心理障碍。5、基础性
  • 如果是使用的catalina.sh(linux)或Catalina.bat(win)启动的:修改这两个文件,加上下面这句:SET CATAL
  • 简介:谷歌最新实时沟通平台Google Wave将对我们的互联网世界带来怎样的革新?过去一周,谷歌发出第一批公测邀请函,邀请用户体验其最新款
  • 背景:---- 公司用专线连到Chinanet,并获得一段C类IP地址空间(如:16个),同时向ChinaNIC申请了公司域名yourdom
  • 小广告主现在获得了对在线广告产生巨大影响的机会。ContextWeb(一家文本广告)公司于10月17日发布了最新ADSDAQ广告交换平台。A
  • Service Unavailable是一种系统的警告提示。如果一个网站的程序占资源太多或者发生太多的错误,系统日志就会提示:“应用程序池
  • Web安全网关是Gartner在其2008年的报告中所重点提及的边界应用安全网关。其主要功能包括防病毒、URL过滤、Internet应用控制
  • 其他不再赘述,发挥二的性格,我们直奔主题。用户打开网站的整个流程中,DNS解析时第一环,当用户输入域名并敲回车后,windows系统调用DN
  • 服务器安全一直以来都是大家关注的一个热门话题,虽然服务器安全问题很棘手,不过我们也并非无计可施。我想各位朋友可从以下几个方面着手,就能够做到
  • 我认为,把搜索引擎优化中最常发生的一些问题归纳整理出来,提供给那些想在搜索结果中取得较高排名的人作为参考,是完全有必要的。我在下面列出了搜索
手机版 网站运营 asp之家 www.aspxhome.com