Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: omar@blockcast.net
Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	shuah@kernel.org, horms@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	willemb@google.com, dsahern@kernel.org, idosch@nvidia.com
Subject: Re: [PATCH net-next v6 03/12] amt: key relay tunnels on a union amt_addr endpoint
Date: Thu, 03 Dec 2026 04:33:16 +0000	[thread overview]
Message-ID: <179627239603.3146.14932561535978359931@kernel.org> (raw)
In-Reply-To: <20261202043200.286260-4-omar@blockcast.net>

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 message's reason for the IPv6 per-source tunnel cap is
  wrong, so the trade-off it describes is misjudged.

--

amt: key relay tunnels on a union amt_addr endpoint

This commit changes the relay tunnel key from a __be32 IPv4 address to a
union amt_addr, so that an IPv6 outer source can be stored and compared in
full. It replaces siphash_3u32() for the Update MAC with amt_relay_mac().
It also makes the per-source tunnel cap count an IPv6 /64 instead of a
single address, via amt_same_source().

> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index e3c69ebf78f20..bfdce6897f7cd 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c

[ ... ]

> @@ -187,6 +210,19 @@ static bool amt_addr_equal(union amt_addr *a, union amt_addr *b)
>  	return !memcmp(a, b, sizeof(union amt_addr));
>  }
>  
> +#define AMT_SRC_PREFIX6_LEN	8
> +
> +/* One source for the per-source tunnel cap: an IPv4 address or an IPv6
> + * /64, so that one host cannot reach the cap from each of its addresses.
> + */
> +static bool amt_same_source(const struct amt_dev *amt,
> +			    const union amt_addr *a, const union amt_addr *b)
> +{
> +	if (amt_v6(amt))
> +		return !memcmp(&a->ip6, &b->ip6, AMT_SRC_PREFIX6_LEN);
> +	return a->ip4 == b->ip4;
> +}

[Severity: Low]
Is the premise behind this grouping accurate? The commit message says:

  "one host normally owns a /64 and could otherwise hold the cap from
  each of its addresses"

A /64 is usually the size of one link, not one host. SLAAC gives every
host on a LAN an address from the same /64. Many cloud subnets and VPS
providers also put many hosts or customers in one /64.

On an IPv6 relay, all gateways in such a /64 would share a single cap
from amt_max_tunnels_per_src():

	return clamp_t(u32, amt->max_tunnels / 8, 1,
		       AMT_MAX_TUNNELS_PER_SRC);

That cap can never go above 16, whatever max_tunnels is set to.

Once that many tunnels exist in the /64, amt_request_handler() stops
sending the Membership Query:

	if (!have && (full || per_src >= amt_max_tunnels_per_src(amt)))
		return true;

and amt_tunnel_get_or_create() refuses to create a tunnel:

	if (amt->nr_tunnels >= amt->max_tunnels ||
	    per_src >= amt_max_tunnels_per_src(amt)) {

Would every later gateway on that link then get no service? It also
looks like one party in a shared /64 could use up the cap and lock out
its /64 neighbours. That can't happen for IPv4 hosts that have separate
public addresses.

The commit message does say "Gateways in one /64 share the cap", but it
treats this as the unusual case when it is probably the common one.

This patch can't reach the path yet, because amt_v6() is still false. The
behaviour stays the same once the later patch "amt: add netlink
attributes for an IPv6 outer transport" makes amt_v6() reachable.

Could the commit message rationale be corrected, or the /64 grouping be
reconsidered?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202043200.286260-1-omar%40blockcast.net

  reply	other threads:[~2026-12-03  4:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  4:31 [PATCH net-next v6 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko [this message]
2026-12-02  4:31 ` [PATCH net-next v6 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko
2026-12-02  4:31 ` [PATCH net-next v6 05/12] amt: forward multicast data " Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko
2026-12-02  4:31 ` [PATCH net-next v6 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko
2026-12-02  4:31 ` [PATCH net-next v6 08/12] amt: receive " Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko
2026-12-02  4:31 ` [PATCH net-next v6 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-12-02  4:31 ` [PATCH net-next v6 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-12-03  4:33   ` netdev-bot+sashiko
2026-12-02  4:32 ` [PATCH net-next v6 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan

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=179627239603.3146.14932561535978359931@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=omar@blockcast.net \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --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