Skip to content

Commit

Permalink
net/mlx5: fix probing device in legacy bonding mode
Browse files Browse the repository at this point in the history
[ upstream commit ecaee30 ]

If the device was configured as legacy bond one (without
involving E-Switch), the mlx5 PMD erroneously tried to deduce
the vport index raising the fatal error and preventing
device from being used.

The patch checks whether there is E-Switch present and we
should use vport index indeed.

Fixes: 2eb4d01 ("net/mlx5: refactor PCI probing on Linux")
Fixes: d5c06b1 ("net/mlx5: query vport index match mode and parameters")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
viacheslavo authored and steevenlee committed Jun 8, 2021
1 parent 1c43f69 commit 47b2b44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/mlx5/linux/mlx5_os.c
Expand Up @@ -982,7 +982,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
}
if (devx_port.comp_mask & MLX5DV_DEVX_PORT_VPORT) {
priv->vport_id = devx_port.vport_num;
} else if (spawn->pf_bond >= 0) {
} else if (spawn->pf_bond >= 0 &&
(switch_info->representor || switch_info->master)) {
DRV_LOG(ERR, "can't deduce vport index for port %d"
" on bonding device %s",
spawn->phys_port,
Expand Down

0 comments on commit 47b2b44

Please sign in to comment.