Skip to content

devlink flash update overwrite mask

Jacob Keller netdev 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest5 patches 1 replyIn review
  2. v74 of 5 patches 1 replySuperseded
  3. v65 patches 4 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v55 patches3 repliesSuperseded
v4 posting 2/22 patches2 repliesSuperseded
v4 posting 1/25 patches14 repliesSuperseded
v3 posting 2/22 patches0 repliesSuperseded
v3 posting 1/24 patches8 repliesSuperseded
v25 patches14 repliesSuperseded
v14 patches2 repliesSuperseded

Changes since v9 from the cover letter

* rebased to current net-next, no other changes

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5devlink: check flash_update parameter support in net coredrivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c drivers/net/ethernet/huawei/hinic/hinic_devlink.c drivers/net/ethernet/intel/ice/ice_devlink.c +7 more+34 -320 replies
2/5devlink: convert flash_update to use params structuredrivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c drivers/net/ethernet/huawei/hinic/hinic_devlink.c drivers/net/ethernet/intel/ice/ice_devlink.c +8 more+57 -400 replies
3/5devlink: introduce flash update overwrite maskDocumentation/networking/devlink/devlink-flash.rst include/net/devlink.h include/uapi/linux/devlink.h +1 more+70 -20 replies
4/5netdevsim: add support for flash_update overwrite maskdrivers/net/netdevsim/dev.c drivers/net/netdevsim/netdevsim.h tools/testing/selftests/drivers/net/netdevsim/devlink.sh+28 -10 replies
5/5ice: add support for flash update overwrite maskDocumentation/networking/devlink/ice.rst drivers/net/ethernet/intel/ice/ice_devlink.c drivers/net/ethernet/intel/ice/ice_fw_update.c +1 more+64 -40 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchJakub Kicinski
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

Cover letter [net-next v9 0/5] devlink flash update overwrite mask

This series introduces support for a new attribute to the flash update
command: DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK.

This attribute is a bitfield which allows userspace to specify what set of subfields to overwrite when performing a flash update for a device.

The intention is to support the ability to control the behavior of overwriting the configuration and identifying fields in the Intel ice device flash update process. This is necessary as the firmware layout for the ice device includes some settings and configuration within the same flash section as the main firmware binary.

This series, and the accompanying iproute2 series, introduce support for the attribute. Once applied, the overwrite support can be be invoked via devlink:

  # overwrite settings
  devlink dev flash pci/0000:af:00.0 file firmware.bin overwrite settings
  # overwrite identifiers and settings
  devlink dev flash pci/0000:af:00.0 file firmware.bin overwrite settings overwrite identifiers

To aid in the safe addition of new parameters, first some refactoring is done to the .flash_update function: its parameters are converted from a series of function arguments into a structure. This makes it easier to add the new parameter without changing the signature of the .flash_update handler in the future. Additionally, a "supported_flash_update_params" field is added to devlink_ops. This field is similar to the ethtool "supported_coalesc_params" field. The devlink core will now check that the DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT bit is set before forwarding the component attribute. Similarly, the new overwrite attribute will also require a supported bit.

Doing these refactors will aid in adding any other attributes in the future, and creates a good pattern for other interfaces to use in the future. By requiring drivers to opt-in, we reduce the risk of accidentally breaking drivers when ever we add an additional parameter. We also reduce boiler plate code in drivers which do not support the parameters.

Cc Jiri Pirko <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Michael Chan <[email protected]>
Cc Bin Luo <[email protected]>
Cc Saeed Mahameed <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Ido Schimmel <[email protected]>
Cc Danielle Ratson <[email protected]>
Cc Shannon Nelson <[email protected]>

Changes since v9:
* rebased to current net-next, no other changes

Changes since v7
* resend, hopefully avoiding the SMTP server issues I experienced on Friday

Changes since v6
* Rebased to current net-next to resolve conflicts
* Added changes to the ionic driver that recently merged flash update support
* Fixed the changes for mlxsw to apply to core instead of spectrum.c after the recent refactor.
* Picked up the review tags from Jakub

Changes since v5
* Fix *all* of the BIT usage to use _BITUL() (thanks Jakub!)

Changes since v4
* Renamed nla_overwrite to nla_overwrite_mask at Jiri's suggestion
* Added "by this device" to the netlink error messages for unsupported attributes
* Removed use of BIT() in the uapi header
* Fixed the commit message for the netdevsim patch
* Picked up Jakub's reviewed
Jacob Keller (5):
devlink: check flash_update parameter support in net core
devlink: convert flash_update to use params structure
devlink: introduce flash update overwrite mask
netdevsim: add support for flash_update overwrite mask
ice: add support for flash update overwrite mask

 .../networking/devlink/devlink-flash.rst      | 28 +++++++++++++
 Documentation/networking/devlink/ice.rst      | 31 ++++++++++++++
 .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 19 ++++-----
 .../net/ethernet/huawei/hinic/hinic_devlink.c |  8 +---
 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 |  8 +---
 drivers/net/ethernet/mellanox/mlxsw/core.c    | 12 ++----
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  9 ++--
 .../ethernet/pensando/ionic/ionic_devlink.c   |  8 +---
 drivers/net/netdevsim/dev.c                   | 23 ++++++----
 drivers/net/netdevsim/netdevsim.h             |  1 +
 include/net/devlink.h                         | 35 +++++++++++++++-
 include/uapi/linux/devlink.h                  | 23 ++++++++++
 net/core/devlink.c                            | 42 +++++++++++++++----
 .../drivers/net/netdevsim/devlink.sh          | 21 ++++++++++
 17 files changed, 247 insertions(+), 73 deletions(-)

base-commit: 7806f6561cd51de382f7628e7f4ecef4568d88da

Signature · 1 line
2.28.0.497.g54e85e7af1ac