Skip to contentSkip to conversation

mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found

PATCH Applied Jiri Pirko 4 participants 4 messages Mar 25 – Mar 28

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

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
index bc33f95302df..b925364765ac 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw
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.

---
 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
index bc33f95302df..b925364765ac 100644
@@ -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

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Jiri Pirko
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
#3 lore raw
In reply to Jiri Pirko
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

[...]

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