public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Claudi <aclaudi@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Ido Schimmel <idosch@idosch.org>,
	Vladimir Nikishkin <vladimir@nikishkin.pw>,
	dsahern@gmail.com, netdev@vger.kernel.org, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	eng.alaamohamedsoliman.am@gmail.com, gnault@redhat.com,
	razor@blackwall.org, idosch@nvidia.com, liuhangbin@gmail.com,
	eyal.birger@gmail.com, jtoppins@redhat.com
Subject: Re: [PATCH iproute2-next v5] ip-link: add support for nolocalbypass in vxlan
Date: Tue, 23 May 2023 11:39:34 +0200	[thread overview]
Message-ID: <ZGyJ1r+A3zIhmk0/@renaissance-vector> (raw)
In-Reply-To: <20230522083216.09cc8fd7@hermes.local>

On Mon, May 22, 2023 at 08:32:16AM -0700, Stephen Hemminger wrote:
> On Mon, 22 May 2023 09:15:34 +0300
> Ido Schimmel <idosch@idosch.org> wrote:
> 
> > On Sun, May 21, 2023 at 12:47:41PM -0700, Stephen Hemminger wrote:
> > > On Sun, 21 May 2023 22:23:25 +0300
> > > Ido Schimmel <idosch@idosch.org> wrote:
> > >   
> > > > +       if (tb[IFLA_VXLAN_LOCALBYPASS])
> > > > +               print_bool(PRINT_ANY, "localbypass", "localbypass ",
> > > > +                          rta_getattr_u8(tb[IFLA_VXLAN_LOCALBYPASS]))  
> > > 
> > > That will not work for non json case.  It will print localbypass whether it is set or not.
> > > The third argument is a format string used in the print routine.  
> > 
> > Yea, replied too late...
> > 
> > Anyway, my main problem is with the JSON output. Looking at other
> > boolean VXLAN options, we have at least 3 different formats:
> > 
> > 1. Only print when "true" for both JSON and non-JSON output. Used for
> > "external", "vnifilter", "proxy", "rsc", "l2miss", "l3miss",
> > "remcsum_tx", "remcsum_rx".
> > 
> > 2. Print when both "true" and "false" for both JSON and non-JSON output.
> > Used for "udp_csum", "udp_zero_csum6_tx", "udp_zero_csum6_rx".
> > 
> > 3. Print JSON when both "true" and "false" and non-JSON only when
> > "false". Used for "learning".
> > 
> > I don't think we should be adding another format. We need to decide:
> > 
> > 1. What is the canonical format going forward?
> > 
> > 2. Do we change the format of existing options?
> > 
> > My preference is:
> > 
> > 1. Format 2. Can be implemented in a common helper used for all VXLAN
> > options.
> > 
> > 2. Yes. It makes all the boolean options consistent and avoids future
> > discussions such as this where a random option is used for a new option.
> 
> A fourth option is to us print_null(). The term null is confusing and people
> seem to avoid it.  But it is often used by python programmers as way to represent
> options. That would be my preferred option but others seem to disagree.
> 
> Option #2 is no good. Any printing of true/false in non-JSON output is a diveregence
> from the most common practice across iproute2.
> 
> That leaves #3 as the correct and best output.
> 
> FYI - The iproute2 maintainers are David Ahern and me. The kernel bits have
> other subsystem maintainers.
> 

Just to make sure I understand correctly, this means we are printing
"nolocalbypass" in non-JSON output because it's the non-default
settings, right?

If this is correct, then if we have another option in the future that
comes disabled by default, this means we are going to print it in
non-JSON output when enabled.

As the primary consumer of non-JSON output are humans, I am a bit
concerned since a succession of enabled/noenabled options is awkward and
difficult to read, in my opinion.

Wouldn't it be better to have non-JSON print out options only when
enabled, regardless of their default value?


  parent reply	other threads:[~2023-05-23  9:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21  5:49 [PATCH iproute2-next v5] ip-link: add support for nolocalbypass in vxlan Vladimir Nikishkin
2023-05-21 19:23 ` Ido Schimmel
2023-05-21 19:47   ` Stephen Hemminger
2023-05-22  6:15     ` Ido Schimmel
2023-05-22 15:32       ` Stephen Hemminger
2023-05-23  9:31         ` Petr Machata
2023-05-23  9:39         ` Andrea Claudi [this message]
2023-05-23  9:52           ` Vladimir Nikishkin
2023-05-23 10:32             ` Andrea Claudi
2023-05-22  6:03   ` Vladimir Nikishkin
2023-05-22  6:22     ` Ido Schimmel

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=ZGyJ1r+A3zIhmk0/@renaissance-vector \
    --to=aclaudi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=eng.alaamohamedsoliman.am@gmail.com \
    --cc=eyal.birger@gmail.com \
    --cc=gnault@redhat.com \
    --cc=idosch@idosch.org \
    --cc=idosch@nvidia.com \
    --cc=jtoppins@redhat.com \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=stephen@networkplumber.org \
    --cc=vladimir@nikishkin.pw \
    /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