Thread (14 messages) 14 messages, 2 authors, 2025-11-18

Re: [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set

From: Daniel Zahka <daniel.zahka@gmail.com>
Date: 2025-11-18 14:05:26
Also in: linux-doc, linux-rdma


On 11/18/25 2:27 AM, Loktionov, Aleksandr wrote:
quoted
diff --git a/include/uapi/linux/devlink.h
b/include/uapi/linux/devlink.h index 157f11d3fb72..e7d6b6d13470 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -639,6 +639,9 @@ enum devlink_attr {

  	DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD,	/* u64 */

+	DEVLINK_ATTR_PARAM_VALUE_DEFAULT,	/* dynamic */
+	DEVLINK_ATTR_PARAM_RESET_DEFAULT,	/* flag */
+
The patch introduces a new UAPI attribute DEVLINK_ATTR_PARAM_VALUE_DEFAULT but Documentation/netlink/specs/devlink.yaml only documents param-reset-default.
The spec should also describe the output attribute that appears in the nested param-value dump ("default" value), otherwise the generated tooling/specs are out of sync with UAPI and the committed generated C (netlink_gen.c).

I'm afraid you forgot to add a YAML entry for the nested attribute (e.g. under the param-value attribute set, typically alongside param-value-data and param-value-cmode), describing its type per param and the bool/u8 encoding rule covered in the commit message.
Am I right?
Hello. Thank you for the review.

As I understand it, devlink.yaml omits entries of enum devlink_attr that 
are annotated as "dynamic". This is what creates two of the holes in the 
devlink attribute set in devlink.yaml where the "TODO: fill in the 
attributes in between" comments appear. Dynamic types are basically 
tagged unions, where the tag is held by a different attribute: 
DEVLINK_ATTR_PARAM_TYPE. The netlink yaml schema doesn't have a good way 
to encode this. That is why param-value-data, and now 
param-value-default cannot be in devlink.yaml. The best that could be 
done for now would probably be to add them with 'type: binary'.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help