Show ethernet controllers on the pci bus:
# lspci |grep -i ether 01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) 01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) 01:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) 01:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) 42:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] 42:00.1 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
Show details on a specific ethernet controller:
# lspci -vvnn -s 42:00.0 42:00.0 Ethernet controller [0200]: Mellanox Technologies MT27800 Family [ConnectX-5] [15b3:1017] Subsystem: Mellanox Technologies MT27800 Family [ConnectX-5] [15b3:0061] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-SERR-
Show a tree of entries (output is clipped):
~# lspci -tvnn -+-[0000:7f]-+-08.0 Intel Corporation Xeon E7 v2/Xeon E5 v2/Core i7 QPI Link 0 [8086:0e80] | +-09.0 Intel Corporation Xeon E7 v2/Xeon E5 v2/Core i7 QPI Link 1 [8086:0e90] .....
Show available physical slots and their capability:
# dmidecode -t 9 # dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x0900, DMI type 9, 17 bytes System Slot Information Designation: PCI1 Type: x8 PCI Express 3 x16 Current Usage: Available Length: Long ID: 1 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0901, DMI type 9, 17 bytes System Slot Information Designation: PCI2 Type: x16 PCI Express 3 Current Usage: In Use Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Bus Address: 0000:42:00.0 Handle 0x0902, DMI type 9, 17 bytes System Slot Information Designation: PCI3 Type: x16 PCI Express 3 Current Usage: Available Length: Long ID: 3 Characteristics: 3.3 V is provided PME signal is supported
But what is actually negotiated might be different:
root@host01:~# lspci -vvnn -s 42:00.0|grep Lnk LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+ LnkSta: Speed 5GT/s (downgraded), Width x16 (ok) LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS- LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis- LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+ EqualizationPhase1+ LnkCtl3: LnkEquIntrruptEn- PerformEqu-
On one slot, I get 'LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)' [8GT/s * x8 = 64], and in another slot it have "Speed 5GT/s (downgraded), Width x16 (ok)' [5GT/s * x16 = 80], so I guess we use x16 slot.
List kernel drivers for a specific pci slot:
# lspci -k -s 42:00 42:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] Subsystem: Mellanox Technologies MT27800 Family [ConnectX-5] Kernel driver in use: mlx5_core Kernel modules: mlx5_core 42:00.1 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] Subsystem: Mellanox Technologies MT27800 Family [ConnectX-5] Kernel driver in use: mlx5_core Kernel modules: mlx5_core
Show details for a specific kernel module:
# modinfo mlx5_core filename: /lib/modules/5.15.39-4-pve/kernel/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko license: Dual BSD/GPL description: Mellanox 5th generation network adapters (ConnectX series) core driver author: Eli Cohensrcversion: 8802C9A5BF30F219CD73715 alias: auxiliary:mlx5_core.eth .... alias: auxiliary:mlx5_core.eth-rep alias: auxiliary:mlx5_core.sf depends: tls,pci-hyperv-intf,mlxfw,psample retpoline: Y intree: Y name: mlx5_core vermagic: 5.15.39-4-pve SMP mod_unload modversions parm: debug_mask:debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0 (uint) parm: prof_sel:profile selector. Valid range 0 - 2 (uint)
Another additional lspci command combination for finding the kernel module for a particular pci connection:
~# lspci -knn -s 42:00.0 42:00.0 Ethernet controller [0200]: Mellanox Technologies MT27800 Family [ConnectX-5] [15b3:1017] Subsystem: Mellanox Technologies MT27800 Family [ConnectX-5] [15b3:0061] Kernel driver in use: mlx5_core Kernel modules: mlx5_core