From: netdev-bot+sashiko@kernel.org
To: littlesmilingcloud@gmail.com
Cc: netdev@vger.kernel.org, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, davem@davemloft.net, horms@kernel.org,
dsahern@kernel.org, willemb@google.com, idosch@nvidia.com,
fw@strlen.de, u9012063@gmail.com, mvohra@vmware.com,
matthias.may@westermo.com, mazin@getstate.dev, shuah@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v7 5/5] selftests: net: add a test for ip6gretap and ip6erspan with VLAN tags
Date: Thu, 03 Dec 2026 03:59:42 +0000 [thread overview]
Message-ID: <179627038245.3146.4048768052055131695@kernel.org> (raw)
In-Reply-To: <20261201005941.1536429-6-littlesmilingcloud@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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/ip6_gre_vlan_inherit.sh,
setup() and tunnel_create() ignore the exit status of every command…
--
selftests: net: add a test for ip6gretap and ip6erspan with VLAN tags
This adds ip6_gre_vlan_inherit.sh. It sends IPv4 and IPv6 packets with a
given TTL and TOS through ip6gretap and ip6erspan, with and without a VLAN
device on top of the tunnel. On the receiving side, tc flower and u32
check the inherited outer hop limit, traffic class and ERSPAN COS.
> diff --git a/tools/testing/selftests/net/ip6_gre_vlan_inherit.sh b/tools/testing/selftests/net/ip6_gre_vlan_inherit.sh
> new file mode 100755
> index 0000000000000..94aed82e9441c
> --- /dev/null
> +++ b/tools/testing/selftests/net/ip6_gre_vlan_inherit.sh
[ ... ]
> +setup()
> +{
> + setup_ns ns1 ns2 || exit "$ksft_skip"
> +
> + ip -n "$ns1" link add veth1 type veth peer name veth2 netns "$ns2"
[ ... ]
> + tc -n "$ns2" qdisc add dev veth2 clsact
> + # Encapsulated packets with the inherited hop limit and traffic class.
> + # flower reads a numeric ip_proto as hexadecimal: 0x2f is GRE.
> + tc -n "$ns2" filter add dev veth2 ingress pref 1 handle 101 \
> + protocol ipv6 flower ip_proto 0x2f \
> + ip_ttl "$TTL" ip_tos "$TOS" \
> + action continue
> + # ERSPAN packets with the expected COS.
> + # shellcheck disable=SC2086 # COS_MATCH is a value and a mask
> + tc -n "$ns2" filter add dev veth2 ingress pref 2 \
> + protocol ipv6 u32 \
> + match u8 47 0xff at 6 \
> + match u8 $COS_MATCH at "$COS_OFF" \
> + action pass
> +}
> +
> +tunnel_create()
> +{
> + local kind=$1; shift
> + local -a args
> +
> + case "$kind" in
> + ip6gretap)
> + args=(type ip6gretap);;
> + ip6gretap_key)
> + args=(type ip6gretap key 1);;
> + ip6erspan_v1)
> + args=(type ip6erspan seq key 1 erspan_ver 1 erspan 1);;
> + ip6erspan_v2)
> + args=(type ip6erspan seq key 1 erspan_ver 2
> + erspan_dir ingress erspan_hwid 1);;
> + esac
> +
> + ip -n "$ns1" link add tun "${args[@]}" \
> + local 2001:db8:1::1 remote 2001:db8:1::2 \
> + tclass inherit hoplimit inherit encaplimit none
[Severity: Medium]
What happens here if the tunnel cannot be created? The exit status of
this ip link add is not checked. The same is true of the clsact qdisc and
the flower and u32 filters in setup(), and of the VLAN, address and
neighbour commands below. The case statement above also has no default
branch. setup_ns is the only step whose failure is handled.
These steps can fail when CONFIG_IPV6_GRE is not built, when iproute2
does not know erspan_dir, erspan_hwid or encaplimit none, or when
cls_flower, cls_u32, act_gact or sch_ingress is missing.
In those cases test_kind() still goes on into send_and_check(). The
counters never increase, so each busywait in send_and_check() runs for the
full BUSYWAIT_TIMEOUT of 20 s. It does not sleep between polls, so it keeps
forking tc and jq the whole time:
tools/testing/selftests/net/lib.sh:busywait() {
local timeout_ms=$1; shift
loopy_wait : "$timeout_ms" "$@"
}
Would this give up to 24 FAIL lines saying "outer hop limit and traffic
class not inherited" or "COS not taken from the inner header"? That would
be about 8 minutes of busy-spinning and a non-zero exit, where a skip is
expected.
Could these setup steps be checked so that the test exits with $ksft_skip,
as it already does when setup_ns fails?
> + ip -n "$ns1" link add link tun name tun.10 type vlan id 10
> + ip -n "$ns1" link set dev tun up
> + ip -n "$ns1" link set dev tun.10 up
[ ... ]
> + RET=0
> + busywait "$BUSYWAIT_TIMEOUT" until_counter_is \
> + ">= $((inherit + COUNT))" inherit_count > /dev/null
> + check_err $? "outer hop limit and traffic class not inherited"
> + log_test "$kind: $what, hop limit and traffic class"
> +
> + [[ "$kind" == ip6erspan* ]] || return 0
> +
> + RET=0
> + busywait "$BUSYWAIT_TIMEOUT" until_counter_is \
> + ">= $((cos + COUNT))" cos_count > /dev/null
> + check_err $? "COS not taken from the inner header"
> + log_test "$kind: $what, ERSPAN COS"
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201005941.1536429-1-littlesmilingcloud%40gmail.com
prev parent reply other threads:[~2026-12-03 3:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 0:59 [PATCH net-next v7 0/5] ip6_gre, erspan: fix inner header handling for VLAN-tagged and short frames Anton Danilov
2026-12-01 0:59 ` [PATCH net-next v7 1/5] erspan: bound the VLAN tag read in erspan_build_header{,_v2}() Anton Danilov
2026-12-01 0:59 ` [PATCH net-next v7 2/5] erspan: take the COS from the mirrored frame, not from the tunnel family Anton Danilov
2026-12-03 3:59 ` netdev-bot+sashiko
2026-12-01 0:59 ` [PATCH net-next v7 3/5] ip6_gre: classify the inner packet once on transmit Anton Danilov
2026-12-01 0:59 ` [PATCH net-next v7 4/5] ip6_gre: go by the inner protocol behind VLAN tags in ip6erspan Anton Danilov
2026-12-03 3:59 ` netdev-bot+sashiko
2026-12-01 0:59 ` [PATCH net-next v7 5/5] selftests: net: add a test for ip6gretap and ip6erspan with VLAN tags Anton Danilov
2026-12-03 3:59 ` netdev-bot+sashiko [this message]
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=179627038245.3146.4048768052055131695@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--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=littlesmilingcloud@gmail.com \
--cc=matthias.may@westermo.com \
--cc=mazin@getstate.dev \
--cc=mvohra@vmware.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=u9012063@gmail.com \
--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