History

devlink: add flash update command

Add devlink flash update command. Advanced NICs have firmware stored in flash and often cryptographically secured. Updating that flash is handled by management firmware. Ethtool has a flash update command which served us well, however, it has two shortcomings: - it takes rtnl_lock unnecessarily - really flash update has nothing to do with networking, so using a networking device as a handle is suboptimal, which leads us to the second one: - it requires a functioning netdev - in case device enters an error state and can't spawn a netdev (e.g. communication with the device fails) there is no netdev to use as a handle for flashing. Devlink already has the ability to report the firmware versions, now with the ability to update the firmware/flash we will be able to recover devices in bad state. To enable updates of sub-components of the FW allow passing component name. This name should correspond to one of the versions reported in devlink info. v1: - replace target id with component name (Jiri).

Jakub Kicinski committed 7 years ago

Commit 76726cc1 parent 8e31c473 files · +39 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/devlink.h+6−0
@@ -103,6 +103,8 @@ enum devlink_command { · 102 unmodified lines
103103 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
104104 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR,
105105
106+ DEVLINK_CMD_FLASH_UPDATE,
107+
106108 /* add new commands above here */
107109 __DEVLINK_CMD_MAX,
108110 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
@@ -326,6 +328,10 @@ enum devlink_attr { · 217 unmodified lines
326328 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS, /* u64 */
327329 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD, /* u64 */
328330 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, /* u8 */
331+
332+ DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME, /* string */
333+ DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, /* string */
334+
329335 /* add new attributes above here, update the policy in devlink.c */
330336
331337 __DEVLINK_ATTR_MAX,