Skip to content

Commit df7ddb2

Browse files
Daniel JurgensSaeed Mahameed
authored andcommitted
net/mlx5: Consider PCI domain in search for next dev
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 <[email protected]> Reviewed-by: Aviv Heller <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 0713047 commit df7ddb2

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,17 @@ void mlx5_remove_dev_by_protocol(struct mlx5_core_dev *dev, int protocol)
391391
}
392392
}
393393

394-
static u16 mlx5_gen_pci_id(struct mlx5_core_dev *dev)
394+
static u32 mlx5_gen_pci_id(struct mlx5_core_dev *dev)
395395
{
396-
return (u16)((dev->pdev->bus->number << 8) |
396+
return (u32)((pci_domain_nr(dev->pdev->bus) << 16) |
397+
(dev->pdev->bus->number << 8) |
397398
PCI_SLOT(dev->pdev->devfn));
398399
}
399400

400401
/* Must be called with intf_mutex held */
401402
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
402403
{
403-
u16 pci_id = mlx5_gen_pci_id(dev);
404+
u32 pci_id = mlx5_gen_pci_id(dev);
404405
struct mlx5_core_dev *res = NULL;
405406
struct mlx5_core_dev *tmp_dev;
406407
struct mlx5_priv *priv;

0 commit comments

Comments
 (0)