Skip to content

devlink: move common flash_update calls to core

Jacob Keller netdev 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyApplied
  2. v32 patches 7 repliesSuperseded
  3. v21 patch 3 repliesSuperseded

Changes in v4 from the cover letter

* picked up acked-by and reviewed-by comments
* fixed the ionic driver to leave the print statement in place

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2devlink: move request_firmware out of driverdrivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h +12 more+62 -950 replies
2/2devlink: move flash end and begin to core devlinkdrivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c drivers/net/ethernet/intel/ice/ice_devlink.c drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +4 more+7 -190 replies

Reviews trailers per patch

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

PatchShannon NelsonVasundhara VolamJiri Pirko
1/2A-b A-b R-b
2/2A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [net-next v4 0/2] devlink: move common flash_update calls to core

This series moves a couple common pieces done by all drivers of the ->flash_update interface into devlink.c flash update handler. Specifically, the core code will now request_firmware and devlink_flash_update_(begin|end)_notify.

This cleanup is intended to simplify driver implementations so that they have less work to do and are less capable of doing the "wrong" thing.

For request_firmware, this simplification is done as it is not expected that drivers would do anything else. It also standardizes all drivers so that they use the same interface (request_firmware, as opposed to request_firmware_direct), and allows reporting the netlink extended ack with the file name attribute.

For status notification, this change prevents drivers from sending a status message without properly sending the status end notification. The current userspace implementation of devlink relies on this end notification to properly close the flash update channel. Without this, the flash update process may hang indefinitely. By moving the begin and end calls into the core code, it is no longer possible for a driver author to get this wrong.

Changes since v3
* picked up acked-by and reviewed-by comments
* fixed the ionic driver to leave the print statement in place

For the original patch that moved request_firmware, see [1]. For the v2 see [2]. For further discussion of the issues with devlink flash status see [3]. For v3 see [4].

Cc Jiri Pirko <[email protected]>
Cc Michael Chan <[email protected]>
Cc Shannon Nelson <[email protected]>
Cc Saeed Mahameed <[email protected]>
Cc Boris Pismenny <[email protected]>
Cc Bin Luo <[email protected]>
Cc Jakub Kicinksi <[email protected]>

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/
[3] https://lore.kernel.org/netdev/[email protected]/
[4] https://lore.kernel.org/netdev/[email protected]/

Jacob Keller (2):
devlink: move request_firmware out of driver
devlink: move flash end and begin to core devlink

 .../net/ethernet/broadcom/bnxt/bnxt_devlink.c |  4 +--
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 33 +++++++++++------
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.h |  4 +--
 .../net/ethernet/huawei/hinic/hinic_devlink.c | 12 +------
 drivers/net/ethernet/intel/ice/ice_devlink.c  | 17 +--------
 .../net/ethernet/mellanox/mlx5/core/devlink.c | 11 +-----
 .../net/ethernet/mellanox/mlxfw/mlxfw_fsm.c   |  3 --
 drivers/net/ethernet/mellanox/mlxsw/core.c    | 11 +-----
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  2 +-
 drivers/net/ethernet/netronome/nfp/nfp_main.c | 17 ++-------
 drivers/net/ethernet/netronome/nfp/nfp_main.h |  2 +-
 .../ethernet/pensando/ionic/ionic_devlink.c   |  2 +-
 .../ethernet/pensando/ionic/ionic_devlink.h   |  2 +-
 .../net/ethernet/pensando/ionic/ionic_fw.c    | 14 ++------
 drivers/net/netdevsim/dev.c                   |  2 --
 include/net/devlink.h                         |  9 +++--
 net/core/devlink.c                            | 36 ++++++++++++++-----
 17 files changed, 68 insertions(+), 113 deletions(-)

base-commit: ed30aef3c864f99111e16d4ea5cf29488d99a278

Signature · 1 line
2.29.0