All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
Cc: netdev@vger.kernel.org, Donald Hunter <donald.hunter@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Yuyang Huang <yuyanghuang@google.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH net-next] netlink: specs: add big-endian byte-order for u32 IPv4 addresses
Date: Thu, 27 Nov 2025 02:14:54 +0000	[thread overview]
Message-ID: <aSe0HgwA1XF8lVIX@fedora> (raw)
In-Reply-To: <43630b97-4dd4-423a-97e3-ca6aa3b56ad4@fiberby.net>

On Wed, Nov 26, 2025 at 01:32:22PM +0000, Asbjørn Sloth Tønnesen wrote:
> On 11/26/25 6:36 AM, Hangbin Liu wrote:
> > Hi,
> > On Tue, Nov 25, 2025 at 05:03:13PM +0000, Asbjørn Sloth Tønnesen wrote:
> > > I also checked how consistently defined the fields using the ipv6 display helper are,
> > > and it looks like they could use some realignment too. Obviously not for this fix.
> > > 
> > > git grep -C6 'display-hint.*ipv6$' Documentation/netlink/specs/
> > 
> > The ip6gre spec shows
> > -
> >    name: local
> >    display-hint: ipv6
> > -
> >    name: remote
> >    display-hint: ipv6
> > 
> > The dump result looks good.
> 
> Those two are defined in linkinfo-gre6-attrs, which is declared as a subset-of
> linkinfo-gre-attrs.
> 
> In linkinfo-gre-attrs they are declared as:
> 
> -
>   name: local
>   type: binary
>   display-hint: ipv4-or-v6
> -
>   name: remote
>   type: binary
>   display-hint: ipv4-or-v6
> 
> I have tested with deleting one or the other's display-helper, and at least
> in cli.py, this kind of display-hint overloading works.
> 
> > So for others ipv6 field, what alignment should we
> > use? Should we add checks: min-len: 16? Do we need byte-order: big-endian?
> 
> IPv6 is always big-endian, the marking first becomes needed when/if we make
> them an u128 type. Until then it would just be nice if either all or none
> of them had the big-endian marking.
> 
> I prefer exact-len over min-len. The current tally is:
> 
> $ git grep 'len.*: 16' Documentation/netlink/specs/ | cut -d: -f2- | sed -e 's/^ *//' | sort | uniq -c
>       7 exact-len: 16
>       5 len: 16
>       6 min-len: 16
> (assuming that only IPv6 has a length of 16)
> 
> "len: 16" as used in ovs_flow's ipv6-src and ipv6-dst only works because they
> are struct members, not attributes.

Hmm, I just found that I tried to do that 2 years ago[1] but forgot why I give
up... I saw you have fixed the fou part with 9f9581ba74a9
("netlink: specs: fou: change local-v6/peer-v6 check").

Let's alignment others this time.

[1] https://lore.kernel.org/netdev/20231215035009.498049-4-liuhangbin@gmail.com/

Thanks
Hangbin

  reply	other threads:[~2025-11-27  2:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 11:20 [PATCH net-next] netlink: specs: add big-endian byte-order for u32 IPv4 addresses Hangbin Liu
2025-11-25 17:03 ` Asbjørn Sloth Tønnesen
2025-11-26  6:36   ` Hangbin Liu
2025-11-26 13:32     ` Asbjørn Sloth Tønnesen
2025-11-27  2:14       ` Hangbin Liu [this message]
2025-11-27  3:31       ` Hangbin Liu
2025-11-27  1:20 ` patchwork-bot+netdevbpf

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=aSe0HgwA1XF8lVIX@fedora \
    --to=liuhangbin@gmail.com \
    --cc=ast@fiberby.net \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=yuyanghuang@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.