Commit 716425d6 authored by Danielle Ratson's avatar Danielle Ratson Committed by Jakub Kicinski

net: ethtool: Enhance error messages sent to user space

During the firmware flashing process, notifications are sent to user
space to provide progress updates. When an error occurs, an error
message is sent to indicate what went wrong.

In some cases, appropriate error messages are missing.

Add relevant error messages where applicable, allowing user space to better
understand the issues encountered.
Signed-off-by: default avatarDanielle Ratson <danieller@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240910091044.3044568-1-danieller@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 65037349
...@@ -100,7 +100,8 @@ static u8 cmis_cdb_advert_rpl_inst_supported(struct cmis_cdb_advert_rpl *rpl) ...@@ -100,7 +100,8 @@ static u8 cmis_cdb_advert_rpl_inst_supported(struct cmis_cdb_advert_rpl *rpl)
} }
static int cmis_cdb_advertisement_get(struct ethtool_cmis_cdb *cdb, static int cmis_cdb_advertisement_get(struct ethtool_cmis_cdb *cdb,
struct net_device *dev) struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *ntf_params)
{ {
const struct ethtool_ops *ops = dev->ethtool_ops; const struct ethtool_ops *ops = dev->ethtool_ops;
struct ethtool_module_eeprom page_data = {}; struct ethtool_module_eeprom page_data = {};
...@@ -119,8 +120,12 @@ static int cmis_cdb_advertisement_get(struct ethtool_cmis_cdb *cdb, ...@@ -119,8 +120,12 @@ static int cmis_cdb_advertisement_get(struct ethtool_cmis_cdb *cdb,
return err; return err;
} }
if (!cmis_cdb_advert_rpl_inst_supported(&rpl)) if (!cmis_cdb_advert_rpl_inst_supported(&rpl)) {
ethnl_module_fw_flash_ntf_err(dev, ntf_params,
"CDB functionality is not supported",
NULL);
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
cdb->read_write_len_ext = rpl.read_write_len_ext; cdb->read_write_len_ext = rpl.read_write_len_ext;
...@@ -282,7 +287,7 @@ ethtool_cmis_cdb_init(struct net_device *dev, ...@@ -282,7 +287,7 @@ ethtool_cmis_cdb_init(struct net_device *dev,
goto err; goto err;
} }
err = cmis_cdb_advertisement_get(cdb, dev); err = cmis_cdb_advertisement_get(cdb, dev, ntf_params);
if (err < 0) if (err < 0)
goto err; goto err;
...@@ -444,6 +449,9 @@ static void cmis_cdb_status_fail_msg_get(u8 status, char **err_msg) ...@@ -444,6 +449,9 @@ static void cmis_cdb_status_fail_msg_get(u8 status, char **err_msg)
case 0b01000101: case 0b01000101:
*err_msg = "CDB status failed: CdbChkCode error"; *err_msg = "CDB status failed: CdbChkCode error";
break; break;
case 0b01000110:
*err_msg = "CDB status failed: Password error";
break;
default: default:
*err_msg = "Unknown failure reason"; *err_msg = "Unknown failure reason";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment