Lspci命令详解

Lspci

lspci is a utility for displaying information about PCI buses in the system and devices connected to them.

[root@localhost ~]# lspci  |grep -i "5a:"

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

5a:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

5a:00.2 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)

5a:00.3 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)

Lspci -m

Dump PCI device data in a backward-compatible machine readable form.  See below for details.

[root@localhost ~]# lspci -m |grep -i "5a:"

5a:00.0 "Ethernet controller" "Intel Corporation" "Ethernet Connection X722 for 10GbE SFP+" -r09 "Lenovo" "Ethernet Connection X722 for 10GbE SFP+"

5a:00.1 "Ethernet controller" "Intel Corporation" "Ethernet Connection X722 for 10GbE SFP+" -r09 "Lenovo" "Ethernet Connection X722 for 10GbE SFP+"

5a:00.2 "Ethernet controller" "Intel Corporation" "Ethernet Connection X722 for 1GbE" -r09 "Lenovo" "Ethernet Connection X722 for 1GbE"

5a:00.3 "Ethernet controller" "Intel Corporation" "Ethernet Connection X722 for 1GbE" -r09 "Lenovo" "Ethernet Connection X722 for 1GbE"

Lspci -v

Be verbose and display detailed information about all devices.

# lspci -v |grep -i "5a:" -A 20

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 10GbE SFP+

        Flags: bus master, fast devsel, latency 0, IRQ 11, NUMA node 0

        Memory at 23ffe000000 (64-bit, prefetchable) [size=16M]

        Memory at 23fff018000 (64-bit, prefetchable) [size=32K]

        Expansion ROM at e3d80000 [disabled] [size=512K]

        Capabilities: [40] Power Management version 3

        Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+

        Capabilities: [70] MSI-X: Enable+ Count=129 Masked-

        Capabilities: [a0] Express Endpoint, MSI 00

        Capabilities: [e0] Vital Product Data

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [1a0] Transaction Processing Hints

        Capabilities: [1b0] Access Control Services

        Kernel driver in use: i40e

        Kernel modules: i40e

5a:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

Lspci -k

Show  kernel  drivers  handling each device and also kernel modules capable of handling it.  Turned on by default when -v is given in the normal mode of output.  (Currently works only on Linux with kernel 2.6 or newer.)

[root@localhost ~]# lspci -k |grep -i "5a:" -A 3

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 10GbE SFP+

        Kernel driver in use: i40e

        Kernel modules: i40e

5a:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 10GbE SFP+

        Kernel driver in use: i40e

        Kernel modules: i40e

5a:00.2 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 1GbE

        Kernel driver in use: i40e

        Kernel modules: i40e

5a:00.3 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 1GbE

        Kernel driver in use: i40e

        Kernel modules: i40e

Lspci -n

Show PCI vendor and device codes as numbers instead of looking them up in the PCI ID list.

[root@localhost ~]# lspci -n  |grep -i "5a:"

5a:00.0 0200: 8086:37d3 (rev 09)

5a:00.1 0200: 8086:37d3 (rev 09)

5a:00.2 0200: 8086:37d1 (rev 09)

5a:00.3 0200: 8086:37d1 (rev 09)

Lspci -nn

Show PCI vendor and device codes as both numbers and names.

[root@localhost ~]# lspci -nn  |grep -i "5a:"

5a:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ [8086:37d3] (rev 09)

5a:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ [8086:37d3] (rev 09)

5a:00.2 Ethernet controller [0200]: Intel Corporation Ethernet Connection X722 for 1GbE [8086:37d1] (rev 09)

5a:00.3 Ethernet controller [0200]: Intel Corporation Ethernet Connection X722 for 1GbE [8086:37d1] (rev 09)

Lspci -s

-s [[[[]:]]:][][.[]]

              Show only devices in the specified domain (in case your machine has several host bridges, they can either share a common bus number space or each of them can address a PCI domain of  its

              own;  domains  are  numbered from 0 to ffff), bus (0 to ff), device (0 to 1f) and function (0 to 7).  Each component of the device address can be omitted or set to "*", both meaning "any

              value". All numbers are hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0 on any bus, "0.3" selects third function of device 0  on  all  buses  and

              ".4" shows only the fourth function of each device.

[root@localhost ~]# lspci -s 5a:00.0

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

[root@localhost ~]# lspci -s 5a:00.0 -v

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

        Subsystem: Lenovo Ethernet Connection X722 for 10GbE SFP+

        Flags: bus master, fast devsel, latency 0, IRQ 11, NUMA node 0

        Memory at 23ffe000000 (64-bit, prefetchable) [size=16M]

        Memory at 23fff018000 (64-bit, prefetchable) [size=32K]

        Expansion ROM at e3d80000 [disabled] [size=512K]

        Capabilities: [40] Power Management version 3

        Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+

        Capabilities: [70] MSI-X: Enable+ Count=129 Masked-

        Capabilities: [a0] Express Endpoint, MSI 00

        Capabilities: [e0] Vital Product Data

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [1a0] Transaction Processing Hints

        Capabilities: [1b0] Access Control Services

        Kernel driver in use: i40e

        Kernel modules: i40e

Lspci -vmm

Verbose format (-vmm)

      The verbose output is a sequence of records separated by blank lines.  Each record describes a single device by a sequence of lines, each line containing a single `tag: value' pair. The tag and

      the value are separated by a single tab character.  Neither the records nor the lines within a record are in any particular order.  Tags are case-sensitive.

      The following tags are defined:

      Slot  The name of the slot where the device resides ([domain:]bus:device.function).  This tag is always the first in a record.

      Class  Name of the class.

      Vendor Name of the vendor.

      Device Name of the device.

      SVendor

              Name of the subsystem vendor (optional).

      SDevice

              Name of the subsystem (optional).

      PhySlot

              The physical slot where the device resides (optional, Linux only).

      Rev    Revision number (optional).

      ProgIf Programming interface (optional).

      Driver Kernel driver currently handling the device (optional, Linux only).

      Module Kernel module reporting that it is capable of handling the device (optional, Linux only).

      NUMANode

              NUMA node this device is connected to (optional, Linux only).

      New tags can be added in future versions, so you should silently ignore any tags you don't recognize.

示例:

[root@localhost ~]# lspci -vmm |grep -i SAS -A 5 -B 5

NUMANode:      0

Slot:  06:00.0

Class:  Serial Attached SCSI controller

Vendor: LSI Logic / Symbios Logic

Device: SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)

SVendor:        Lenovo

SDevice:        ThinkSystem 430-8i SAS/SATA 12Gb HBA

PhySlot:        1

Rev:    01

NUMANode:      0

Slot:  2e:05.0

Lspci -d

-d []:[][:]

              Show only devices with specified vendor, device and class ID. The ID's are given in hexadecimal and may be omitted or given as "*", both meaning "any value".

[root@localhost ~]# lspci -d 8086:37d3

5a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

5a:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

/usr/share/hwdata/pci.ids

默认lspci使用linux系统下这个文件来解析pci设备文件的数据,也可通过命令修改。

-i

              Use as the PCI ID list instead of /usr/share/hwdata/pci.ids.

你可能感兴趣的:(Lspci命令详解)