netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
	edumazet@google.com
Subject: Re: [patch net-next v3] tools: ynl: introduce option to process unknown attributes or types
Date: Thu, 26 Oct 2023 07:42:33 +0200	[thread overview]
Message-ID: <ZTn7v05E2iirB0g2@nanopsycho> (raw)
In-Reply-To: <20231025175636.2a7858a6@kernel.org>

Thu, Oct 26, 2023 at 02:56:36AM CEST, kuba@kernel.org wrote:
>On Wed, 25 Oct 2023 11:57:36 +0200 Jiri Pirko wrote:
>> {'129': {'0': b'\x00\x00\x00\x00\x00\x00\x00\x00',
>>          '1': b'\x00\x00\x00\x00\x00\x00\x00\x00',
>>          '2': b'(\x00\x00\x00\x00\x00\x00\x00'},
>>  '132': b'\x00',
>>  '133': b'',
>>  '134': {'0': b''},
>
>I'm not convinced, and still prefer leaving NlAttr objects in place.

If I understand that correctly, you would like to dump the
NlAttr.__repr__() as a printable representation of the objec, correct?

It yes, this is what I wrote in the discussion of v2:

Instead of:
{'129': {'0': b'\x00\x00\x00\x00\x00\x00\x00\x00',
         '1': b'\x00\x00\x00\x00\x00\x00\x00\x00',
         '2': b'(\x00\x00\x00\x00\x00\x00\x00'},
You'd get:
{'129': {'0': [type:0 len:12] b'\x00\x00\x00\x00\x00\x00\x00\x00',
         '1': [type:1 len:12] b'\x00\x00\x00\x00\x00\x00\x00\x00',
         '2': [type:2 len:12] b'(\x00\x00\x00\x00\x00\x00\x00'},
Looks like unnecessary redundant info, I would rather stick with
"as_bin()". __repr__() is printable representation of the whole object,
we just need value here, already have that in a structured object.


What is "type" and "len" good for here?



>-- 
>pw-bot: reject

  reply	other threads:[~2023-10-26  5:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  9:57 [patch net-next v3] tools: ynl: introduce option to process unknown attributes or types Jiri Pirko
2023-10-26  0:56 ` Jakub Kicinski
2023-10-26  5:42   ` Jiri Pirko [this message]
2023-10-26 14:41     ` Jakub Kicinski
2023-10-26 14:46       ` Jakub Kicinski
2023-10-26 16:24         ` Jiri Pirko
2023-10-26 16:25       ` Jiri Pirko
2023-10-26 19:30         ` Jakub Kicinski
2023-10-27  8:36           ` Jiri Pirko
2023-10-27 14:08             ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTn7v05E2iirB0g2@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).