Re: [iproute2-next v3 3/3] devlink: add dry run attribute support to devlink flash
From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-07-26 07:48:00
Also in:
linux-doc
From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-07-26 07:48:00
Also in:
linux-doc
Mon, Jul 25, 2022 at 10:56:50PM CEST, jacob.e.keller@intel.com wrote:
Recent versions of the kernel support the DEVLINK_ATTR_DRY_RUN attribute which allows requesting a dry run of a command. A dry run is simply a request to validate that a command would work, without performing any destructive changes. The attribute is supported by the devlink flash update as a way to validate an update, including potentially the binary image, without modifying the device. Add a "dry_run" option to the command line parsing which will enable this attribute when requested. To avoid potential issues, only allow the attribute to be added to commands when the kernel recognizes it. This is important because some commands do not perform strict validation. If we were to add the attribute without this check, an old kernel may silently accept the command and perform an update even when dry_run was requested. Before adding the attribute, check the maximum attribute from the CTRL_CMD_GETFAMILY and make sure that the kernel recognizes the DEVLINK_ATTR_DRY_RUN attribute. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jiri Pirko <redacted>