Thread (16 messages) 16 messages, 2 authors, 2024-03-07

Re: [PATCH net-next v2 5/5] doc/netlink/specs: Add spec for nlctrl netlink family

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-03-06 18:31:16

On Wed,  6 Mar 2024 12:57:04 +0000 Donald Hunter wrote:
quoted hunk ↗ jump to hunk
diff --git a/Documentation/netlink/specs/nlctrl.yaml b/Documentation/netlink/specs/nlctrl.yaml
new file mode 100644
index 000000000000..2e55e61aea11
--- /dev/null
+++ b/Documentation/netlink/specs/nlctrl.yaml
@@ -0,0 +1,206 @@
+# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
+
+name: nlctrl
+protocol: genetlink-legacy
+uapi-header: linux/genetlink.h
+
+doc: |
+  Genetlink control.
How about:

  genetlink meta-family, exposes information about all
  genetlink families registered in the kernel (including itself).
quoted hunk ↗ jump to hunk
+definitions:
+  -
+    name: op-flags
+    type: flags
+    enum-name: ''
I've used
	enum-name:
i.e. empty value in other places.
Is using empty string more idiomatic?
Unnamed enums are kinda special in my mind, because we will use normal
integer types to store the values in code gen.
quoted hunk ↗ jump to hunk
+    entries:
+      - admin-perm
+      - cmd-cap-do
+      - cmd-cap-dump
+      - cmd-cap-haspol
+      - uns-admin-perm
+  -
+    name: attr-type
+    enum-name: netlink_attribute_type
s/_/-/
The codegen will convert them back
quoted hunk ↗ jump to hunk
+    type: enum
+    entries:
+      - invalid
+      - flag
+      - u8
+      - u16
+      - u32
+      - u64
+      - s8
+      - s16
+      - s32
+      - s64
+      - binary
+      - string
+      - nul-string
+      - nested
+      - nested-array
+      - bitfield32
+      - sint
+      - uint
+
+attribute-sets:
+  -
+    name: ctrl-attrs
+    name-prefix: CTRL_ATTR_
also: s/_/-/ and lower case, code-gen will take care of the exact
formatting.

With those nits:

Acked-by: Jakub Kicinski <kuba@kernel.org>

I haven't checked the exact formatting, but off the top of my head 
the contents look good :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help