diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-03-01 21:36:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-03 11:22:39 +0300 |
commit | ad4fafcde5bc1badb8fc2c7f260a5d6b83a038e4 (patch) | |
tree | ec528cbb83651d354e3e139ee8429dc40e1ad004 /Documentation | |
parent | 7cf93538e087a792cb476008a757ab7c1c23b68c (diff) | |
download | linux-ad4fafcde5bc1badb8fc2c7f260a5d6b83a038e4.tar.xz |
tools: ynl: use 1 as the default for first entry in attrs/ops
Pretty much all families use value: 1 or reserve as unspec
the first entry in attribute set and the first operation.
Make this the default. Update documentation (the doc for
values of operations just refers back to doc for attrs
so updating only attrs).
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/userspace-api/netlink/specs.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/userspace-api/netlink/specs.rst b/Documentation/userspace-api/netlink/specs.rst index 1424ab1b9b33..32e53328d113 100644 --- a/Documentation/userspace-api/netlink/specs.rst +++ b/Documentation/userspace-api/netlink/specs.rst @@ -197,7 +197,12 @@ value Numerical attribute ID, used in serialized Netlink messages. The ``value`` property can be skipped, in which case the attribute ID will be the value of the previous attribute plus one (recursively) -and ``0`` for the first attribute in the attribute set. +and ``1`` for the first attribute in the attribute set. + +Attributes (and operations) use ``1`` as the default value for the first +entry (unlike enums in definitions which start from ``0``) because +entry ``0`` is almost always reserved as undefined. Spec can explicitly +set value to ``0`` if needed. Note that the ``value`` of an attribute is defined only in its main set (not in subsets). |