mirror of https://lore.kernel.org/lkml/
 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
Subject: Re: [PATCH net-next v2 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport
Date: Thu, 26 Nov 2026 19:17:04 +0000	[thread overview]
Message-ID: <179572062428.3135.4041633001964825666@kernel.org> (raw)
In-Reply-To: <20261125191450.2497936-12-omar@blockcast.net>

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] probe_v6_relay() in tools/testing/selftests/net/amt_v6.sh is
  meant to skip in one case it cannot recognise.
- [Medium] selftests: net: probe_v6_relay() fails instead of skipping
  without CONFIG_AMT
- [Low] The commit message overstates how closely amt_v6.sh mirrors
  amt.sh.

--

selftests: net: add amt_v6.sh for an IPv6 outer transport

This adds amt_v6.sh, a variant of amt.sh in which the AMT gateway and
relay use an IPv6 outer link, with a second gateway on the same link.
It checks discovery through a secondary relay address, IPv4 and IPv6
multicast forwarding, tunnel MTU handling, that a Discovery sent to
ff02::1 gets no answer, and rediscovery after down/up. A probe skips the
test when the kernel or iproute2 lacks IPv6 AMT support.

> amt_v6.sh is amt.sh with the gateway<->relay link moved to IPv6, and a
> second gateway on that link:

[ ... ]

> The namespaces, inner addresses and smcroute (S,G) routes are those of
> amt.sh, and the scripts use the same tools, plus jq.

[Severity: Low]
Is "plus jq" accurate? amt.sh already uses jq in test_remote_ip() and
test_query_egress().

Also, amt_v6.sh does not carry over test_query_egress() from amt.sh.
That test installs clsact and flower egress counters on amtr for IGMP
(ip_proto 2) and MLD query (ICMPv6 type 130) packets, and it fails if a
relay General Query leaves through the amt device. The
send_mcast_torture4 and send_mcast_torture6 runs are not carried over
either.

This series adds the IPv6-outer General Query path:

  amt_send_igmp_gq() / amt_send_mld_gq()
    -> amt_send_membership_query()

Should the egress check be added here as well? If not, could the commit
message say that these checks were dropped, instead of describing the
script as amt.sh with the link moved to IPv6?

> diff --git a/tools/testing/selftests/net/amt_v6.sh b/tools/testing/selftests/net/amt_v6.sh
> new file mode 100755
> index 0000000000000..9d3e4a20676c3
> --- /dev/null
> +++ b/tools/testing/selftests/net/amt_v6.sh
> @@ -0,0 +1,355 @@

[ ... ]

> +# An iproute2 without IPv6 AMT support either rejects the address or packs
> +# it into the 4-byte IFLA_AMT_LOCAL_IP, which this kernel refuses and an
> +# older one takes as an IPv4 address. A kernel without IPv6 AMT support
> +# ignores IFLA_AMT_LOCAL_IP6 and asks for a local address. Skip in those
> +# cases only.
> +probe_v6_relay()
> +{
> +	local err got
> +
> +	if ! err=$(ip -n "$RELAY" link add amtprobe type amt mode relay \
> +		   local "$RELAY6" dev br_gw 2>&1); then
> +		case "$err" in
> +		*"Local attribute is required"*|*"expected rather than"*|\
> +		*"IPv6 address in an IPv4 attribute"*)
> +			echo "SKIP: no IPv6 AMT support: $err"
> +			exit "$ksft_skip"
> +			;;
> +		esac
> +		echo "FAIL: cannot create an IPv6 relay: $err"
> +		exit "$ksft_fail"
> +	fi

[Severity: Medium]
Does this also skip when the amt link type is not available at all?

On a kernel built without CONFIG_AMT, or where the amt module cannot
be loaded, rtnl_link_ops_get() finds no "amt" ops and __rtnl_newlink()
returns -EOPNOTSUPP with the extack "Unknown device type". An iproute2
that does not know the amt link type at all rejects the command line
before anything reaches the kernel.

Neither error text matches any of the three case patterns. In both
cases probe_v6_relay() prints "FAIL: cannot create an IPv6 relay" and
exits with ksft_fail. A kselftest run on a config without AMT would
then report a failure rather than a skip.

amt.sh avoids the iproute2 half of this with its ip link help check
before setup. Should amt_v6.sh do the same? Should it also treat a
missing amt device type as a skip, for example by matching "Unknown
device type" or by checking that the amt module can be loaded first?

[Severity: Medium]
Does this skip in the packed-attribute case described in the comment
above and in the commit message?

If iproute2 packs the 16-byte IPv6 literal into IFLA_AMT_LOCAL_IP, the
kernel refuses it during generic netlink policy validation, before
amt_validate() runs:

drivers/net/amt.c:amt_policy[] {
    ...
	[IFLA_AMT_LOCAL_IP]	= NLA_POLICY_EXACT_LEN(sizeof(__be32)),
    ...
}

NLA_POLICY_EXACT_LEN() is an NLA_BINARY range of 4..4. A 16-byte
attribute therefore fails in nla_validate_range_unsigned(), which
returns -ERANGE with the extack "binary attribute size out of range".

That string matches none of the three patterns. As far as I can tell,
nothing in the tree emits "IPv6 address in an IPv4 attribute"; it only
appears in amt_v6.sh and amt_gw_v6.sh.

In that case, wouldn't the probe print "FAIL: cannot create an IPv6
relay" and exit with ksft_fail instead of ksft_skip?

probe_v6_gateway() in the later patch "selftests: net: add amt_gw_v6.sh
for the IPv6 netlink attributes" repeats the same pattern, so this is
still there at the end of the series.

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

  reply	other threads:[~2026-11-26 19:17 UTC|newest]

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

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=179572062428.3135.4041633001964825666@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --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 \
    /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

all inboxes | Powered by JetHome®