Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common/mlx5: fix controller index parsing
[ upstream commit 3cd5e500b5cb1b72ee182be4043018f22a5f8a3b ] When probing the Linux kernel network interfaces attached to E-Switch, mlx5 PMD decides the representor type and represented entity using phys_port_name exposed by the mlx5 kernel driver in sysfs. mlx5 PMD first checks this name for multihost controller index. In multihost scenarios, phys_port_name is prefixed with "c[0-9]+" string. Included integer is the controller index. Assuming that phys_port_name contains a string representing a physical port, i.e. "p[0-9]+" string, the parsing logic is incorrect. Both "p[0-9]+" and "c[0-9]+" match the formatting string used to parse phys_port_name, but controller index is still filled out. This patch fixes this behavior by storing the parsed index in a temporary variable and setting controller index if and only if phys_port_name matches multihost controller syntax. Fixes: 59df97f ("common/mlx5: support sub-function representor parsing") Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
- Loading branch information