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
Subject: Re: [PATCH net-next v4 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport
Date: Mon, 30 Nov 2026 03:48:34 +0000 [thread overview]
Message-ID: <179601051449.3146.7267005649784031183@kernel.org> (raw)
In-Reply-To: <20261129034652.1853485-12-omar@blockcast.net>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] In tools/testing/selftests/net/amt_v6.sh, disc_answer() can
report "no reply" for a capture that never started.
- [Low] In setup_links() in tools/testing/selftests/net/amt_v6.sh, the
comment says "(amtr is NOARP and skips DAD on its own.)".
- [Low] Concern: setup_topology() calls `slowwait 5 test -S
"$SMCDIR/sock"` while `set -E` and `trap 'setup_fail $LINENO' ERR` are…
--
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 gateways and the
relay talk to each other over an IPv6 outer link. It checks:
- discovery through a secondary relay address
- IPv4 and IPv6 multicast forwarding
- the per-/64 tunnel cap
- tunnel MTU handling
- that a Discovery sent to ff02::1 gets no answer
- gateway down/up
> diff --git a/tools/testing/selftests/net/amt_v6.sh b/tools/testing/selftests/net/amt_v6.sh
> new file mode 100755
> index 0000000000000..923c2b374ce53
> --- /dev/null
> +++ b/tools/testing/selftests/net/amt_v6.sh
> @@ -0,0 +1,469 @@
[ ... ]
> +setup_links()
> +{
> + local ns
> +
> + # No DAD: the global addresses of the gateway and relay links must
> + # not be tentative, or the gateways could neither bind to them nor
> + # send from them. (amtr is NOARP and skips DAD on its own.)
[Severity: Low]
Is the "amtr is NOARP" part of this comment accurate? amt_link_setup() in
drivers/net/amt.c does set IFF_NOARP, but it calls ether_setup() last:
drivers/net/amt.c:amt_link_setup() {
...
dev->type = ARPHRD_NONE;
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
...
ether_setup(dev);
}
ether_setup() always sets dev->type = ARPHRD_ETHER and
dev->flags = IFF_BROADCAST|IFF_MULTICAST. That means amtr ends up without
IFF_NOARP and goes through normal DAD.
The test still works because $RELAY is in the accept_dad=0 loop below, and
amtr is created after default.accept_dad=0 is set. Could the note in
parentheses be fixed or removed? Otherwise someone may drop $RELAY from the
loop because of it.
> + for ns in "$LISTENER" "$GATEWAY" "$GATEWAY2" "$RELAY" "$SOURCE"; do
> + ip netns exec "$ns" sysctl -wq \
> + net.ipv6.conf.all.accept_dad=0 \
> + net.ipv6.conf.default.accept_dad=0
> + done
[ ... ]
> + SMCDIR=$(mktemp -d)
> + ip netns exec "$RELAY" smcrouted -P "$SMCDIR/pid" -u "$SMCDIR/sock"
> + slowwait 5 test -S "$SMCDIR/sock"
[Severity: Low]
Can the inherited ERR trap fire inside this slowwait? setup_topology() runs
with errtrace on and the setup_fail ERR trap installed:
set -E
trap 'setup_fail $LINENO' ERR
...
setup_topology
loopy_wait() in lib.sh runs the polled command inside a command
substitution:
if out=$("$@"); then
With set -E, command substitutions inherit the ERR trap. smcrouted
daemonizes before it creates its socket, so the first test -S calls can
fail.
If the trap fires there, setup_fail prints "FAIL: setup failed at line N"
to stderr. Its exit only leaves the substitution subshell, so setup goes on
and the run can still pass.
Bash may suppress this, because the substitution is the condition of an if
and the ignore-return state may carry into the subshell. If so, nothing is
printed. Has this been checked against the bash versions used in CI, so
the output does not show stray FAIL lines?
> + ip netns exec "$RELAY" smcroutectl -u "$SMCDIR/sock" \
> + a relay_src 172.17.0.2 239.0.0.1 amtr
[ ... ]
> +disc_answer()
> +{
> + local dst=$1 filter=$2 pid i rc cap
> + local to="UDP6-SENDTO:[$dst]:2268,sourceport=40000"
> +
> + cap=$(mktemp)
> + ip netns exec "$GATEWAY" timeout 6 \
> + tcpdump -nni gw_relay -c 1 "$filter" > /dev/null 2> "$cap" &
> + pid=$!
> + # The capture is ready once tcpdump says it is listening; it is gone
> + # before that only if it failed to start.
> + for i in $(seq 50); do
> + grep -q "listening on" "$cap" && break
> + if ! kill -0 "$pid" 2> /dev/null; then
> + wait "$pid"
> + rm -f "$cap"
> + return 2
> + fi
> + sleep 0.1
> + done
> + rm -f "$cap"
[Severity: Medium]
What happens if tcpdump is still running but has not printed "listening
on" after all 50 tries? The loop just ends without returning 2. The sends
then go ahead as if the capture were armed.
The 6 second timeout started when tcpdump was launched. After about 5
seconds of polling, only about 1 second is left. The three sends below take
at least 1.5 seconds, so timeout can kill tcpdump before or during them.
The status handling then gives:
wait "$pid"
case $? in
0) return "${rc:-0}" ;;
124) return "${rc:-1}" ;;
wait returns 124, rc is unset, and disc_answer() returns 1. That is the
same status as a real "no reply". test_mcast_discovery() treats 1 as a pass
for the ff02::1 check:
disc_answer ff02::1 "udp and src port 2268 and dst port 40000"
[ $? -eq 1 ]
The ff02::1 check can therefore pass even though no capture covered the
sends. The earlier unicast control ran its own tcpdump, so it does not
show that this one worked.
This also seems to contradict the function comment ("2 if the harness
failed: tcpdump did not start") and the commit message:
The ff02::1 check accepts only "no reply", so a broken capture cannot
pass it.
Should disc_answer() kill tcpdump and return 2 when the loop ends without
seeing "listening on"? Starting the capture deadline only once tcpdump is
listening may also help.
> + # Type 1 (Relay Discovery), version 0, then a nonce.
> + for i in 1 2 3; do
> + printf '\x01\x00\x00\x00\x12\x34\x56\x78' |
> + ip netns exec "$GATEWAY" socat -u - \
> + "$to,so-bindtodevice=gw_relay" || rc=2
> + sleep 0.5
> + done
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129034652.1853485-1-omar%40blockcast.net
next prev parent reply other threads:[~2026-11-30 3:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 3:46 [PATCH net-next v4 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-11-30 3:48 ` netdev-bot+sashiko
2026-11-29 3:46 ` [PATCH net-next v4 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 05/12] amt: forward multicast data " Omar Ramadan
2026-11-30 3:48 ` netdev-bot+sashiko
2026-11-29 3:46 ` [PATCH net-next v4 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 08/12] amt: receive " Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-11-29 3:46 ` [PATCH net-next v4 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-11-30 3:48 ` netdev-bot+sashiko [this message]
2026-11-29 3:46 ` [PATCH net-next v4 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
2026-11-30 3:48 ` 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=179601051449.3146.7267005649784031183@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 \
--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