From: Donald Hunter <donald.hunter@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch,
horms@kernel.org
Subject: Re: [PATCH net-next 1/2] netlink: specs: nlctrl: fix the policy attribute numbering
Date: Thu, 17 Sep 2026 09:56:10 +0100 [thread overview]
Message-ID: <m21pasp87p.fsf@gmail.com> (raw)
In-Reply-To: <20260916021516.1701760-1-kuba@kernel.org>
Jakub Kicinski <kuba@kernel.org> writes:
> mask and pad are declared the wrong way round, giving mask 11 and
> pad 12, while enum netlink_policy_type_attr has
> NL_POLICY_TYPE_ATTR_PAD at 11 and NL_POLICY_TYPE_ATTR_MASK at 12.
>
> The kernel emits the mask for every NLA_POLICY_MASK() attribute, so a
> Python YNL client parsing a policy dump maps it onto pad and throws it
> away - 30 of them in ethtool's policy alone. In the other direction the
> 64-bit alignment padding, which the kernel does emit on architectures
> without efficient unaligned access, is decoded as a u64 mask and blows
> up the whole dump. But those architectures are rare.
>
> The generated C parser is not affected, it keys the attributes off the
> uAPI symbol names rather than off the values the spec derives.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
next prev parent reply other threads:[~2026-09-17 8:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 2:15 [PATCH net-next 1/2] netlink: specs: nlctrl: fix the policy attribute numbering Jakub Kicinski
2026-09-16 2:15 ` [PATCH net-next 2/2] netlink: specs: nlctrl: let getfamily take a family id Jakub Kicinski
2026-09-17 8:56 ` Donald Hunter
2026-09-17 8:56 ` Donald Hunter [this message]
2026-09-18 0:10 ` [PATCH net-next 1/2] netlink: specs: nlctrl: fix the policy attribute numbering 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=m21pasp87p.fsf@gmail.com \
--to=donald.hunter@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--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 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.