net/mlx5: SD, Implement devcom communication and primary election
authorTariq Toukan <tariqt@nvidia.com>
Thu, 15 Feb 2024 03:08:03 +0000 (19:08 -0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 7 Mar 2024 08:40:38 +0000 (00:40 -0800)
commitd3d0576660905c80c4cf02178cae2246e900872a
treebcb1fa782add79ba55a3b35967a3a50cafd294a9
parent678eb448055a45ea9dc63377c9f0ad7f2dd90f98
net/mlx5: SD, Implement devcom communication and primary election

Use devcom to communicate between the different devices. Add a new
devcom component type for this.

Each device registers itself to the devcom component <SD, group ID>.
Once all devices of a component are registered, the component becomes
ready, and a primary device is elected.

In principle, any of the devices can act as a primary, they are all
capable, and a random election would've worked. However, we aim to
achieve predictability and consistency, hence each group always choses
the same device, with the lowest PCI BUS number, as primary.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.h
drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c