mbox series

[net-next,0/3] tools: ynl: Add sub-message and multi-attr encoding support

Message ID cover.1705950652.git.alessandromarcolini99@gmail.com (mailing list archive)
Headers show
Series tools: ynl: Add sub-message and multi-attr encoding support | expand

Message

Alessandro Marcolini Jan. 22, 2024, 7:19 p.m. UTC
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(-)

Comments

Donald Hunter Jan. 22, 2024, 9:43 p.m. UTC | #1
> On 22 Jan 2024, at 20:19, Alessandro Marcolini <alessandromarcolini99@gmail.com> wrote:
> 
> This patchset adds the encoding support for sub-message attributes and
> multi-attr objects.

I have a longer patchset that covers this plus some refactoring for nested struct definitions and a lot of addtions to the tc spec. Do you mind if I post it and we review to see if there is anything from your patchset that is missing from mine?

Thanks,
Donald

> 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
>
Alessandro Marcolini Jan. 23, 2024, 12:40 a.m. UTC | #2
On 1/22/24 22:43, Donald Hunter wrote:
> I have a longer patchset that covers this plus some refactoring for nested struct definitions and a lot of addtions to the tc spec. Do you mind if I post it and we review to see if there is anything from your patchset that is missing from mine?
>
> Thanks,
> Donald

Hi Donald,

Yes for sure, post it and we will review it together.