[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSe0HgwA1XF8lVIX@fedora>
Date: Thu, 27 Nov 2025 02:14:54 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: Asbjørn Sloth Tønnesen <ast@...erby.net>
Cc: netdev@...r.kernel.org, Donald Hunter <donald.hunter@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
"Matthieu Baerts (NGI0)" <matttbe@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>,
Jacob Keller <jacob.e.keller@...el.com>,
Yuyang Huang <yuyanghuang@...gle.com>,
Daniel Borkmann <daniel@...earbox.net>
Subject: Re: [PATCH net-next] netlink: specs: add big-endian byte-order for
u32 IPv4 addresses
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
Powered by blists - more mailing lists