ethtool: Add an interface for flashing transceiver modules' firmware

CMIS compliant modules such as QSFP-DD might be running a firmware that
can be updated in a vendor-neutral way by exchanging messages between
the host and the module as described in section 7.3.1 of revision 5.2 of
the CMIS standard.

Add a pair of new ethtool messages that allow:

* User space to trigger firmware update of transceiver modules

* The kernel to notify user space about the progress of the process

The user interface is designed to be asynchronous in order to avoid
RTNL being held for too long and to allow several modules to be
updated simultaneously. The interface is designed with CMIS compliant
modules in mind, but kept generic enough to accommodate future use
cases, if these arise.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Danielle Ratson
2024-06-27 17:08:50 +03:00
committed by David S. Miller
parent 1983a80070
commit 46fb3ba95b
5 changed files with 164 additions and 1 deletions
+18
View File
@@ -877,6 +877,24 @@ enum ethtool_mm_verify_status {
ETHTOOL_MM_VERIFY_STATUS_DISABLED,
};
/**
* enum ethtool_module_fw_flash_status - plug-in module firmware flashing status
* @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has
* started.
* @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process
* is in progress.
* @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was
* completed successfully.
* @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was
* stopped due to an error.
*/
enum ethtool_module_fw_flash_status {
ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1,
ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS,
ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED,
ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR,
};
/**
* struct ethtool_gstrings - string set for data tagging
* @cmd: Command number = %ETHTOOL_GSTRINGS