Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: sigefriedhyy@gmail.com
Cc: ajay.kathat@microchip.com, aleksandr.loktionov@intel.com,
	andrew+netdev@lunn.ch, claudiu.beznea@tuxon.dev,
	davem@davemloft.net, dsahern@kernel.org, donald.hunter@gmail.com,
	edumazet@google.com, idosch@nvidia.com, jacob.e.keller@intel.com,
	kuba@kernel.org, johannes@sipsolutions.net, kees@kernel.org,
	kory.maincent@bootlin.com, kuniyu@google.com,
	nicolas.dichtel@6wind.com, nickgarlis@gmail.com,
	pabeni@redhat.com, sd@queasysnail.net, shuah@kernel.org,
	horms@kernel.org, sdf.kernel@gmail.com,
	vadim.fedorenko@linux.dev, willemb@google.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v11 1/6] netlink: specs: rt-addr: fix the type of target-netnsid
Date: Tue, 13 Oct 2026 02:04:57 +0000	[thread overview]
Message-ID: <179185709784.434549.17899680533305071231@kernel.org> (raw)
In-Reply-To: <20261012011707.3378-2-sigefriedhyy@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit fixes a real type mismatch in
  Documentation/netlink/specs/rt-addr.yaml.

Pre-existing issues:
- [Low] This problem wasn't introduced by this patch, but the getaddr
  operation in Documentation/netlink/specs/rt-addr.yaml still doesn't…
- [Low] This problem wasn't introduced by this patch, but
  Documentation/netlink/specs/ovs_vport.yaml has the same kind of…

--

netlink: specs: rt-addr: fix the type of target-netnsid

This patch changes the type of target-netnsid in the rt-addr YNL spec from
binary to s32. That matches the NLA_S32 policy the kernel uses for
IFA_TARGET_NETNSID and the s32 type rt-link.yaml already uses.

> The kernel parses IFA_TARGET_NETNSID as NLA_S32 and rt-link.yaml
> declares its target-netnsid as s32, but rt-addr.yaml has it as binary.
>
> Signed-off-by: Yuyang Huang <sigefriedhyy@gmail.com>
> Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

[Severity: Low]
Should this have a Fixes: tag? The type: binary line comes from the
commit that first added the spec. The later rename commit only changed the
attribute name:

Fixes: dfb0f7d9d979 ("doc/netlink: Add spec for rt addr messages")

> diff --git a/Documentation/netlink/specs/rt-addr.yaml b/Documentation/netlink/specs/rt-addr.yaml
> index 0ecbd24c890c6..17ead22034515 100644
> --- a/Documentation/netlink/specs/rt-addr.yaml
> +++ b/Documentation/netlink/specs/rt-addr.yaml
> @@ -119,7 +119,7 @@ attribute-sets:
>          type: u32
>        -
>          name: target-netnsid
> -        type: binary
> +        type: s32

[Severity: Low]
This is a pre-existing issue and was not introduced by this patch. The
getaddr operation in this spec still doesn't list target-netnsid anywhere:

      name: getaddr
      doc: Dump address information.
      attribute-set: addr-attrs
      dump:
        request:
          value: 22
          attributes: []
        reply:
          value: 20
          attributes: *ifaddr-all

Here *ifaddr-all contains only address, label, local and cacheinfo.

The kernel accepts the attribute in RTM_GETADDR dump requests. This is
from net/ipv4/devinet.c:inet_valid_dump_ifaddr_req():

	if (i == IFA_TARGET_NETNSID) {
		struct net *net;

		fillargs->netnsid = nla_get_s32(tb[i]);

The IPv6 dump request handling in net/ipv6/addrconf.c does the same. The
kernel also puts the attribute in replies, from inet_fill_ifaddr() and
inet6_fill_ifaddr():

	if (args->netnsid >= 0 &&
	    nla_put_s32(skb, IFA_TARGET_NETNSID, args->netnsid))

The spec also has no do block for getaddr. IPv6 registers RTM_GETADDR
with .doit = inet6_rtm_getaddr, and inet6_rtm_valid_getaddr_req() accepts
IFA_TARGET_NETNSID, IFA_ADDRESS and IFA_LOCAL.

Could target-netnsid be added to the getaddr request and reply lists,
along with a do block? Right now, generated per-op C code can't set or
parse the attribute whose type this patch fixes. The Python YNL tools
still work because they encode and decode against the whole attribute set.

A later patch in this series fixes the getmulticast case: "netlink: specs:
rt-addr: document AF_PACKET multicast dumps" adds target-netnsid to the
getmulticast dump request and to &mcaddr-attrs. getaddr is still
unchanged at the end of the series.

>        -
>          name: proto
>          type: u8

[Severity: Low]
This isn't a bug introduced by this patch, but
Documentation/netlink/specs/ovs_vport.yaml seems to have the same kind of
netnsid type mismatch. Should it be s32 as well? That spec declares the
attribute as unsigned:

        name: netnsid
        type: u32

But vport_policy in net/openvswitch/datapath.c uses a signed type:

	[OVS_VPORT_ATTR_NETNSID] = { .type = NLA_S32 },

ovs_vport_cmd_fill_info() sends the value with nla_put_s32(). The value
comes from peernet2id_alloc(), which can return NETNSA_NSID_NOT_ASSIGNED
(-1). A YNL client using the ovs_vport spec would decode -1 as 4294967295.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261012011707.3378-1-sigefriedhyy%40gmail.com

  reply	other threads:[~2026-10-13  2:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12  1:17 [PATCH net-next v11 0/6] rtnetlink: dump link-layer multicast addresses Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 1/6] netlink: specs: rt-addr: fix the type of target-netnsid Yuyang Huang
2026-10-13  2:04   ` netdev-bot+sashiko [this message]
2026-10-13 10:21     ` Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 2/6] net: change netdev_hw_addr_list count through helpers Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 3/6] net: add a generation counter for dev->mc changes Yuyang Huang
2026-10-13  2:04   ` netdev-bot+sashiko
2026-10-13 10:25     ` Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 4/6] net: add AF_PACKET multicast dumps Yuyang Huang
2026-10-13  2:05   ` netdev-bot+sashiko
2026-10-13 10:27     ` Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 5/6] netlink: specs: rt-addr: document " Yuyang Huang
2026-10-12  1:17 ` [PATCH net-next v11 6/6] selftests: net: test " Yuyang Huang

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=179185709784.434549.17899680533305071231@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ajay.kathat@microchip.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jacob.e.keller@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kees@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nickgarlis@gmail.com \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@kernel.org \
    --cc=sigefriedhyy@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=willemb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox