Listing PCI functions

Use the lspci or smc_rnics command to list your PCI functions.

Listing online PCI functions with lspci

The lspci command lists all online PCI functions on a running Linux® instance, including PCI functions of RoCE Express adapters.

# lspci |grep Ethernet

For more information about the lspci command, see the man page.

Listing all PCI functions with smc_rnics

By default, the smc_rnics command lists all online PCI functions of RoCE Express adapters.

The command has a --all option that includes offline PCI functions in the output list. Because the command cannot detect the type of offline PCI functions the output cannot be filtered to items that are relevant to SMC. The listed offline device could include, for example, NVMe devices. Such devices are omitted from the smc_rnics output after being set online.

Example

This example assumes four PCI functions with the following FIDs:
50a
is an offline RoCE Express PCI function with function address 000a:00:00.0.
8ca
is an online RoCE Express PCI function with function address 0008:00:00.0.
8ea
is an online RoCE Express PCI function with function address 0009:00:00.0.
b05
is an offline NVMe device with function address 000d:00:00.0.
By default, both the lspci command and the smc_rnics command list the two online PCI functions. With the --all option, smc_rnics also lists the offline FIDs.

# lspci
0008:00:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function]
0009:00:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function]
# smc_rnics
  FID Power PCI_ID       PCHID Type          PPrt PNET_ID Net-Dev
-------------------------------------------------------------------
  8ca 1     0008:00:00.0 01c8  RoCE_Express2 0    NET25   eno8
  8ea 1     0009:00:00.0 01c8  RoCE_Express2 1    NET26   eno9
# smc_rnics --all
  FID Power PCI_ID       PCHID Type          PPrt PNET_ID Net-Dev
-------------------------------------------------------------------
  50a 0
  8ca 1     0008:00:00.0 01c8  RoCE_Express2 0    NET25   eno8
  8ea 1     0009:00:00.0 01c8  RoCE_Express2 1    NET26   eno9
  b05 0

The following command outputs assume that FIDs 50a and b05 are set online, for example, with smc_rnics -e commands. The smc_rnics command now filters out the NVMe device, but lspci lists it.


# smc_rnics
  FID Power PCI_ID       PCHID Type          PPrt PNET_ID Net-Dev
-------------------------------------------------------------------
  50a 1     000a:00:00.0 01a5  RoCE_Express2 1    NET26   eno10
  8ca 1     0008:00:00.0 01c8  RoCE_Express2 0    NET25   eno8
  8ea 1     0009:00:00.0 01c8  RoCE_Express2 1    NET26   eno9
# lspci
0008:00:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function]
0009:00:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function]
000a:00:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function]
000d:00:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 172Xa/172Xb (rev 01)

For KVM or z/VM® guests, PCI devices are online by default.