mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
Subsystems (3)
PATCH 1/1 mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
From: Jiri Pirko <[email protected]>
On some HW, not even fall-back "SERIALNO" is found in VPD data. Unify the behavior with the case there are no VPD data at all and avoid creation of shared devlink instance.
--- drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c +1 -1
@@ -33,7 +33,7 @@ int mlx5_shd_init(struct mlx5_core_dev *dev) start =pci_vpd_find_ro_info_keyword (vpd_data, vpd_size,PCI_VPD_RO_KEYWORD_SERIALNO , &kw_len);if (start <0 ) -return -ENOENT ; +return 0 ;/* No usable serial number found, ignore. */ } sn =kstrndup (vpd_data + start, kw_len,GFP_KERNEL );if (!sn)
Signature · 1 line
2.51.1
Quoted 31 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
On some HW, not even fall-back "SERIALNO" is found in VPD data. Unify the behavior with the case there are no VPD data at all and avoid creation of shared devlink instance.
Fixes 2a8c8a03f306 ("net/mlx5: Add a shared devlink instance for PFs on same chip")Reported-by Adam Young <[email protected]>Reported-by Ben Copeland <[email protected]>Signed-off-by Jiri Pirko <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c +1
-2@@ -33,7 +33,7 @@ int mlx5_shd_init(struct mlx5_core_dev *dev) start =pci_vpd_find_ro_info_keyword (vpd_data, vpd_size,PCI_VPD_RO_KEYWORD_SERIALNO , &kw_len);if (start <0 ) -return -ENOENT ; +return 0 ;/* No usable serial number found, ignore. */ } sn =kstrndup (vpd_data + start, kw_len,GFP_KERNEL );if (!sn) --
Quoted 2 lines
2.51.1
Tested before and after on the Ampere Server, and the applied fix worked.
Thanks!
Ben
Quoted 6 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
On some HW, not even fall-back "SERIALNO" is found in VPD data. Unify the behavior with the case there are no VPD data at all and avoid creation of shared devlink instance.
Quoted 6 lines
Fixes 2a8c8a03f306 ("net/mlx5: Add a shared devlink instance for PFs on same chip")Reported-by Adam Young <[email protected]>Reported-by Ben Copeland <[email protected]>Signed-off-by Jiri Pirko <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Wed, 25 Mar 2026 16:28:01 +0100 you wrote:
From: Jiri Pirko <[email protected]>
On some HW, not even fall-back "SERIALNO" is found in VPD data. Unify the behavior with the case there are no VPD data at all and avoid creation of shared devlink instance.
Quoted 8 lines
Fixes 2a8c8a03f306 ("net/mlx5: Add a shared devlink instance for PFs on same chip")Reported-by Adam Young <[email protected]>Reported-by Ben Copeland <[email protected]>Signed-off-by Jiri Pirko <[email protected]>[...]
Here is the summary with links:
- [net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
https://git.kernel.org/netdev/net-next/c/b8f9410aefc1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html