On Linux, is there a way to find out which PCI card is connected to the PCI slot?

On Linux, is there a way to find out which PCI card is connected to the PCI slot?

/ sys / bus / pci / devices / contains many devices (bridges, CPU channels, etc.) that are not cards, and I could not find any information about memory card mappings in the device directories.

+5
source share
2 answers

you can use

dmidecode –t slot 

to find all available pci slots than you can run

 lspci -s <slot number> 

to display a device connected to the specified slot. You must take the bus address from the first command and use this address as a parameter in the second command.

+9
source

Nebojsa's answer is good, but here is a bit more information and an answer to magmabyte's comment.

dmidecode gives you the number of slots, however, these slots are not the only things using the PCI bridge, so you see much more devices than slots.

Secondly, you can see several β€œdevices” on each slot, but they are probably just several ports on the same card. To give you an example of using network interface cards (NICs):

 megaman@someserver $ lspci | grep 10Gb 07:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (rev 02) 07:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (rev 02) 

dmidecode indicates that this server has three slots (and it does). Slot 1 has a 10Gb NIC above (you can see that it has 2 ports), slot 2 has a fiber optic channel card (which also has 2 ports), and finally slot 3 is empty.

There are three physical slots in the server: one is empty, two are filled with cards with several ports (HBA and network adapter).

To answer your question in a comment, 3 slots you have are those indicated by dmidecode , and they are probably filled with interface cards of several ports.

+3
source

Source: https://habr.com/ru/post/1202856/


All Articles