1. 指令名称
lspci
2. 指令简介
lspci 是一个用于显示系统中所有 PCI/PCIe 总线及设备信息的工具。
默认情况下,它只显示设备的最简要信息。通过传入指定参数,可以输出更详细的信息,或者可以按照特定格式输出,以便于用其他程序进行解析。
有些 PCI/PCIe 的设备信息需要在 root 权限下才能获取到。
3. 参数
先来看看不加任何参数时输出的结果。
bryan@bryan-pc:~$ lspci
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 08)
00:02.0 VGA compatible controller: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
00:15.0 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #0
00:15.1 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #1
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
00:1e.0 Signal processing controller: Intel Corporation 200 Series/Z370 Chipset Family Serial IO UART Controller #0
00:1f.0 ISA bridge: Intel Corporation Device a2cc
00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
01:00.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
01:00.1 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.2 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.3 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.4 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
02:08.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
02:09.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
02:10.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
03:00.0 Memory controller: Xilinx Corporation Device 8038 (rev ff)
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
07:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth (rev 99)
3.1 基本显示模式
-m
: 以机器可读的方式输出信息
bryan@bryan-pc:~$ lspci -m
00:00.0 "Host bridge" "Intel Corporation" "8th Gen Core Processor Host Bridge/DRAM Registers" -r08 "Lenovo" "Device 3178"
00:01.0 "PCI bridge" "Intel Corporation" "Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16)" -r08 "" ""
00:02.0 "VGA compatible controller" "Intel Corporation" "8th Gen Core Processor Gaussian Mixture Model" "Lenovo" "Device 3178"
00:14.0 "USB controller" "Intel Corporation" "200 Series/Z370 Chipset Family USB 3.0 xHCI Controller" -p30 "Lenovo" "200 Series PCH USB 3.0 xHCI Controller"
00:14.2 "Signal processing controller" "Intel Corporation" "200 Series PCH Thermal Subsystem" "Lenovo" "200 Series PCH Thermal Subsystem"
00:15.0 "Signal processing controller" "Intel Corporation" "200 Series PCH Serial IO I2C Controller #0" "Lenovo" "200 Series PCH Serial IO I2C Controller"
00:15.1 "Signal processing controller" "Intel Corporation" "200 Series PCH Serial IO I2C Controller #1" "Lenovo" "200 Series PCH Serial IO I2C Controller"
00:16.0 "Communication controller" "Intel Corporation" "200 Series PCH CSME HECI #1" "Lenovo" "200 Series PCH CSME HECI"
00:17.0 "SATA controller" "Intel Corporation" "200 Series PCH SATA controller [AHCI mode]" -p01 "Lenovo" "200 Series PCH SATA controller [AHCI mode]"
00:1c.0 "PCI bridge" "Intel Corporation" "200 Series PCH PCI Express Root Port #7" -rf0 "" ""
00:1d.0 "PCI bridge" "Intel Corporation" "200 Series PCH PCI Express Root Port #9" -rf0 "" ""
00:1e.0 "Signal processing controller" "Intel Corporation" "200 Series/Z370 Chipset Family Serial IO UART Controller #0" "Lenovo" "200 Series PCH Serial IO UART Controller"
00:1f.0 "ISA bridge" "Intel Corporation" "Device a2cc" "Lenovo" "Device 3178"
00:1f.2 "Memory controller" "Intel Corporation" "200 Series/Z370 Chipset Family Power Management Controller" "Lenovo" "200 Series PCH PMC"
00:1f.3 "Audio device" "Intel Corporation" "200 Series PCH HD Audio" "Lenovo" "200 Series PCH HD Audio"
00:1f.4 "SMBus" "Intel Corporation" "200 Series/Z370 Chipset Family SMBus Controller" "Lenovo" "200 Series PCH SMBus Controller"
01:00.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
01:00.1 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.2 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.3 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.4 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
02:08.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
02:09.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
02:10.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
03:00.0 "Memory controller" "Xilinx Corporation" "Device 8038" "Xilinx Corporation" "Device 0007"
06:00.0 "Ethernet controller" "Realtek Semiconductor Co., Ltd." "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller" -r15 "Lenovo" "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
07:00.0 "Network controller" "Intel Corporation" "Dual Band Wireless-AC 3165 Plus Bluetooth" -r99 "Intel Corporation" "Dual Band Wireless-AC 3165 Plus Bluetooth"
-mm
: 以机器可读的方式输出信息,并且易于使用脚本处理。(没看出与 lspci -m 有什么区别)
bryan@bryan-pc:~$ lspci -mm
00:00.0 "Host bridge" "Intel Corporation" "8th Gen Core Processor Host Bridge/DRAM Registers" -r08 "Lenovo" "Device 3178"
00:01.0 "PCI bridge" "Intel Corporation" "Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16)" -r08 "" ""
00:02.0 "VGA compatible controller" "Intel Corporation" "8th Gen Core Processor Gaussian Mixture Model" "Lenovo" "Device 3178"
00:14.0 "USB controller" "Intel Corporation" "200 Series/Z370 Chipset Family USB 3.0 xHCI Controller" -p30 "Lenovo" "200 Series PCH USB 3.0 xHCI Controller"
00:14.2 "Signal processing controller" "Intel Corporation" "200 Series PCH Thermal Subsystem" "Lenovo" "200 Series PCH Thermal Subsystem"
00:15.0 "Signal processing controller" "Intel Corporation" "200 Series PCH Serial IO I2C Controller #0" "Lenovo" "200 Series PCH Serial IO I2C Controller"
00:15.1 "Signal processing controller" "Intel Corporation" "200 Series PCH Serial IO I2C Controller #1" "Lenovo" "200 Series PCH Serial IO I2C Controller"
00:16.0 "Communication controller" "Intel Corporation" "200 Series PCH CSME HECI #1" "Lenovo" "200 Series PCH CSME HECI"
00:17.0 "SATA controller" "Intel Corporation" "200 Series PCH SATA controller [AHCI mode]" -p01 "Lenovo" "200 Series PCH SATA controller [AHCI mode]"
00:1c.0 "PCI bridge" "Intel Corporation" "200 Series PCH PCI Express Root Port #7" -rf0 "" ""
00:1d.0 "PCI bridge" "Intel Corporation" "200 Series PCH PCI Express Root Port #9" -rf0 "" ""
00:1e.0 "Signal processing controller" "Intel Corporation" "200 Series/Z370 Chipset Family Serial IO UART Controller #0" "Lenovo" "200 Series PCH Serial IO UART Controller"
00:1f.0 "ISA bridge" "Intel Corporation" "Device a2cc" "Lenovo" "Device 3178"
00:1f.2 "Memory controller" "Intel Corporation" "200 Series/Z370 Chipset Family Power Management Controller" "Lenovo" "200 Series PCH PMC"
00:1f.3 "Audio device" "Intel Corporation" "200 Series PCH HD Audio" "Lenovo" "200 Series PCH HD Audio"
00:1f.4 "SMBus" "Intel Corporation" "200 Series/Z370 Chipset Family SMBus Controller" "Lenovo" "200 Series PCH SMBus Controller"
01:00.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
01:00.1 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.2 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.3 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
01:00.4 "System peripheral" "PLX Technology, Inc." "Device 87d0" -rca "PLX Technology, Inc." "Device 87d0"
02:08.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
02:09.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
02:10.0 "PCI bridge" "PLX Technology, Inc." "Device 8749" -rca "" ""
03:00.0 "Memory controller" "Xilinx Corporation" "Device 8038" -rff -pff "" ""
06:00.0 "Ethernet controller" "Realtek Semiconductor Co., Ltd." "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller" -r15 "Lenovo" "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
07:00.0 "Network controller" "Intel Corporation" "Dual Band Wirelessbryan@bryan-pc:~$
-t
: 以树状格式显示整个 PCI/PCIe 总线系统,能方便的看出总线、桥、设备之间的级联关系。
bryan@bryan-pc:~$ lspci -t
-[0000:00]-+-00.0
+-01.0-[01-05]--+-00.0-[02-05]--+-08.0-[03]----00.0
| | +-09.0-[04]--
| | \-10.0-[05]--
| +-00.1
| +-00.2
| +-00.3
| \-00.4
+-02.0
+-14.0
+-14.2
+-15.0
+-15.1
+-16.0
+-17.0
+-1c.0-[06]----00.0
+-1d.0-[07]----00.0
+-1e.0
+-1f.0
+-1f.2
+-1f.3
\-1f.4
3.2 显示选项
-v ,-vv,-vvv
: 显示设备的详细信息,加的 v 越多,显示的越详细。最多加 3 个 v。
bryan@bryan-pc:~$ lspci -v
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
Subsystem: Lenovo Device 3178
Flags: bus master, fast devsel, latency 0
Capabilities: <access denied>
Kernel driver in use: skl_uncore
Kernel modules: ie31200_edac
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 08) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 122
Bus: primary=00, secondary=01, subordinate=05, sec-latency=0
I/O behind bridge: 00002000-00003fff
Memory behind bridge: df000000-df1fffff
Prefetchable memory behind bridge: 000000008f800000-000000008fdfffff
Capabilities: <access denied>
Kernel driver in use: pcieport
00:02.0 VGA compatible controller: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 3178
Flags: bus master, fast devsel, latency 0, IRQ 133
Memory at de000000 (64-bit, non-prefetchable) [size=16M]
Memory at c0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915
........
-k
: 显示当前设备对应的驱动程序、内核模块。当传入 -v 参数时,会默认显示这些内容。
-x,-xxx,-xxxx
: 以 16 进制的形式输出 PCI/PCIe 配置空间(以 root 权限执行)。一个 x 时,输出配置空间的前 64 个字节;三个 x 时,输出配置空间的前 256 个字节;四个 x 时,输出配置空间的 4096 个字节(很奇怪,没有两个 x )。
bryan@bryan-pc:~$ sudo lspci -x
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00: 86 80 1f 3e 06 00 90 20 08 00 00 06 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 aa 17 78 31
30: 00 00 00 00 e0 00 00 00 00 00 00 00 00 00 00 00
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 08)
00: 86 80 01 19 07 04 10 00 08 00 04 06 10 00 81 00
10: 00 00 00 00 00 00 00 00 00 01 05 00 20 30 00 20
20: 00 df 10 df 81 8f d1 8f 00 00 00 00 00 00 00 00
30: 00 00 00 00 88 00 00 00 00 00 00 00 0b 01 12 00
...
...
-D
: 显示 PCI/PCIe Domain number。如果在系统中只有 Domain 0,那默认情况下是不会显示 domain 的。
bryan@bryan-pc:~$ sudo lspci -D
0000:00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
0000:00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 08)
0000:00:02.0 VGA compatible controller: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model
0000:00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
0000:00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
0000:00:15.0 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #0
0000:00:15.1 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #1
0000:00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
0000:00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
0000:00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
0000:00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
0000:00:1e.0 Signal processing controller: Intel Corporation 200 Series/Z370 Chipset Family Serial IO UART Controller #0
0000:00:1f.0 ISA bridge: Intel Corporation Device a2cc
0000:00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
0000:00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
0000:00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
0000:01:00.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:01:00.1 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.2 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.3 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.4 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:02:08.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:02:09.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:02:10.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:03:00.0 Memory controller: Xilinx Corporation Device 8038 (rev ff)
0000:06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
0000:07:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth (rev 99)
bryan@bryan-pc:~$
3.3 将 ID 解析为名称
-n
: 直接以数字的形式显示设备的 vendor ID 和 device ID。
bryan@bryan-pc:~$ sudo lspci -n
00:00.0 0600: 8086:3e1f (rev 08)
00:01.0 0604: 8086:1901 (rev 08)
00:02.0 0300: 8086:3e91
00:14.0 0c03: 8086:a2af
00:14.2 1180: 8086:a2b1
00:15.0 1180: 8086:a2e0
00:15.1 1180: 8086:a2e1
00:16.0 0780: 8086:a2ba
00:17.0 0106: 8086:a282
00:1c.0 0604: 8086:a296 (rev f0)
00:1d.0 0604: 8086:a298 (rev f0)
00:1e.0 1180: 8086:a2a7
00:1f.0 0601: 8086:a2cc
00:1f.2 0580: 8086:a2a1
00:1f.3 0403: 8086:a2f0
00:1f.4 0c05: 8086:a2a3
01:00.0 0604: 10b5:8749 (rev ca)
01:00.1 0880: 10b5:87d0 (rev ca)
01:00.2 0880: 10b5:87d0 (rev ca)
01:00.3 0880: 10b5:87d0 (rev ca)
01:00.4 0880: 10b5:87d0 (rev ca)
02:08.0 0604: 10b5:8749 (rev ca)
02:09.0 0604: 10b5:8749 (rev ca)
02:10.0 0604: 10b5:8749 (rev ca)
03:00.0 0580: 10ee:8038 (rev ff)
06:00.0 0200: 10ec:8168 (rev 15)
07:00.0 0280: 8086:3166 (rev 99)
-nn
: 同时以数字和文字描述两种方式显示设备的 Vendor ID 和 Device ID。
bryan@bryan-pc:~$ sudo lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3e1f] (rev 08)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 08)
00:02.0 VGA compatible controller [0300]: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model [8086:3e91]
00:14.0 USB controller [0c03]: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller [8086:a2af]
00:14.2 Signal processing controller [1180]: Intel Corporation 200 Series PCH Thermal Subsystem [8086:a2b1]
00:15.0 Signal processing controller [1180]: Intel Corporation 200 Series PCH Serial IO I2C Controller #0 [8086:a2e0]
00:15.1 Signal processing controller [1180]: Intel Corporation 200 Series PCH Serial IO I2C Controller #1 [8086:a2e1]
00:16.0 Communication controller [0780]: Intel Corporation 200 Series PCH CSME HECI #1 [8086:a2ba]
00:17.0 SATA controller [0106]: Intel Corporation 200 Series PCH SATA controller [AHCI mode] [8086:a282]
00:1c.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #7 [8086:a296] (rev f0)
00:1d.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #9 [8086:a298] (rev f0)
00:1e.0 Signal processing controller [1180]: Intel Corporation 200 Series/Z370 Chipset Family Serial IO UART Controller #0 [8086:a2a7]
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a2cc]
00:1f.2 Memory controller [0580]: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller [8086:a2a1]
00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
00:1f.4 SMBus [0c05]: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller [8086:a2a3]
01:00.0 PCI bridge [0604]: PLX Technology, Inc. Device [10b5:8749] (rev ca)
01:00.1 System peripheral [0880]: PLX Technology, Inc. Device [10b5:87d0] (rev ca)
01:00.2 System peripheral [0880]: PLX Technology, Inc. Device [10b5:87d0] (rev ca)
01:00.3 System peripheral [0880]: PLX Technology, Inc. Device [10b5:87d0] (rev ca)
01:00.4 System peripheral [0880]: PLX Technology, Inc. Device [10b5:87d0] (rev ca)
02:08.0 PCI bridge [0604]: PLX Technology, Inc. Device [10b5:8749] (rev ca)
02:09.0 PCI bridge [0604]: PLX Technology, Inc. Device [10b5:8749] (rev ca)
02:10.0 PCI bridge [0604]: PLX Technology, Inc. Device [10b5:8749] (rev ca)
03:00.0 Memory controller [0580]: Xilinx Corporation Device [10ee:8038] (rev ff)
06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
07:00.0 Network controller [0280]: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth [8086:3166] (rev 99)
3.4 指定设备
通过下面的两种方法指定某一个设备,结合上面介绍的参数,即可完成对特定设备的操作。
-s [[[[<domain>]:]<bus>]:][<device>][.[<func>]]
: 通过 domain、bus、device、function 指定某一个设备进行操作。所有的值都是 16 进制,domain 的取值范围是 0~ffff,bus 的取值范围是 0~ff,device 的取值范围是 0~1f,function 的取值范围是 0~7。如果不指定值或者设置为 * 号,则代表“任何值”。例如,“0:”代表 bus 0 上的所有 device;“0”代表 deivice 0 上的所有 functions;“0.3”代表选择所有 bus 上的 device 0 的第 3 个 function;“.4”代表所有 device 的第 4 个 function。
# 列出 domain 0 bus 6 device 0 function 0 的信息
bryan@bryan-pc:~$ sudo lspci -v -s 0000:06:00.0
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Flags: bus master, fast devsel, latency 0, IRQ 18
I/O ports at e000 [size=256]
Memory at df304000 (64-bit, non-prefetchable) [size=4K]
Memory at df300000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
Capabilities: [d0] Vital Product Data
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
Capabilities: [170] Latency Tolerance Reporting
Capabilities: [178] L1 PM Substates
Kernel driver in use: r8169
Kernel modules: r8169
bryan@bryan-pc:~$
-d [<vendor>]:[<device>][:<class>]
: 通过 vendor ID、device ID、class ID 来指定一个设备。所有 ID 值都是 16 进制数,如果不值定值或者设置为 * 号,则表示“任何值”。
# 列出 vendor ID = 0x10b5, device ID = 87d0, class ID = 0880 的设备信息
bryan@bryan-pc:~$ sudo lspci -d 10b5:87d0:0880
01:00.1 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.2 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.3 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.4 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
bryan@bryan-pc:~$