How to obtain the pci id of a device in Linux

Source: Internet
Author: User

How to obtain the pci id of a device in Linux

Sometimes, you need to use the pci ID of the device during development. For example, to bind a network card with dpdk, you need to use the pci ID of the network card. The following methods can be used to obtain the pci ID.

1. Use the lspci command.

For example

. 0 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
. 0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
. 0 Multimedia audio controller: Ensoniq ES1371/Creative Labs CT2518 [AudioPCI-97] (rev 02)
. 0 USB controller: VMware USB2 EHCI Controller

The first column is the pci id, followed by the device name and supplier name. The pci id of the Ethernet card is. 0.

However, in some embedded systems, the lspci command is not provided by pciutils, but by other software packages or modified. The output result may be as follows:

The preceding result is the same as that of CentOS. It is started with an embedded kernel + ramfs. The command is lspci-vmm.

In this case, only the http://www.pcidatabase.com/find the corresponding Vendor and Device, and then one by one comparison.

For example,. 0 is 8086 and 100f.

0x100F Intel (R) PRO/1000 MT Network Connection 0x8086 Intel Corporation

2. Run the dmesg command.

For example

E1000 restart :0:01. 0: pci int a-> GSI 19 (level, low)-> IRQ 19
E1000 release :0:01. 0: setting latency timer to 64
E1000 :0:01. 0: eth0: (PCI: 66 MHz: 32-bit) 00: 0c: 29: 62: d0: 69
E1000. 0: eth0: Intel (R) PRO/1000 Network Connection

You can also see that the pci id of the Ethernet card is. 0.

This method is applicable to general releases or custom embedded systems.

This article permanently updates the link address:

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.