[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43630b97-4dd4-423a-97e3-ca6aa3b56ad4@fiberby.net>
Date: Wed, 26 Nov 2025 13:32:22 +0000
From: Asbjørn Sloth Tønnesen <ast@...erby.net>
To: Hangbin Liu <liuhangbin@...il.com>
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 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.
Powered by blists - more mailing lists