diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-02-14 22:40:44 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-18 00:27:38 +0100 |
commit | 76726ccb7f461c83040e7082cf95fe1dea2afd1f (patch) | |
tree | b81d374cbf4754f6f448fe1c1b34ed15a472a711 /include/net/devlink.h | |
parent | Merge branch 'net-phy-improve-and-use-phy_resolve_aneg_linkmode' (diff) | |
download | linux-76726ccb7f461c83040e7082cf95fe1dea2afd1f.tar.xz linux-76726ccb7f461c83040e7082cf95fe1dea2afd1f.zip |
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).
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r-- | include/net/devlink.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index c6d88759b7d5..18d7a051f412 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -521,6 +521,9 @@ struct devlink_ops { struct netlink_ext_ack *extack); int (*info_get)(struct devlink *devlink, struct devlink_info_req *req, struct netlink_ext_ack *extack); + int (*flash_update)(struct devlink *devlink, const char *file_name, + const char *component, + struct netlink_ext_ack *extack); }; static inline void *devlink_priv(struct devlink *devlink) |