Article View: linux.kernel.netdev
Article #21328Re: [PATCH net-next v3 07/11] selftests: forwarding: tc_flower: test the enc_key_id mask
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 21:34
Date: Mon, 23 Nov 2026 21:34
138 lines
13290 bytes
13290 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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] In match_enc_key_id_mask_test() (tc_flower.sh lines 295-305),
the capability probe adds a filter on $h2 with stderr discarded and…
- [Low] In match_enc_key_id_mask_test()
(tools/testing/selftests/net/forwarding/tc_flower.sh, lines 290-293),…
--
selftests: forwarding: tc_flower: test the enc_key_id mask
This adds match_enc_key_id_mask_test() to tc_flower.sh. The test sends
frames over two gretap devices with keys 300 and 600. It checks that a
flower filter with enc_key_id 256/0xf00 on an external gretap device
matches only the key inside the mask, and that a probe filter on $h2
decides whether the test runs at all.
> diff --git a/tools/testing/selftests/net/forwarding/tc_flower.sh b/tools/testing/selftests/net/forwarding/tc_flower.sh
> index b58909a931129..0f725ec174687 100755
> --- a/tools/testing/selftests/net/forwarding/tc_flower.sh
> +++ b/tools/testing/selftests/net/forwarding/tc_flower.sh
[ ... ]
> @@ -280,6 +281,64 @@ match_vlan_test()
> log_test "VLAN match ($tcflags)"
> }
>
> +match_enc_key_id_mask_test()
> +{
> + local ret
> +
> + RET=0
> +
> + # A tunnel device has no offload to take a skip_sw filter
> + if [[ $tcflags == "skip_sw" ]]; then
> + return 0
> + fi
[Severity: Low]
Is this comment accurate as a general statement? The commit message makes
the same claim:
"A tunnel device takes no skip_sw filter."
Several drivers offload flower rules on gretap devices through indirect
blocks. In drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c:
mlx5e_get_tc_tun() {
...
else if (netif_is_gretap(tunnel_dev) ||
netif_is_ip6gretap(tunnel_dev))
return &gre_tunnel;
...
}
mlx5e_rep_check_indr_block_supported() then accepts such devices via
mlx5e_tc_tun_device_to_offload(). The nfp driver
(nfp_fl_is_netdev_to_offload()) and ice also handle gretap devices.
The limit seems to come from this test's topology: an external gt-ex
device, no enc_src_ip/enc_dst_ip match, and frames generated in software.
It doesn't seem to apply to tunnel devices in general.
Could the comment and the commit message say that instead? This path also
returns without log_test or log_test_skip, so nothing in the skip_sw pass
shows that the hardware enc_key_id mask paths had no coverage.
> +
> + # An old tc refuses the mask and an old kernel drops it
> + tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
> + $tcflags enc_key_id 256/0xf00 action drop 2> /dev/null
> + tc filter show dev $h2 ingress pref 1 | grep -q "enc_key_id 256/0xf00"
> + ret=$?
> + tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower \
> + 2> /dev/null
> + if [[ $ret -ne 0 ]]; then
> + echo "SKIP: tc or the kernel lacks the enc_key_id mask"
> + return 0
> + fi
[Severity: Medium]
Can this probe hide a regression in the kernel's enc_key_id mask handling?
The kernel side is already in this tree. TCA_FLOWER_KEY_ENC_KEY_ID_MASK is
in the flower policy, and fl_set_key() parses it:
net/sched/cls_flower.c:fl_set_key() {
...
fl_set_key_val(tb, &key->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID,
&mask->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID_MASK,
sizeof(key->enc_key_id.keyid));
...
}
fl_dump_key() dumps it through fl_dump_key_val().
If either path breaks, the grep fails and the function returns 0 before
log_test. RET and EXIT_STATUS stay unchanged, so the script still reports
PASS instead of FAIL. The result of the filter add is also not checked, and
its stderr is discarded.
The commit message is right that log_test_skip would turn the whole
script's exit status into a skip. But a silent return makes an in-tree
kernel regression look the same as an old tc.
By comparison, check_tc_erspan_support() in forwarding/lib.sh only checks
whether tc accepts the syntax:
tc filter add dev $dev ingress pref 1 handle 1 flower \
erspan_opts 1:0:0:0 &> /dev/null
It does not use the kernel's dump output to decide whether to skip.
The probe also depends on the exact text "enc_key_id 256/0xf00". That
output format comes from an iproute2 change that the commit message
doesn't reference. Released tc prints enc_key_id as a bare value. If the
final iproute2 output formats the key or the mask differently, wouldn't
the main test never run anywhere, with no failure reported?
Would it work better to probe only whether tc accepts the syntax? A mask
missing from the dump, or a failed match, on the current kernel could then
go through check_err and log_test.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122213200.3207385-1-acassen%40corp.free.fr
Technical Details
Message-ID:
<179546966804.3135.7021273084185929997@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369788-linux-kernel-netdev=dewy.ruReferences:
<20261122213200.3207385-8-acassen@corp.free.fr>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369788-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 07/11] selftests: forwarding: tc_flower: test the enc_key_id mask Date: Mon, 23 Nov 2026 21:34:28 +0000 Organization: Usenet Network Message-ID: <179546966804.3135.7021273084185929997@kernel.org> References: <20261122213200.3207385-8-acassen@corp.free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3989863"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ZhGbgouSLvIFcweznYMSC3uM5hE= sha256:IpjhxKrw78yXGtMEpsEmfFo13f2ScUmx8g1mwbTAY8Q= sha1:/tPMnFh8N+PTWmY9Mmhx5kyR2DM= sha256:rQg4tCFn5i+M4UseQDP0eVpAldqgSih1Mc3neJ+Oh0U= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DE457125DCA; Tue, 24 Nov 2026 00:34:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YGja89kIEUj9; Tue, 24 Nov 2026 00:34:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-369788-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 5FA70125DC3; Tue, 24 Nov 2026 00:34:35 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 885B827FD3; Mon, 23 Nov 2026 21:34:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795469671; b=gn4W7/DPHcN8PDDC+DU/rLSwykxBUsbaqO5JKAl8jOMBnqEqmtxn7jcsVwMZqsosuxly VJpvHMErP+oxCAjsjEIbZMScOCBwOw0jZIj2iNBrEl3t7ca5qlevOe15I1dD9+3giNZKw gse4JW9WIBnH5gPTdlUgsG25Xv0QtPc1K0jq1msXTW8+qcuMGXqN9OFM+kSKPqGdxmZEA LFQCH5MJKieGILNzwpRlfGTnkyhZkhyMg8LuZ1xj+vjrOXZHk6+mKqlzCd3B91eyrWzP2 V63xBgPQSyd9qcVm2e8o926HkiPtkOiAD0XvzOVSfLs2nhrUJ0iQJQoMXu5bOfObBrA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795469671; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=TgTDGjA1vu3ITyK8LqQZ+WlN+jZzmZ3C1YMQuZCn/d0=; b=tPiLzOjhLzAJQB3iOGA6Lnvq+5d4aw/oPQn7P7RpOw+l4Trvgc8kfs+EQJcZTsMU4OLK MWpbeUioMXmX+ZVKxVSv3IHTSWG40tnW6j0EAceZCambgeQkMpDD6bNYYwPQx+d4UVGTo BbLcA4FT7UcAxNro21BGMALA2Ab5crl3l+fE9d0bv2DCfEKWrDYvj+EZttytpSQKWgzVw j899Ktw1/SYDFqz0NvUDGBPz9GIUNGxy2f57LvPzK1PrDn7ik4QvCQxDy+0bvJglB7VHu bMjX7DPTUICpthSRko24OKynq0Gvpdak5mvJNcSljYOJIV+DELueOPBASFitcM6HBzw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IcBcxhyR; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1138606A33A; Mon, 23 Nov 2026 21:34:31 +0000 (UTC) X-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=IcBcxhyR X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795469671; b=yf31Ps2K52iaajtA1pv8X8uaBULuh0Ye0gEju6tkEkqoAhqxilG3DR+LAUZNhEQCvpK/ 1YrC0Hlk5YhdVXvdB5Nspbp0quc2uxK28foCLR7Q3t37GavAF/dgUvE/g+PU7nMvPxJ+F J4WsUuuWmvEI3efmohT9mOYvL8I/Qx95DXqwhU6oAMQTNMHB9AryGf60wB5Jl04w4QNxk 36SjM0S5u1p6LF2xJkZhr5Be47lKfDns7iuvy3L5g5EOb68hkDIQEcJJpAN/nHTobiJn5 nCLxsk3iToh7+GjZ6bWudtJ44E1upCTykl/Kw3wtthVgZZCoHP68KEydbz60kqEkx3Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795469671; 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=TgTDGjA1vu3ITyK8LqQZ+WlN+jZzmZ3C1YMQuZCn/d0=; b=TGJfKTlqci0gOreibBKVsZOWZsfQ3l0kW7jGjiIB8dCSzSdnDyr3g6J9M3/k03K8wfqg QsdanZyQAGGAdMFEbqghThxID0LtNlR8UNuM1tHZBMpHE+Kj3ZFem96bAXOfJe4nLgjKc GTUBGTMK0NK/+eXM6K0sFP0oJj5UgRiIy65NEj9tJ/5SWJ/YUe661D/nCe2tfU1uVJ1ww KDj0dcYfEaHH5B4T1306E3kbKfTDMLMTgwqQPsErl77VwGz6v2Ug/0OrH0C3nHcYbh4N7 cpPkONBSRJjW+huT9HEC0tPhIpkW9PiCs534tlv+EkVUWgdSahhF8Zoi2FZa9zOcu4w== X-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=IcBcxhyR; arc=none smtp.remote-ip=100.103.45.18 X-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 DFC67606A31E; Mon, 23 Nov 2026 21:34:30 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 804EF1F000E6; Mon, 23 Nov 2026 21:34:28 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795469670; bh=TgTDGjA1vu3ITyK8LqQZ+WlN+jZzmZ3C1YMQuZCn/d0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=IcBcxhyR4VbK4Mb/Hyod8Au7YBRbwMbtsbD5iGsFSC50bQRSr/3deRu5Z7l4yA/I5 WzVabW9Ks5TjCKzGRUpYe4JtOA9eM7mPj+O1gHxH8Kua97TRWtdKf7sWumVNcN47lZ PoFkaUAE86qaOK7FMZWruwTuG+MjyeNc7qYfGEuy9JM2r+fSuIQqev3olX49mlvE6Y J3W5lymUhvbbJp1RCiEO4/0ofLxbvRHT3MvpaWQuAGvudlgtmHp5NufWMcCVBkYqOP 7USw/YBJdr7UCJTT6bsnv0tL82fbO/XShF5ixB0P/IuM10k1LzOBzXY6hB69Tr0WPh u6LKXOzzJxE0w== X-Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, jhs@mojatatu.com, jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, bharat@chelsio.com, donald.hunter@gmail.com, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, dsahern@kernel.org, idosch@nvidia.com, shuah@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, oss-drivers@corigine.com X-In-Reply-To: <20261122213200.3207385-8-acassen@corp.free.fr> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list