Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: fix sysfs port name translation
[ upstream commit f8a226ed65fa1c6e085fb0d5a91bab7fb5034aec ] With some OFED or upstream kernel of mlx5, the port name fetched from "/sys/class/net/[DEV]/phys_port_name" may have a tailing "\n" as the EOL. The sscanf() will return the scanned items number with this EOL. In such case, the "equal to" condition is considered as false and the function mlx5_translate_port_name() will recognize the port type wrongly with UNKNOWN result. The tailing carriage return character should be removed before calling the mlx5_translate_port_name(), this was already done in the NL message handling. In the meanwhile, the possible incorrect line feed character is also taken into consideration. Fixes: 654810b ("common/mlx5: share Netlink commands") Fixes: 420bbda ("net/mlx5: fix host physical function representor naming") Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
- Loading branch information