[PATCH v3] net/mlx5: fix the sysfs port name translation

Raslan Darawsheh rasland at nvidia.com
Tue Mar 28 10:39:00 CEST 2023


Hi,

> -----Original Message-----
> From: Bing Zhao <bingz at nvidia.com>
> Sent: Thursday, March 23, 2023 12:54 PM
> To: Slava Ovsiienko <viacheslavo at nvidia.com>; Matan Azrad
> <matan at nvidia.com>; stephen at networkplumber.org
> Cc: dev at dpdk.org; Raslan Darawsheh <rasland at nvidia.com>;
> stable at dpdk.org
> Subject: [PATCH v3] net/mlx5: fix the sysfs port name translation
> 
> 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: 654810b56828 ("common/mlx5: share Netlink commands")
> Fixes: 420bbdae89f2 ("net/mlx5: fix host physical function representor
> naming")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Bing Zhao <bingz at nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


More information about the stable mailing list