lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 31 Jul 2020 17:21:54 -0700
From:   Jacob Keller <>
Cc:     Jacob Keller <>,
        Jiri Pirko <>,
        Jakub Kicinski <>,
        Jonathan Corbet <>,
        Michael Chan <>,
        Bin Luo <>,
        Saeed Mahameed <>,
        Leon Romanovsky <>,
        Ido Schimmel <>,
        Danielle Ratson <>
Subject: [net-next v2 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 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.

First, the .flash_update command is modified to take a parameter structure.
A new supported_flash_update_params field is also provided to allow drivers
to opt-in to the parameters they support rather than opting out. This is
similar to the recently added supported_coalesc_params field in ethtool.

Following this, the new overwrite mask parameter is added, along with the
associated supported bit. The netdevsim driver is updated to support this
parameter, along with a few self tests to help verify the interface is
working as expected.

Finally, the ice driver is modified to support the parameter, converting it
into the firmware preservation level request.

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".

Changes since v1
* Added supported_flash_update_params field, removing some boilerplate in
  each driver. This also makes it easier to add new parameters in the future
  without fear of accidentally breaking an existing driver, due to opt-in
  behavior instead of forcing drivers to opt-out.
* Split the ice changes to a separate patch.

Cc: Jiri Pirko <>
Cc: Jakub Kicinski <>
Cc: Jonathan Corbet <>
Cc: Michael Chan <>
Cc: Bin Luo <>
Cc: Saeed Mahameed <>
Cc: Leon Romanovsky <>
Cc: Ido Schimmel <>
Cc: Danielle Ratson <>

Jacob Keller (3):
  devlink: convert flash_update to use params structure
  devlink: introduce flash update overwrite mask
  ice: add support for flash update overwrite mask

 .../networking/devlink/devlink-flash.rst      | 29 ++++++++++++++
 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  | 33 +++++++++++-----
 .../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    |  6 +--
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  2 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  7 +---
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  9 ++---
 drivers/net/netdevsim/dev.c                   | 21 +++++++---
 drivers/net/netdevsim/netdevsim.h             |  1 +
 include/net/devlink.h                         | 35 ++++++++++++++++-
 include/uapi/linux/devlink.h                  | 24 ++++++++++++
 net/core/devlink.c                            | 39 +++++++++++++++----
 .../drivers/net/netdevsim/          | 21 ++++++++++
 18 files changed, 244 insertions(+), 67 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: bd69058f50d5ffa659423bcfa6fe6280ce9c760a

Powered by blists - more mailing lists