net/mlx5: fix find sibling devices
authorGregory Etelson <getelson@nvidia.com>
Tue, 3 Aug 2021 15:06:58 +0000 (18:06 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 4 Aug 2021 09:27:49 +0000 (11:27 +0200)
commite9d420dfc2d0549b5f75f0e3cdec104eece93484
treed81116b66305d4641f08ebf0daf44eb053b2c908
parent1af874087c3a7294af1fe1abe89e8ec5b57734ea
net/mlx5: fix find sibling devices

The routine mlx5_eth_find_next() and related iterating macro
MLX5_ETH_FOREACH_DEV is used to iterate through sibling devices (all
representors share the same configuration and switching domain) on top
of specified root device.

The root device parameter was specified as NULL, and it caused
missing siblings in iteration during representor device probing,
causing:

1. allocating new domain_id for the device being probed.
2. discrepancy in representor configurations and potential overall
   driver malfunctions.

Fixes: 56bb3c84e982 ("net/mlx5: reduce PCI dependency")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/windows/mlx5_os.c