All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] tools: ynl: Add sub-message and multi-attr encoding support
@ 2024-01-22 19:19 Alessandro Marcolini
  2024-01-22 19:19 ` [PATCH net-next 1/3] tools: ynl: correct typo and docstring Alessandro Marcolini
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Alessandro Marcolini @ 2024-01-22 19:19 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, donald.hunter, sdf, chuck.lever,
	lorenzo, jacob.e.keller, jiri
  Cc: netdev, Alessandro Marcolini

This patchset adds the encoding support for sub-message attributes and
multi-attr objects.

Patch 1 corrects a typo and the docstring for SpecSubMessageFormat
Patch 2 adds the multi-attr attribute to the entry object for taprio
Patch 3 updates the _add_attr method to support sub-message encoding

It is now possible to add a taprio qdisc using ynl:
# /tools/net/ynl/cli.py --spec Documentation/netlink/specs/tc.yaml --do newqdisc --create --json '{"family":1, "ifindex":4, "handle":65536, "parent":4294967295, "info":0, "kind":"taprio", "stab":{"base":"000000000000001f00000000000000000000000000000000"}, "options":{"priomap":"03010101010101010101010101010101010001000100020000000000000000000000000000000000000000000000000000000100020003000000000000000000000000000000000000000000000000000000", "sched-clockid":11, "sched-entry-list":[{"entry":{"index":0, "cmd":0, "gate-mask":1, "interval":300000}}, {"entry":{"index":1, "cmd":0, "gate-mask":2, "interval":300000}}, {"entry":{"index":2, "cmd":0, "gate-mask":4, "interval":400000}}], "sched-base-time":1528743495910289987, "flags": 1}}'

Alessandro Marcolini (3):
  tools: ynl: correct typo and docstring
  doc: netlink: specs: tc: add multi-attr to tc-taprio-sched-entry
  tools: ynl: add encoding support for 'sub-message' to ynl

 Documentation/netlink/specs/tc.yaml |  3 +-
 tools/net/ynl/lib/nlspec.py         |  7 ++--
 tools/net/ynl/lib/ynl.py            | 54 +++++++++++++++++++++++++----
 3 files changed, 53 insertions(+), 11 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH net-next 0/3] Add support for encoding multi-attr to ynl
@ 2024-01-24 16:34 Alessandro Marcolini
  2024-01-24 16:34 ` [PATCH net-next 1/3] tools: ynl: correct typo and docstring Alessandro Marcolini
  0 siblings, 1 reply; 14+ messages in thread
From: Alessandro Marcolini @ 2024-01-24 16:34 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, donald.hunter, sdf, chuck.lever,
	lorenzo, jacob.e.keller, jiri
  Cc: netdev, Alessandro Marcolini

This patchset add the support for encoding multi-attr attributes, making
it possible to use ynl with qdisc which have this kind of attributes
(e.g: taprio, ets).

Example:
The equivalent to:
# tc qdisc add dev eni1np1 root handle:1 ets bands 8 priomap 7 6 5 4 3 2 1 0

would be in ynl:
# ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/tc.yaml --do
newqdisc --create --json '{"family":1, "ifindex":4, "handle":65536, 
"parent":4294967295, "kind":"ets", "options":{"nbands":8, "priomap":
[{"priomap-band":7}, {"priomap-band":6}, {"priomap-band":5},
{"priomap-band":4}, {"priomap-band":3}, {"priomap-band":2},
{"priomap-band":1}, {"priomap-band":0}]}}'

This patchset depends on the work done by Donald Hunter:
https://lore.kernel.org/netdev/20240123160538.172-1-donald.hunter@gmail.com/T/#t

It is a modified version of a previous patch I've submitted, where I
removed the part already addressed by Donald and modified the rest
accordingly. Previous patch:
https://lore.kernel.org/netdev/cover.1705950652.git.alessandromarcolini99@gmail.com/T/#t

Patch 1 corrects two docstrings in nlspec.py
Patch 2 adds the multi-attr attribute to taprio entry
Patch 3 adds the support for encoding multi-attr

Alessandro Marcolini (3):
  tools: ynl: correct typo and docstring
  doc: netlink: specs: tc: add multi-attr to tc-taprio-sched-entry
  tools: ynl: add support for encoding multi-attr

 Documentation/netlink/specs/tc.yaml |  1 +
 tools/net/ynl/lib/nlspec.py         |  9 ++++-----
 tools/net/ynl/lib/ynl.py            | 16 ++++++++++++----
 3 files changed, 17 insertions(+), 9 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-24 16:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 19:19 [PATCH net-next 0/3] tools: ynl: Add sub-message and multi-attr encoding support Alessandro Marcolini
2024-01-22 19:19 ` [PATCH net-next 1/3] tools: ynl: correct typo and docstring Alessandro Marcolini
2024-01-23 16:28   ` Donald Hunter
2024-01-22 19:19 ` [PATCH net-next 2/3] doc: netlink: specs: tc: add multi-attr to tc-taprio-sched-entry Alessandro Marcolini
2024-01-23 16:35   ` Donald Hunter
2024-01-22 19:19 ` [PATCH net-next 3/3] tools: ynl: add encoding support for 'sub-message' to ynl Alessandro Marcolini
2024-01-22 19:46   ` Breno Leitao
2024-01-22 20:31     ` Alessandro Marcolini
2024-01-23 16:44   ` Donald Hunter
2024-01-24  9:12     ` Alessandro Marcolini
2024-01-24  9:45       ` Donald Hunter
2024-01-22 21:43 ` [PATCH net-next 0/3] tools: ynl: Add sub-message and multi-attr encoding support Donald Hunter
2024-01-23  0:40   ` Alessandro Marcolini
  -- strict thread matches above, loose matches on Subject: below --
2024-01-24 16:34 [PATCH net-next 0/3] Add support for encoding multi-attr to ynl Alessandro Marcolini
2024-01-24 16:34 ` [PATCH net-next 1/3] tools: ynl: correct typo and docstring Alessandro Marcolini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.