[Intel-wired-lan] [iproute2-next v2 0/3] devlink: support dry run attribute for flash update

Jacob Keller jacob.e.keller at intel.com
Thu Jul 21 21:14:48 UTC 2022


Allow users to request a dry run of a flash update by adding the
DEVLINK_ATTR_DRY_RUN.

Because many devlink commands do not validate and reject unknown attributes,
this could have unexpected side effects on older kernels which lack the
attribute. To handle this, check the socket and determine the maximum
attribute the kernel supports. Only allow passing the DEVLINK_ATTR_DRY_RUN
for kernels which have the attribute.

This allows a user to validate that a flash update will be accepted by the
driver and device without being forced to commit to updating.

Changes since v1
* Add Cc for maintainers
* Make dl_kernel_supports_dry_run more generic

Cc: Jacob Keller <jacob.e.keller at intel.com>
Cc: Jonathan Corbet <corbet at lwn.net>
Cc: Jiri Pirko <jiri at nvidia.com>
Cc: "David S. Miller" <davem at davemloft.net>
Cc: Eric Dumazet <edumazet at google.com>
Cc: Jakub Kicinski <kuba at kernel.org>
Cc: Paolo Abeni <pabeni at redhat.com>
Cc: Tony Nguyen <anthony.l.nguyen at intel.com>
Cc: David Ahern <dsahern at kernel.org>
Cc: Stephen Hemminger <stephen at networkplumber.org>
Cc: linux-doc at vger.kernel.org
Cc: netdev at vger.kernel.org
Cc: intel-wired-lan at lists.osuosl.org

Jacob Keller (3):
  update <linux/devlink.h> UAPI header
  mnlg: add function to get CTRL_ATTR_MAXATTR value
  devlink: add dry run attribute support to devlink flash

 devlink/devlink.c            | 45 +++++++++++++++++++++++++++--
 devlink/mnlg.c               | 56 ++++++++++++++++++++++++++++++++++++
 devlink/mnlg.h               |  1 +
 include/uapi/linux/devlink.h |  8 ++++++
 4 files changed, 108 insertions(+), 2 deletions(-)


base-commit: 4cb0bec3744ac4f8d21de0e769f170e4059c6b9e
-- 
2.36.1



More information about the Intel-wired-lan mailing list