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: <e634a466-a968-4422-a30a-49f6261d8703@nvidia.com>
Date: Tue, 18 Nov 2025 11:38:04 +0200
From: Gal Pressman <gal@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, netdev@...r.kernel.org,
 Donald Hunter <donald.hunter@...il.com>, 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 1/3] tools: ynl: cli: Add --list-attrs option to
 show operation attributes

On 18/11/2025 3:35, Jakub Kicinski wrote:
>>   Do reply attributes:
>>     - ifindex: u32
>>       netdev ifindex
>>     - xdp-features: u64 (enum: xdp-act)
>>       Bitmask of enabled xdp-features.
>>     - xdp-zc-max-segs: u32
>>       max fragment count supported by ZC driver
>>     - xdp-rx-metadata-features: u64 (enum: xdp-rx-metadata)
>>       Bitmask of supported XDP receive metadata features. See Documentation/networking/xdp-rx-metadata.rst for more details.
>>     - xsk-features: u64 (enum: xsk-flags)
>>       Bitmask of enabled AF_XDP features.
>>
>>   Dump reply attributes:
>>     - ifindex: u32
>>       netdev ifindex
>>     - xdp-features: u64 (enum: xdp-act)
>>       Bitmask of enabled xdp-features.
>>     - xdp-zc-max-segs: u32
>>       max fragment count supported by ZC driver
>>     - xdp-rx-metadata-features: u64 (enum: xdp-rx-metadata)
>>       Bitmask of supported XDP receive metadata features. See Documentation/networking/xdp-rx-metadata.rst for more details.
>>     - xsk-features: u64 (enum: xsk-flags)
>>       Bitmask of enabled AF_XDP features.
> 
> Could you try to detect that do and dump replies are identical 
> and combine them? They are the same more often than not so 
> I think it'd be nice to avoid printing the same info twice.

We need to take care of both cases where the whole operation is
identical (e.g., ethtool debug-get), and cases where only the replies
are identical (e.g., netdev dev-get). This kind of complicates the code.

I'll give it a few more attempts, but maybe this should come as a
followup to this series.

>> @@ -128,6 +131,40 @@ def main():
>>      if args.ntf:
>>          ynl.ntf_subscribe(args.ntf)
>>  
>> +    def print_attr_list(attr_names, attr_set):
> 
> It nesting functions inside main() a common pattern for Python?
> Having a function declared in the middle of another function,
> does not seem optimal to me, but for some reason Claude loves
> to do that.

I used output() as a reference, but I'll move it outside.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ