打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux系统之lspci命令介绍

          lspci,顾名思义,就是显示所有的pci设备信息。pci是一种总线,而通过pci总线连接的设备就是pci设备了。如今,我们常用的设备很多都是采用pci总线了,如:网卡、存储

等。下面就简单介绍下该命令。

        lspci:显示所有的pci设备信息。包括设备的BDF,设备类型,厂商信息等。 


  lspci -t [BDF]:显示指定BDF号的设备信息。 


  lspci -m/-mm:以一种机器可读的格式来显示pci设备信息。下面的实例可以看出其具体的区别。


  1. # lspci -s ff:13.1  
  2.   
  3. ff:13.1 System peripheral: Intel Corporation Broadwell Memory Controller 0 - Target Address/Thermal/RAS (rev 03)  
  4.   
  5. # lspci -mm -s ff:13.1  
  6.   
  7. ff:13.1 "System peripheral" "Intel Corporation" "Broadwell Memory Controller 0 - Target Address/Thermal/RAS" -r03 "Intel Corporation" "Broadwell Memory Controller 0 - Target Address/Thermal/RAS"  


lspci -t:以树的形式显示pci设备信息。

lspci -v/-vv/-vvv:显示详细的pci设备信息,v越多,越详细,当然,上限3个。


  1. # lspci -s ff:1f.2  
  2. ff:1f.2 System peripheral: Intel Corporation Broadwell Power Control Unit (rev 03)  
  3.   
  4. # lspci -v -s ff:1f.2  
  5. ff:1f.2 System peripheral: Intel Corporation Broadwell Power Control Unit (rev 03)  Flags: fast devsel  
  6.   
  7. # lspci -vv -s ff:1f.2  
  8.   
  9. ff:1f.2 System peripheral: Intel Corporation Broadwell Power Control Unit (rev 03)  
  10.   
  11. Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-  
  12.   
  13. Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-  
  14.   
  15. # lspci -vvv -s ff:1f.2  
  16.   
  17. ff:1f.2 System peripheral: Intel Corporation Broadwell Power Control Unit (rev 03)  
  18.   
  19. Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-  
  20.   
  21. Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-  

lspci -x/-xxx/-xxxx:-x以16进制信息显示pci配置空间;-xxx显示部分读配置空间会crash的设备;-xxxx显示PCI-x2.0或者PCI-e总线扩展的配置空间。

lspci -b:以总线的角度来显示所有的IRQ和地址。根据我的观察,大部分信息和不带参数时显示一致,除了SR-IOV设备分配出的Virtual Function设备。如下示例:物理网卡

PF(physical function )显示一直 ,但VF(virtual function )显示却不同。


  1. # lspci -b -s 0a:00.1; lspci -b -s 0a:10.0  
  2. 0a:00.1 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)  
  3. 0a:10.0 Ethernet controller: Illegal Vendor ID Device ffff (rev 01)  
  4. # lspci -s 0a:00.1; lspci -s 0a:10.0  
  5. 0a:00.1 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)  
  6. 0a:10.0 Ethernet controller: Intel Corporation X540 Ethernet Controller Virtual Function (rev 01)  

lspci -D:显示PCI domain号,默认的不加参数命令并不显示该值。如下示例:


  1. # lspci -s 0a:00.0  
  2. 0a:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)  
  3.   
  4. # lspci -D -s 0a:00.0  
  5. 0000:0a:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)  

lspci -n/-nn:显示设备的vendor厂商号和device设备号;显示厂商等信息和名称。


  1. # lspci -nn | grep ff:1f.2  
  2. ff:1f.2 System peripheral [0880]: Intel Corporation Broadwell Power Control Unit [8086:6f8a] (rev 03)  
  3.   
  4. # lspci -n | grep ff:1f.2  
  5. ff:1f.2 0880: 8086:6f8a (rev 03)  

lspci -D:显示设备的厂商号、设备号、Class号。


  1. # lspci -Q -s 0c:00.1  
  2.   
  3. 0c:00.1 Class 0200: Device 8086:1528 (rev 01)  

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Centos 6.2 安装完后无法上网问题
linux查看网卡型号、驱动版本、队列数
Ubuntu 10.04 安装网卡驱动
Linux 查看系统硬件信息(实例详解)
KVM设备透传与重定向实战详解
Linux硬件信息命令大全
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服