mirror-linux/include/linux/mlx5
Jiri Pirko 2a8c8a03f3 net/mlx5: Add a shared devlink instance for PFs on same chip
Use the previously introduced shared devlink infrastructure to create
a shared devlink instance for mlx5 PFs that reside on the same physical
chip. The shared instance is identified by the chip's serial number
extracted from PCI VPD (V3 keyword, with fallback to serial number
for older devices).

Each PF that probes calls mlx5_shd_init() which extracts the chip serial
number and uses devlink_shd_get() to get or create the shared instance.
When a PF is removed, mlx5_shd_uninit() calls devlink_shd_put()
to release the reference. The shared instance is automatically destroyed
when the last PF is removed.

Make the PF devlink instances nested in this shared devlink instance,
allowing userspace to identify which PFs belong to the same physical
chip.

Example:

pci/0000:08:00.0: index 0
  nested_devlink:
    auxiliary/mlx5_core.eth.0
devlink_index/1: index 1
  nested_devlink:
    pci/0000:08:00.0
    pci/0000:08:00.1
auxiliary/mlx5_core.eth.0: index 2
pci/0000:08:00.1: index 3
  nested_devlink:
    auxiliary/mlx5_core.eth.1
auxiliary/mlx5_core.eth.1: index 4

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20260312100407.551173-14-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-03-14 13:08:51 -07:00
..
cq.h mlx5: Fix default values in create CQ 2025-11-11 15:12:18 +01:00
device.h net/mlx5e: RX, Drop oversized packets in non-linear mode 2026-02-04 21:16:05 -08:00
doorbell.h
driver.h net/mlx5: Add a shared devlink instance for PFs on same chip 2026-03-14 13:08:51 -07:00
eq.h
eswitch.h
fs.h Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2025-11-14 18:55:38 -08:00
fs_helpers.h
macsec.h
mlx5_ifc.h net/mlx5: Add IFC bits for extended ETS rate limit bandwidth value 2026-01-13 03:43:00 -05:00
mlx5_ifc_fpga.h
mlx5_ifc_vdpa.h
mpfs.h
port.h net/mlx5: Fix 1600G link mode enum naming 2026-02-05 18:29:04 -08:00
qp.h net/mlx5e: Prevent WQE metadata conflicts between timestamping and offloads 2025-09-17 04:38:10 -04:00
rsc_dump.h
transobj.h
vport.h net/mlx5: Handle port and vport speed change events in MPESW 2026-01-05 02:38:25 -05:00