Comment 1 for bug 1874056

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-04-21 09:53 EDT-------
Today, the enumeration of PCI functions on s390x does not reflect which functions belongs to which physical adapter.

Layout of a PCI function address on Linux:
0000:00:00.0
<root complex>:<bus>:<device>.<function>

On s390x, each function is presented as individual root complex today, e.g.:

PCHID 0100 VF1 0000:00:00.0
PCHID 0100 VF23 0001:00:00.0
PCHID 0200 VF1 0002:00:00.0
OCHID 0100 VF17 0003:00:00.0

On other platforms, the addresses correctly reflect the actual HW configuration. Some device drivers (mlx5 for Mellanox adapters) group functions of one physical adapter by checking which PCI functions have identical values for <root complex>:<bus>:<device>. We need to use the same enumeration scheme to achieve this functionality on s390x.

In this case, the two physical functions of a Mellanox adapter need to get function number 0 and 1, and all virtual functions need to use the same <root complex>:<bus> numbers with function/device numbers counting up.

Required result (example with 4 VFs per PF):

PCHID 0100 PF 0 0000:00:00.0
PCHID 0100 PF 1 0000:00:00.1
PCHID 0100 PF 0 VF 0 0000:00:00.2
PCHID 0100 PF 0 VF 1 0000:00:00.3
PCHID 0100 PF 0 VF 2 0000:00:00.4
PCHID 0100 PF 0 VF 3 0000:00:00.5
PCHID 0100 PF 1 VF 0 0000:00:00.6
PCHID 0100 PF 1 VF 1 0000:00:00.7
PCHID 0100 PF 1 VF 2 0000:00:00.8
PCHID 0100 PF 1 VF 3 0000:00:00.9

PCHID 0200 PF 0 0001:00:00.0