How to obtain the PCI ID of a device under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.