Thread (30 messages) 30 messages, 4 authors, 2022-08-05

Re: [net-next PATCH 1/2] devlink: add dry run attribute to flash update

From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-07-22 06:18:53

Thu, Jul 21, 2022 at 10:32:25PM CEST, jacob.e.keller@intel.com wrote:
quoted
-----Original Message-----
From: Jiri Pirko <jiri@resnulli.us>
Sent: Wednesday, July 20, 2022 10:55 PM
To: Keller, Jacob E <jacob.e.keller@intel.com>
Cc: netdev@vger.kernel.org; Jakub Kicinski <kuba@kernel.org>
Subject: Re: [net-next PATCH 1/2] devlink: add dry run attribute to flash update
<...>
quoted
quoted
struct devlink_region;
struct devlink_info_req;
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index b3d40a5d72ff..e24a5a808a12 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -576,6 +576,14 @@ enum devlink_attr {
	DEVLINK_ATTR_LINECARD_TYPE,		/* string */
	DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES,	/* nested */

+	/* Before adding this attribute to a command, user space should check
+	 * the policy dump and verify the kernel recognizes the attribute.
+	 * Otherwise older kernels which do not recognize the attribute may
+	 * silently accept the unknown attribute while not actually performing
+	 * a dry run.
Why this comment is needed? Isn't that something generic which applies
to all new attributes what userspace may pass and kernel may ignore?
Because other attributes may not have such a negative and unexpected side effect. In most cases the side effect will be "the thing you wanted doesn't happen", but in this case its "the thing you didn't want to happen does". I think that deserves some warning. A dry run is a request to *not* do something.
Hmm. Another option, in order to be on the safe side, would be to have a
new cmd for this...

Thanks,
Jake
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help