From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796270384; b=0v9XEGwSQZ2Xcfy0dqw3nKoDbpH805iglan0o59GhU8FU3ondmPnBQZi//O+W+9+9bkD r68X4uYyYoWGKSbWBUnENXDjU8wutRp45lOEZwWNfmbCZ7pGz5D/TBtaGFOCOkxwuzD4L yVbJtwJIi7uJcn+50ZrYug95TojjtDAprSrBVD5hJdwUVrdO3j/P87WAeoHL9/9cdNIaU wylI9KlG6COcSNEqm1bjmf88JZEQg8SjEmI0Xf+MILyVXrReM2j4ngUcTnXKR6ZbbCg/B pRVjY0wByFIaeHdW5w0FzFM733dZANc2k//XnrdcJwMB+7BlZOZHDOPPrFSZKkOkNYQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796270384; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=MJiLN/tC85uwK5U1vQAq6lJKIGyArUnR6Zu9z55tAiA=; b=41NemrO9kDZJ+qTu6/ZybcBAxW4ENqtLzkSxW3BzbWAlkmSybCgqTJAfnB0YMRBTb899 WOZ39VoIUYZER5wRoWxl0XNilUOKj5FLxzKwfc9tB8TjNfCqc6cSI3VbAai2aL9PP/GFp W/opZFlfZog5hpmXW09SnSALcjBKhVosE4xX1yoPoZDUM7g1V3PoOb+5NVdGoOGfWsXTQ pl9SaYXQogV8WGF8+EnabchCSQIKJcjuPwDZLFALUEfmIfbyTwXl3F0kXzEFm/TcVWgM9 9XqqrdBkuTeAmdUE/qIF9aF8pg0cQFcYQJ5BAg1uwEqlO/cqQWrQ+VZskpEdCs5Zjww== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fwguwIi4; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223BF606A339; Thu, 3 Dec 2026 03:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fwguwIi4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4EA31F000C1; Thu, 3 Dec 2026 03:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796270383; bh=MJiLN/tC85uwK5U1vQAq6lJKIGyArUnR6Zu9z55tAiA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=fwguwIi4CXAO1BYtINMj/M92dcCt/3B4ehsDH0E/r8sHVRFPj9O6KsMEBXH3+KSyk S8acxj9KYpEW/CAH5AdwbO+vsgJQZKL6MgujRTztjy0kFYOOkjWJ/CJLB+mOOV21Xf RSpPp1t7qyEoXcljOaJQWN/korVI8OOnaoJX1FxwiOAHrpTt1F8W7AlYhhVG8u1l8b /g0jRdJ7TvtGx1AET6zWPox6FkMNjD84C1z5znN/j/zE/LBZjs2CPZi8P1QnNBTXMR ju67HlbHc2Ai4zIluYjTa7DYHKI+R9fEjPZE4L2lWtoQfzib4rK1bxnaW0Wxq+ak6V EkMz5YlNqEa5w== Subject: Re: [PATCH net-next v7 5/5] selftests: net: add a test for ip6gretap and ip6erspan with VLAN tags 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 Date: Thu, 03 Dec 2026 03:59:42 +0000 Message-ID: <179627038245.3146.4048768052055131695@kernel.org> In-Reply-To: <20261201005941.1536429-6-littlesmilingcloud@gmail.com> References: <20261201005941.1536429-6-littlesmilingcloud@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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