summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGal Pressman <gal@nvidia.com>2024-08-08 08:59:25 +0300
committerJakub Kicinski <kuba@kernel.org>2024-08-09 22:13:15 -0700
commitb5100b72da688282558b28255c03a2d72241a729 (patch)
treef69ac271b66b25d158795365f44e38246ab8570c
parent9c4298b466b19651203c8c8847fcbfe3e37ef6b7 (diff)
downloadlinux-b5100b72da688282558b28255c03a2d72241a729.tar.gz
linux-b5100b72da688282558b28255c03a2d72241a729.zip
net/mlx5e: Use extack in get module eeprom by page callback
In case of errors in get module eeprom by page, reflect it through extack instead of a dmesg print. While at it, make the messages more human friendly. Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20240808055927.2059700-10-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index c14a5542ae9c..56bdb4d07b7a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -2015,8 +2015,10 @@ static int mlx5e_get_module_eeprom_by_page(struct net_device *netdev,
if (size_read == -EINVAL)
return -EINVAL;
if (size_read < 0) {
- netdev_err(priv->netdev, "%s: mlx5_query_module_eeprom_by_page failed:0x%x\n",
- __func__, size_read);
+ NL_SET_ERR_MSG_FMT_MOD(
+ extack,
+ "Query module eeprom by page failed, read %u bytes, err %d\n",
+ i, size_read);
return i;
}