public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
@ 2026-03-25 15:28 Jiri Pirko
  2026-03-27  8:56 ` Ben Copeland
  2026-03-27 10:42 ` Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2026-03-25 15:28 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, andrew+netdev, saeedm, leon,
	tariqt, mbloch, admiyo, ben.copeland

From: Jiri Pirko <jiri@nvidia.com>

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 <admiyo@amperemail.onmicrosoft.com>
Closes: https://lore.kernel.org/all/bab5b6bc-aa42-4af1-80d1-e56bcef06bc2@amperemail.onmicrosoft.com/
Reported-by: Ben Copeland <ben.copeland@linaro.org>
Closes: https://lore.kernel.org/all/20260324151014.860376-1-ben.copeland@linaro.org/
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
index bc33f95302df..b925364765ac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
@@ -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)
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
  2026-03-25 15:28 [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found Jiri Pirko
@ 2026-03-27  8:56 ` Ben Copeland
  2026-03-27 10:42 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Copeland @ 2026-03-27  8:56 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, davem, edumazet, kuba, pabeni, andrew+netdev, saeedm,
	leon, tariqt, mbloch, admiyo

On Wed, 25 Mar 2026 at 15:28, Jiri Pirko <jiri@resnulli.us> wrote:
>
> From: Jiri Pirko <jiri@nvidia.com>
>
> 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 <admiyo@amperemail.onmicrosoft.com>
> Closes: https://lore.kernel.org/all/bab5b6bc-aa42-4af1-80d1-e56bcef06bc2@amperemail.onmicrosoft.com/
> Reported-by: Ben Copeland <ben.copeland@linaro.org>
> Closes: https://lore.kernel.org/all/20260324151014.860376-1-ben.copeland@linaro.org/
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
> index bc33f95302df..b925364765ac 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c
> @@ -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)
> --
> 2.51.1
>


Tested-by: Ben Copeland <ben.copeland@linaro.org>

Tested before and after on the Ampere Server, and the applied fix worked.

Thanks!

Ben

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found
  2026-03-25 15:28 [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found Jiri Pirko
  2026-03-27  8:56 ` Ben Copeland
@ 2026-03-27 10:42 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-03-27 10:42 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, davem, edumazet, kuba, pabeni, andrew+netdev, saeedm,
	leon, tariqt, mbloch, admiyo, ben.copeland

On Wed, Mar 25, 2026 at 04:28:01PM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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 <admiyo@amperemail.onmicrosoft.com>
> Closes: https://lore.kernel.org/all/bab5b6bc-aa42-4af1-80d1-e56bcef06bc2@amperemail.onmicrosoft.com/
> Reported-by: Ben Copeland <ben.copeland@linaro.org>
> Closes: https://lore.kernel.org/all/20260324151014.860376-1-ben.copeland@linaro.org/
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-27 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 15:28 [PATCH net-next] mlx5: shd: Gracefully avoid shared devlink creation when no usable SN is found Jiri Pirko
2026-03-27  8:56 ` Ben Copeland
2026-03-27 10:42 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox