All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: kuniyu@google.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, horms@kernel.org, dsahern@kernel.org,
	stephen@networkplumber.org, kuni1840@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v4 net-next 5/5] geneve: Introduce IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.
Date: Mon,  1 Jun 2026 19:34:02 -0700	[thread overview]
Message-ID: <20260602023402.1647750-1-kuba@kernel.org> (raw)
In-Reply-To: <20260528005658.1756248-6-kuniyu@google.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
geneve: Introduce IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.

This patch adds IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6 attributes so a
GENEVE device's underlying UDP socket can be bound to a specific local
IPv4 or IPv6 address rather than the wildcard, and updates lookup paths
and xmit paths accordingly.

> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
> index 3a62d132a8c4..c5372b33a305 100644
> --- a/drivers/net/geneve.c
> +++ b/drivers/net/geneve.c

[ ... ]

> @@ -1972,6 +2043,55 @@ static int geneve_nl2info(struct nlattr *tb[], struct nlattr *data[],
>  #endif
>  	}
>  
> +	if (data[IFLA_GENEVE_LOCAL]) {
> +		if (changelink) {
> +			attrtype = IFLA_GENEVE_LOCAL;
> +			goto change_notsup;
> +		}
> +
> +		info->key.u.ipv4.src = nla_get_in_addr(data[IFLA_GENEVE_LOCAL]);
> +
> +		if (ipv4_is_multicast(info->key.u.ipv4.src)) {
> +			NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_LOCAL],
> +					    "Local IPv4 address cannot be Multicast");
> +			return -EINVAL;
> +		}
> +
> +		cfg->dualstack = false;
> +	}
> +
> +	if (data[IFLA_GENEVE_LOCAL6]) {
> +#if IS_ENABLED(CONFIG_IPV6)
> +		int addr_type;
> +
> +		if (changelink) {
> +			attrtype = IFLA_GENEVE_LOCAL6;
> +			goto change_notsup;
> +		}

[Medium]
Should the changelink rejection here mirror the IFLA_GENEVE_REMOTE
behavior in this same function? IFLA_GENEVE_REMOTE only fails the
changelink when the family changes:

	if (data[IFLA_GENEVE_REMOTE]) {
		if (changelink && (ip_tunnel_info_af(info) == AF_INET6)) {
			attrtype = IFLA_GENEVE_REMOTE;
			goto change_notsup;
		}

whereas IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6 fail unconditionally
whenever the attribute is present, even when the value matches the
existing configuration.

Combined with the geneve_fill_info() change below, would this break the
common dump-then-changelink round trip used by some management tools on
pre-existing devices, returning -EOPNOTSUPP even though LOCAL was never
explicitly configured?

[ ... ]

> @@ -2320,6 +2441,20 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
>  #endif
>  	}
>  
> +	if (!geneve->cfg.dualstack) {
> +		if (ip_tunnel_info_af(info) == AF_INET) {
> +			if (nla_put_in_addr(skb, IFLA_GENEVE_LOCAL,
> +					    info->key.u.ipv4.src))
> +				goto nla_put_failure;
> +#if IS_ENABLED(CONFIG_IPV6)
> +		} else {
> +			if (nla_put_in6_addr(skb, IFLA_GENEVE_LOCAL6,
> +					     &info->key.u.ipv6.src))
> +				goto nla_put_failure;
> +#endif
> +		}
> +	}
> +

[Medium]
Does this emit IFLA_GENEVE_LOCAL or IFLA_GENEVE_LOCAL6 on every
non-collect_md device, including legacy devices created without any
local address?

cfg->dualstack is only set true for collect_md devices, so for any
device where the user never specified a local address, info->key.u.ipv4.src
is 0 (or info->key.u.ipv6.src is ::) but the attribute is still emitted.
This would change the visible output of ip -d link show and netlink
dumps for existing GENEVE devices, adding a synthetic local 0.0.0.0 or
local :: that was not present before.

Would gating this on a non-zero source address (or tracking whether the
user explicitly set LOCAL) avoid the dump-output change for unaffected
devices?

The commit message describes the new behavior on devices that set
LOCAL/LOCAL6 but does not mention that fill_info now emits these
attributes for every previously-created non-collect_md device, nor that
changelink will reject any presence of LOCAL/LOCAL6 even when the value
is unchanged. Could the commit message call out these compatibility
implications?

  reply	other threads:[~2026-06-02  2:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  0:56 [PATCH v4 net-next 0/5] geneve: Allow binding UDP socket to a specific address Kuniyuki Iwashima
2026-05-28  0:56 ` [PATCH v4 net-next 1/5] geneve: Reuse ipv6_addr_type() result in geneve_nl2info() Kuniyuki Iwashima
2026-05-28  0:56 ` [PATCH v4 net-next 2/5] geneve: Pass struct geneve_dev to geneve_create_sock() Kuniyuki Iwashima
2026-05-28  0:56 ` [PATCH v4 net-next 3/5] geneve: Pass struct geneve_dev to geneve_find_sock() Kuniyuki Iwashima
2026-05-28  0:56 ` [PATCH v4 net-next 4/5] geneve: Add dualstack flag to struct geneve_config Kuniyuki Iwashima
2026-05-28  0:56 ` [PATCH v4 net-next 5/5] geneve: Introduce IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6 Kuniyuki Iwashima
2026-06-02  2:34   ` Jakub Kicinski [this message]
2026-06-02  3:25     ` Kuniyuki Iwashima
2026-06-02 16:21       ` Jakub Kicinski
2026-06-02 16:31         ` Kuniyuki Iwashima

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=20260602023402.1647750-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    /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.