| d6df5e9b | 10-Mar-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: add --policy support
Add --policy flag which can be combined with --do or --dump to query the kernel's netlink policy for an operation instead of executing it.
Examples:
$ ynl -
tools: ynl: cli: add --policy support
Add --policy flag which can be combined with --do or --dump to query the kernel's netlink policy for an operation instead of executing it.
Examples:
$ ynl --family netdev --do dev-get --policy {'ifindex': {'max-value': 4294967295, 'min-value': 1, 'type': 'u32'}}
$ ynl --family ethtool --do channels-get --policy --output-json {"header": {"type": "nested", "policy": {"dev-index": ...}}}
$ ynl --family netdev --dump dev-get --policy {}
Link: https://patch.msgid.link/20260310005337.3594225-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 77a6401a | 10-Mar-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: add Python API for easier access to policies
The format of Netlink policy dump is a bit curious with messages in the same dump carrying both attrs and mapping info. Plus each message car
tools: ynl: add Python API for easier access to policies
The format of Netlink policy dump is a bit curious with messages in the same dump carrying both attrs and mapping info. Plus each message carries a single piece of the puzzle the caller must then reassemble.
I need to do this reassembly for a test, but I think it's generally useful. So let's add proper support to YnlFamily to return more user-friendly representation. See the various docs in the patch for more details.
Link: https://patch.msgid.link/20260310005337.3594225-5-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 8bbcfce5 | 10-Mar-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: add short doc to class YnlFamily
The class is quite long. It's getting hard to find the user-facing methods. Add a short doc at the class level explaining the main API.
Link: https://pa
tools: ynl: add short doc to class YnlFamily
The class is quite long. It's getting hard to find the user-facing methods. Add a short doc at the class level explaining the main API.
Link: https://patch.msgid.link/20260310005337.3594225-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| c26fda62 | 10-Mar-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: move policy decoding out of NlMsg
We'll soon need to decode policies from dump so move _decode_policy() out of class NlMsg.
Link: https://patch.msgid.link/20260310005337.3594225-3-kuba@
tools: ynl: move policy decoding out of NlMsg
We'll soon need to decode policies from dump so move _decode_policy() out of class NlMsg.
Link: https://patch.msgid.link/20260310005337.3594225-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 60411ade | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: print reply in combined format if possible
As pointed out during review of the --list-attrs support the GET ops very often return the same attrs from do and dump. Make the output mo
tools: ynl: cli: print reply in combined format if possible
As pointed out during review of the --list-attrs support the GET ops very often return the same attrs from do and dump. Make the output more readable by combining the reply information, from:
Do request attributes: - ifindex: u32 netdev ifindex
Do reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
Dump reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
To, after:
Do request attributes: - ifindex: u32 netdev ifindex
Do and Dump reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-8-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 6ccc421b | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: extract the event/notify handling in --list-attrs
Event and notify handling is quite different from do / dump handling. Forcing it into print_mode_attrs() doesn't really buy us anyt
tools: ynl: cli: extract the event/notify handling in --list-attrs
Event and notify handling is quite different from do / dump handling. Forcing it into print_mode_attrs() doesn't really buy us anything as events and notifications do not have requests. Call print_attr_list() directly. Apart form subjective code clarity this also removes the word "reply" from the output:
Before:
Event reply attributes:
Now:
Event attributes:
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-7-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 45b99bb4 | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: factor out --list-attrs / --doc handling
We'll soon add more code to the --doc handling. Factor it out to avoid making main() too long.
Tested-by: Gal Pressman <gal@nvidia.com> Ack
tools: ynl: cli: factor out --list-attrs / --doc handling
We'll soon add more code to the --doc handling. Factor it out to avoid making main() too long.
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| aca1fe23 | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: add --doc as alias to --list-attrs
--list-attrs also provides information about the operation itself. So --doc seems more appropriate. Add an alias.
Tested-by: Gal Pressman <gal@nv
tools: ynl: cli: add --doc as alias to --list-attrs
--list-attrs also provides information about the operation itself. So --doc seems more appropriate. Add an alias.
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-5-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 1b7fbf62 | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: improve --help
Improve the clarity of --help. Reorder, provide some grouping and add help messages to most of the options.
No functional changes intended.
Tested-by: Gal Pressman
tools: ynl: cli: improve --help
Improve the clarity of --help. Reorder, provide some grouping and add help messages to most of the options.
No functional changes intended.
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 101a7d57 | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: wrap the doc text if it's long
We already use textwrap when printing "doc" section about an attribute, but only to indent the text. Switch to using fill() to split and indent all th
tools: ynl: cli: wrap the doc text if it's long
We already use textwrap when printing "doc" section about an attribute, but only to indent the text. Switch to using fill() to split and indent all the lines. While at it indent the text by 2 more spaces, so that it doesn't align with the name of the attribute.
Before (I'm drawing a "box" at ~60 cols here, in an attempt for clarity):
| - irq-suspend-timeout: uint | | The timeout, in nanoseconds, of how long to suspend irq| |processing, if event polling finds events |
After:
| - irq-suspend-timeout: uint | | The timeout, in nanoseconds, of how long to suspend | | irq processing, if event polling finds events |
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 1ecc8ae8 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl-gen-c: Fix remaining pylint warnings
Fix the following pylint warning instances:
ynl_gen_c.py:575:15: E0606: Possibly using variable 'mem' before assignment (possibly-used-before-assignm
tools: ynl-gen-c: Fix remaining pylint warnings
Fix the following pylint warning instances:
ynl_gen_c.py:575:15: E0606: Possibly using variable 'mem' before assignment (possibly-used-before-assignment)
ynl_gen_c.py:888:0: R1707: Disallow trailing comma tuple (trailing-comma-tuple)
ynl_gen_c.py:944:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
ynl_gen_c.py:1450:14: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)
ynl_gen_c.py:1688:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
ynl_gen_c.py:3446:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-14-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| a587f592 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl-gen-c: fix pylint None, type, dict, generators, init
Fix the following pylint warnings that are trivial one-liners:
- unsubscriptable-object - unidiomatic-typecheck - use-dict-literal -
tools: ynl-gen-c: fix pylint None, type, dict, generators, init
Fix the following pylint warnings that are trivial one-liners:
- unsubscriptable-object - unidiomatic-typecheck - use-dict-literal - attribute-defined-outside-init - consider-using-in - consider-using-generator
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-13-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 93ef8429 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl-gen-c: fix pylint warnings for returns, unused, redefined
Fix the following pylint warnings:
- unused-argument - unused-variable - no-else-return - inconsistent-return-statements - redef
tools: ynl-gen-c: fix pylint warnings for returns, unused, redefined
Fix the following pylint warnings:
- unused-argument - unused-variable - no-else-return - inconsistent-return-statements - redefined-outer-name - unreachable
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-12-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| c2fa97c5 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl-gen-c: suppress unhelpful pylint messages
Disable pylint messages for too-many-*, too-few-*, docstrings, broad-exception-* and messages for specific code that won't get changed.
Signed-o
tools: ynl-gen-c: suppress unhelpful pylint messages
Disable pylint messages for too-many-*, too-few-*, docstrings, broad-exception-* and messages for specific code that won't get changed.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-11-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 9a130471 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint issues in ynl_gen_rst
Add a couple of pylint suppressions to ynl_gen_rst.py:
- no-name-in-module,wrong-import-position - broad-exception-caught
Signed-off-by: Donald Hunter
tools: ynl: fix pylint issues in ynl_gen_rst
Add a couple of pylint suppressions to ynl_gen_rst.py:
- no-name-in-module,wrong-import-position - broad-exception-caught
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-10-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|