Sometimes, the development needs to use the device's PCI ID, such as the use of DPDK to bind a network card, need to use the PCI ID card. Here are some ways to get the PCI ID.
1. Use the LSPCI command.
Such as
02:00.0 USB Controller:intel Corporation 82371ab/eb/mb PIIX4 usb02:01.0 Ethernet Controller:intel Corporation 82545EM Gi Gabit Ethernet Controller (Copper) (rev.) 02:02.0 Multimedia audio Controller:ensoniq es1371/creative Labs CT2518 [Aud IOPCI-97] (rev) 02:03.0 USB Controller:vmware USB2 EHCI Controller
The first column is the PCI ID, followed by the device name and the vendor name. You can see that the PCI ID of the Ethernet card is 02:01.0
But sometimes in some embedded systems, the LSPCI command is not provided by Pciutils, but is provided by other packages, or modified, and the output may be as follows:
The result above and CentOS is the same virtual machine, just with an embedded kernel +ramfs boot, command is LSPCI-VMM
In this case, only on the http://www.pcidatabase.com/to find the corresponding vendor and device, and then a comparison.
For example, 02:01.0 is 8086 and 100f.
0x100f |
Intel (R) pro/1000 MT Network Connection |
0x8086 |
Intel Corporation |
2. Use the DMESG command.
Such as
e1000 0000:02:01.0:pci INT A-GSI (level, low)--IRQ 19e1000 0000:02:01.0:setting Latency timer to 64e1000 0 000:02:01.0:eth0: (pci:66mhz:32-bit) 00:0c:29:62:d0:69e1000 0000:02:01.0:eth0:intel (R) PRO/1000 Network Connection
You can also see that the PCI ID of the Ethernet card is 02:01.0
This approach is applicable both in the general distribution and in the custom embedded system.
How to obtain the PCI ID of a device under Linux