diff mbox series

[net-next,09/13] netlink: specs: devlink: add missing param attribute definitions

Message ID 20240219172525.71406-10-jiri@resnulli.us (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series netlink: specs: devlink: add the rest of missing attribute definitions | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl fail Generated files up to date; build failed; build has 3 warnings/errors; GEN HAS DIFF 2 files changed, 12648 deletions(-);
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 137 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-19--21-00 (tests: 1357)

Commit Message

Jiri Pirko Feb. 19, 2024, 5:25 p.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

Add missing values list attribute and all nested attributes definition,
including param-value-data. For this one, use newly introduced
sub-message replace-attribute infrastructure to allow to process
attribute type selected by param-value-type.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 Documentation/netlink/specs/devlink.yaml | 108 +++++++++++++++++++++--
 1 file changed, 102 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml
index 88abe137c8ef..71a95163c419 100644
--- a/Documentation/netlink/specs/devlink.yaml
+++ b/Documentation/netlink/specs/devlink.yaml
@@ -515,14 +515,24 @@  attribute-sets:
         name: param-type
         type: u8
         enum: param-type
-
-      # TODO: fill in the attributes in between
-
+      -
+        name: param-values-list
+        type: nest
+        nested-attributes: dl-param-values-list
+      -
+        name: param-value
+        type: nest
+        multi-attr: true
+        nested-attributes: dl-param-value
+      -
+        name: param-value-data
+        type: sub-message
+        sub-message: dl-param-value-data-msg
+        selector: param-type
       -
         name: param-value-cmode
         type: u8
         enum: param-cmode
-        value: 87
       -
         name: region-name
         type: string
@@ -1131,8 +1141,24 @@  attribute-sets:
         name: param-generic
       -
         name: param-type
+      -
+        name: param-values-list
+
+  -
+    name: dl-param-values-list
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value
 
-      # TODO: fill in the attribute param-value-list
+  -
+    name: dl-param-value
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+      -
+        name: param-value-cmode
 
   -
     name: dl-region-snapshots
@@ -1243,6 +1269,71 @@  attribute-sets:
         name: flash
         type: flag
 
+  -
+    name: dl-param-value-data-u8-attrs
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+        type: u8
+
+  -
+    name: dl-param-value-data-u16-attrs
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+        type: u16
+
+  -
+    name: dl-param-value-data-u32-attrs
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+        type: u32
+
+  -
+    name: dl-param-value-data-string-attrs
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+        type: string
+
+  -
+    name: dl-param-value-data-flag-attrs
+    subset-of: devlink
+    attributes:
+      -
+        name: param-value-data
+        type: flag
+
+sub-messages:
+  -
+    name: dl-param-value-data-msg
+    formats:
+      -
+        value: u8
+        attribute-set: dl-param-value-data-u8-attrs
+        attribute-replace: true
+      -
+        value: u16
+        attribute-set: dl-param-value-data-u16-attrs
+        attribute-replace: true
+      -
+        value: u32
+        attribute-set: dl-param-value-data-u32-attrs
+        attribute-replace: true
+      -
+        value: string
+        attribute-set: dl-param-value-data-string-attrs
+        attribute-replace: true
+      -
+        value: flag
+        attribute-set: dl-param-value-data-flag-attrs
+        attribute-replace: true
+
 operations:
   enum-model: directional
   list:
@@ -1731,7 +1822,12 @@  operations:
             - dev-name
             - param-name
         reply: &param-get-reply
-          attributes: *param-id-attrs
+          attributes:
+            - bus-name
+            - dev-name
+            - param-name
+            - param-type
+            - param-values-list
       dump:
         request:
           attributes: *dev-id-attrs