path: root/drivers/net/mlx5/mlx5.h
diff options
authorViacheslav Ovsiienko <>2019-10-07 13:56:19 +0000
committerFerruh Yigit <>2019-10-08 12:14:32 +0200
commitfbc8341218bc0a373035468445dfd29a433e8f47 (patch)
treecbbbf5ecbfe852e8638f644f52145c3208aa433f /drivers/net/mlx5/mlx5.h
parentb53cd86965a13f0d9efcd7fb02e96bb3f5215916 (diff)
net/mlx5: fix device scan within switch domain
In LAG configuration the devices in the same switch domain might be spawned on the base of different PCI devices, so we should check all devices backed by mlx5 PMD whether they belong to specified switch domain. When the new devices are being created it is not possible to detect whether the sibling devices created in the current probe() loop belong to the driver, driver field is not filled yet (it will be done on returned success of current probe()). This patch updates the device scanning, allowing extra match on current backing PCI device, is being used to create siblings. Fixes: f7e95215ac7c ("net/mlx5: extend switch domain searching range") Signed-off-by: Viacheslav Ovsiienko <>
Diffstat (limited to 'drivers/net/mlx5/mlx5.h')
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 164df11..baf945c 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -682,13 +682,13 @@ int32_t mlx5_release_dbr(struct rte_eth_dev *dev, uint32_t umem_id,
uint64_t offset);
int mlx5_udp_tunnel_port_add(struct rte_eth_dev *dev,
struct rte_eth_udp_tunnel *udp_tunnel);
-uint16_t mlx5_eth_find_next(uint16_t port_id);
+uint16_t mlx5_eth_find_next(uint16_t port_id, struct rte_pci_device *pci_dev);
/* Macro to iterate over all valid ports for mlx5 driver. */
-#define MLX5_ETH_FOREACH_DEV(port_id) \
- for (port_id = mlx5_eth_find_next(0); \
+#define MLX5_ETH_FOREACH_DEV(port_id, pci_dev) \
+ for (port_id = mlx5_eth_find_next(0, pci_dev); \
port_id < RTE_MAX_ETHPORTS; \
- port_id = mlx5_eth_find_next(port_id + 1))
+ port_id = mlx5_eth_find_next(port_id + 1, pci_dev))
/* mlx5_ethdev.c */