This series introduces support for a new attribute to the flash update command: DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK. This attribute is a u32 value that represents a bitmask of which subsections of flash to request/allow overwriting when performing a flash update.
The intent is to support the ability to control overwriting options of the ice hardware flash update. Specifically, the ice flash components combine settings and identifiers within the firmware flash section. This series introduces the two subsections, "identifiers" and "settings". With the new attribute, users can request to overwrite these subsections when performing a flash update. By existing convention, it is assumed that flash program binaries are always updated (and thus overwritten), and no mask bit is provided to control this. I updated the .flash_update command to take a new parameters structure, and pass the new overwrite mask through there. All existing drivers besides ice and netdevsim are updated to always reject the overwrite mask. netdevsim gains a new debugfs knob to set what overwrite values the flash update command should accept. I added some simple tests to the devlink.sh test file to help verify the interface works. Patches to enable support for specifying the overwrite sections are also provided for iproute2-next. This is done primarily in order to enable the tests for netdevsim. As discussed previously on the list, the primary motivations for the overwrite mode are two-fold. First, supporting update with a customized image that has pre-configured settings and identifiers, used with overwrite of both settings and identifiers. This enables an initial update to overwrite default values and customize the adapter with a new serial ID and fresh settings. Second, it may sometimes be useful to allow overwriting of settings when updating in order to guarantee that the settings in the flash section are "known good". The first two patches are for net-next, and the latter two patches are for iproute2-next. (Note I expect the first iproute2 patch to be replaced by the usual update of headers after the new attribute is merged). Cc: Jiri Pirko <j...@mellanox.com> Cc: Jakub Kicinski <k...@kernel.org> Cc: Jonathan Corbet <cor...@lwn.net> Cc: Michael Chan <michael.c...@broadcom.com> Cc: Bin Luo <luob...@huawei.com> Cc: Saeed Mahameed <sae...@mellanox.com> Cc: Leon Romanovsky <l...@kernel.org> Cc: Ido Schimmel <ido...@mellanox.com> Cc: Danielle Ratson <daniel...@mellanox.com> Jacob Keller (2): devlink: convert flash_update to use params structure devlink: introduce flash update overwrite mask .../networking/devlink/devlink-flash.rst | 29 ++++++++++++++++ Documentation/networking/devlink/ice.rst | 31 +++++++++++++++++ .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 15 ++++---- .../net/ethernet/huawei/hinic/hinic_devlink.c | 7 ++-- drivers/net/ethernet/intel/ice/ice_devlink.c | 34 ++++++++++++++----- .../net/ethernet/intel/ice/ice_fw_update.c | 16 +++++++-- .../net/ethernet/intel/ice/ice_fw_update.h | 2 +- .../net/ethernet/mellanox/mlx5/core/devlink.c | 7 ++-- drivers/net/ethernet/mellanox/mlxsw/core.c | 6 ++-- drivers/net/ethernet/mellanox/mlxsw/core.h | 2 +- .../net/ethernet/mellanox/mlxsw/spectrum.c | 6 ++-- .../net/ethernet/netronome/nfp/nfp_devlink.c | 9 ++--- drivers/net/netdevsim/dev.c | 19 +++++++---- drivers/net/netdevsim/netdevsim.h | 1 + include/net/devlink.h | 15 ++++++-- include/uapi/linux/devlink.h | 24 +++++++++++++ net/core/devlink.c | 23 +++++++++---- .../drivers/net/netdevsim/devlink.sh | 18 ++++++++++ 18 files changed, 210 insertions(+), 54 deletions(-) Jacob Keller (2): Update devlink header for overwrite mask attribute devlink: support setting the overwrite mask devlink/devlink.c | 37 ++++++++++++++++++++++++++++++++++-- include/uapi/linux/devlink.h | 24 +++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) base-commit: 41d707b7332f1386642c47eb078110ca368a46f5 -- 2.28.0.163.g6104cc2f0b60