Skip to content

Commit 34d5456

Browse files
Daniel Jurgensgregkh
authored andcommitted
net/mlx5: Consider PCI domain in search for next dev
[ Upstream commit df7ddb2 ] The PCI BDF is not unique. PCI domain must also be considered when searching for the next physical device during lag setup. Example below: mlx5_core 0000:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0000:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) Signed-off-by: Daniel Jurgens <danielj@mellanox.com> Reviewed-by: Aviv Heller <avivh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f36f3eb commit 34d5456

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,17 @@ void mlx5_remove_dev_by_protocol(struct mlx5_core_dev *dev, int protocol)
388388
}
389389
}
390390

391-
static u16 mlx5_gen_pci_id(struct mlx5_core_dev *dev)
391+
static u32 mlx5_gen_pci_id(struct mlx5_core_dev *dev)
392392
{
393-
return (u16)((dev->pdev->bus->number << 8) |
393+
return (u32)((pci_domain_nr(dev->pdev->bus) << 16) |
394+
(dev->pdev->bus->number << 8) |
394395
PCI_SLOT(dev->pdev->devfn));
395396
}
396397

397398
/* Must be called with intf_mutex held */
398399
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
399400
{
400-
u16 pci_id = mlx5_gen_pci_id(dev);
401+
u32 pci_id = mlx5_gen_pci_id(dev);
401402
struct mlx5_core_dev *res = NULL;
402403
struct mlx5_core_dev *tmp_dev;
403404
struct mlx5_priv *priv;

0 commit comments

Comments
 (0)