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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b646c522-d4ac-4cb3-ba10-9c456a3ab5c5@nvidia.com>
Date: Tue, 18 Nov 2025 11:35:52 +0200
From: Gal Pressman <gal@...dia.com>
To: Donald Hunter <donald.hunter@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
 netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
 Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
 Jesper Dangaard Brouer <hawk@...nel.org>,
 John Fastabend <john.fastabend@...il.com>,
 Stanislav Fomichev <sdf@...ichev.me>, bpf@...r.kernel.org,
 Nimrod Oren <noren@...dia.com>
Subject: Re: [PATCH net-next 3/3] tools: ynl: cli: Display enum values in
 --list-attrs output

On 17/11/2025 18:05, Donald Hunter wrote:
>> diff --git a/tools/net/ynl/pyynl/cli.py b/tools/net/ynl/pyynl/cli.py
>> index 3389e552ec4e..d305add514cd 100755
>> --- a/tools/net/ynl/pyynl/cli.py
>> +++ b/tools/net/ynl/pyynl/cli.py
>> @@ -139,7 +139,12 @@ def main():
>>                  attr = attr_set.attrs[attr_name]
>>                  attr_info = f'{prefix}- {attr_name}: {attr.type}'
>>                  if 'enum' in attr.yaml:
>> -                    attr_info += f" (enum: {attr.yaml['enum']})"
>> +                    enum_name = attr.yaml['enum']
>> +                    attr_info += f" (enum: {enum_name})"
> 
> Would be good to say enum | flags so that people know what semantics are valid.

I changed "Values: " to "enum:"/"flags:".

> 
>> +                    # Print enum values if available
>> +                    if enum_name in ynl.consts:
>> +                        enum_values = list(ynl.consts[enum_name].entries.keys())
>> +                        attr_info += f"\n{prefix}  Values: {', '.join(enum_values)}"
> 
> This produces quite noisy output for e.g.
> 
> ./tools/net/ynl/pyynl/cli.py --family ethtool --list-attrs rss-get
> 
> Not sure what to suggest to improve readability but maybe it doesn't
> need 'Values:' or commas, or perhaps only output each enum once?

Values was replaced, I don't see how removing the commas improves the
situation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ