lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 13 Mar 2024 23:07:22 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: ahmed.zaki@...el.com, aleksander.lobakin@...el.com,
 alexandre.torgue@...s.st.com, andrew@...n.ch, corbet@....net,
 davem@...emloft.net, dtatulea@...dia.com, edumazet@...gle.com,
 gal@...dia.com, hkallweit1@...il.com, jacob.e.keller@...el.com,
 jiri@...nulli.us, joabreu@...opsys.com, justinstitt@...gle.com,
 kory.maincent@...tlin.com, leon@...nel.org, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, liuhangbin@...il.com,
 maxime.chevallier@...tlin.com, netdev@...r.kernel.org, pabeni@...hat.com,
 paul.greenwalt@...el.com, przemyslaw.kitszel@...el.com,
 rdunlap@...radead.org, richardcochran@...il.com, saeed@...nel.org,
 tariqt@...dia.com, vadim.fedorenko@...ux.dev, vladimir.oltean@....com,
 wojciech.drewek@...el.com
Subject: Re: [PATCH RFC v2 6/6] tools: ynl: ethtool.py: Output timestamping
 statistics from tsinfo-get operation


On Wed, 13 Mar, 2024 17:47:07 -0700 Jakub Kicinski <kuba@...nel.org> wrote:
>
> Ah, we're missing the enum definition and linking :S
>
> I mean:
>
> diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
> index 197208f419dc..e1626c94d93b 100644
> --- a/Documentation/netlink/specs/ethtool.yaml
> +++ b/Documentation/netlink/specs/ethtool.yaml
> @@ -16,6 +16,10 @@ doc: Partial family for Ethtool Netlink.
>      name: stringset
>      type: enum
>      entries: []
> +  -
> +    name: header-flags
> +    type: flags
> +    entries: [ compact-bitset, omit-reply, stats ]

I am running into some strange issues with this even after regenerating
ynl generated/ by running make under tools/net/ynl/.

  Traceback (most recent call last):
    File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 437, in <module>
      main()
    File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 333, in main
      tsinfo = dumpit(ynl, args, 'tsinfo-get', req)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 91, in dumpit
      reply = ynl.dump(op_name, { 'header': {} } | extra)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 873, in dump
      return self._op(method, vals, [], dump=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 824, in _op
      msg += self._add_attr(op.attr_set.name, name, value, search_attrs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 459, in _add_attr
      attr_payload += self._add_attr(attr['nested-attributes'],
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 481, in _add_attr
      attr_payload = format.pack(int(value))
                                ^^^^^^^^^^
  TypeError: int() argument must be a string, a bytes-like object or a real number, not 'dict'

What's your expectation for how the request structure would look like? I
have tried the following.

  if args.show_time_stamping:
      req = {
        'header': {
          'flags': 'stats',
        },
      }

  if args.show_time_stamping:
      req = {
        'header': {
          'flags': {
             'stats': True,
          },
        },
      }

I tried looking through the lib/ynl.py code, but I did not understand
how the 'flags' type was specifically handled.

>  
>  attribute-sets:
>    -
> @@ -30,6 +34,7 @@ doc: Partial family for Ethtool Netlink.
>        -
>          name: flags
>          type: u32
> +        enum: header-flags
>  
>    -
>      name: bitset-bit
>
> See if that works and feel free to post it with my suggested-by

--
Thanks,

Rahul Rameshbabu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ