From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6E2DCD3445 for ; Wed, 6 May 2026 17:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4Sk9AMClgajSNHuw9J0bbpplICxYeEsc4DHVamhdVZs=; b=Ka/U5F6KfoFmxsCpIvYLxV6e7e 7+J/f2g3+/wQgo8RU0zQ4fluL+4E8lkWfvWpywyl+xQzdXy5l3fbkHXMLhE+kFOpG4T1QmVzySU8e Yx28ExO2/a7PACoqgfFu3p8uZ9DMWMywc5e+6FVw4vBVXEg+RboUEQXGVJGZUFOSq471pfXUR4eOe VNVURWRSq/rbXtpDJY54FPhV5kaT4/pDMGvP+PZ4LcKyekupuMCLawuiHg0rwpydJzicSCxlAiORU uMvmb0eb9YFI/dDU076rp1tIGdFM9l72qUvcaJh5mPhusYjaWRTADIcXS3H8VJKPAUJjeA7Me/gie 7rIQKMeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wKg35-00000001ePE-0xax; Wed, 06 May 2026 17:28:39 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wKg34-00000001eNK-1Nlt; Wed, 06 May 2026 17:28:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 51E9B4413D; Wed, 6 May 2026 17:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3C77C2BCF4; Wed, 6 May 2026 17:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778088517; bh=C6ICbuwaNSE7OZNHgVQ87t+GV5tsPvgVrfivVmaiiew=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kY++lBpwESeyNBzkCVY6y5kOFbM96Nsc3UXxi3HPD3p53C/rvTWf5qt9NKvUxQ/HD 7dqnFY1eBWw4cYhK7TvBd22RdiF12p9A0JyO9jL/rfz+dL6YwIt1OChO0xlA7vOoFy xf9tGqgjDckIlIkr/V/8T+mi/WI53C0/OBQdsas6RhnKXSwkxgamKymtPGaa1QqnUy L1nIKTjNcfLx9EqLY8l3iwxG2Wyyu+z5Zrv1RlmMMP5STnZzVqVP1KOWjpZmP0f5zF 9ZKnaJD6kAKVtxRRZXjsKQmPGYJgZn2Q5WDv/syxtZRebosWwVsby94jIBGdQJnnqL jZThnetaVoArw== From: Lorenzo Bianconi Date: Wed, 06 May 2026 19:27:35 +0200 Subject: [PATCH nf-next v2 4/6] selftests: netfilter: nft_flowtable.sh: Add IPv4 over IPv6 flowtable selftest MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260506-b4-flowtable-sw-accel-ip6ip-v2-4-439fd427726e@kernel.org> References: <20260506-b4-flowtable-sw-accel-ip6ip-v2-0-439fd427726e@kernel.org> In-Reply-To: <20260506-b4-flowtable-sw-accel-ip6ip-v2-0-439fd427726e@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Felix Fietkau , Matthias Brugger , AngeloGioacchino Del Regno , Simon Horman , David Ahern , Ido Schimmel , Pablo Neira Ayuso , Florian Westphal , Phil Sutter , Shuah Khan , Lorenzo Bianconi Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kselftest@vger.kernel.org X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260506_102838_434755_1C9C35E7 X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Similar to IPIP and IP6IP6, introduce specific selftest for IPv4 over IPv6 flowtable sw acceleration in nft_flowtable.sh Signed-off-by: Lorenzo Bianconi --- .../selftests/net/netfilter/nft_flowtable.sh | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/netfilter/nft_flowtable.sh b/tools/testing/selftests/net/netfilter/nft_flowtable.sh index 7a34ef468975..219339dbaf6e 100755 --- a/tools/testing/selftests/net/netfilter/nft_flowtable.sh +++ b/tools/testing/selftests/net/netfilter/nft_flowtable.sh @@ -579,9 +579,8 @@ if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 ""; then ip netns exec "$nsr1" nft list ruleset fi -# IPIP tunnel test: -# Add IPIP tunnel interfaces and check flowtable acceleration. -test_ipip() { +# IP tunnel tests: +test_ip_tnls() { if ! ip -net "$nsr1" link add name tun0 type ipip \ local 192.168.10.1 remote 192.168.10.2 >/dev/null;then echo "SKIP: could not add ipip tunnel" @@ -594,7 +593,9 @@ ip netns exec "$nsr1" sysctl net.ipv4.conf.tun0.forwarding=1 > /dev/null ip -net "$nsr1" link add name tun6 type ip6tnl local fee1:2::1 remote fee1:2::2 ip -net "$nsr1" link set tun6 up +ip -net "$nsr1" addr add 192.168.210.1/24 dev tun6 ip -net "$nsr1" addr add fee1:3::1/64 dev tun6 nodad +ip netns exec "$nsr1" sysctl net.ipv4.conf.tun6.forwarding=1 > /dev/null ip -net "$nsr2" link add name tun0 type ipip local 192.168.10.2 remote 192.168.10.1 ip -net "$nsr2" link set tun0 up @@ -603,7 +604,9 @@ ip netns exec "$nsr2" sysctl net.ipv4.conf.tun0.forwarding=1 > /dev/null ip -net "$nsr2" link add name tun6 type ip6tnl local fee1:2::2 remote fee1:2::1 || ret=1 ip -net "$nsr2" link set tun6 up +ip -net "$nsr2" addr add 192.168.210.2/24 dev tun6 ip -net "$nsr2" addr add fee1:3::2/64 dev tun6 nodad +ip netns exec "$nsr2" sysctl net.ipv4.conf.tun6.forwarding=1 > /dev/null ip -net "$nsr1" route change default via 192.168.100.2 ip -net "$nsr2" route change default via 192.168.100.1 @@ -636,6 +639,15 @@ else ret=1 fi +ip -net "$nsr1" route change default via 192.168.210.2 +ip -net "$nsr2" route change default via 192.168.210.1 + +if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 "IP6IP4 tunnel"; then + echo "FAIL: flow offload for ns1/ns2 with IP6IP4 tunnel" 1>&2 + ip netns exec "$nsr1" nft list ruleset + ret=1 +fi + # Create vlan tagged devices for IPIP traffic. ip -net "$nsr1" link add link veth1 name veth1.10 type vlan id 10 ip -net "$nsr1" link set veth1.10 up @@ -653,7 +665,9 @@ ip netns exec "$nsr1" nft -a insert rule inet filter forward 'meta oif tun0.10 a ip -net "$nsr1" link add name tun6.10 type ip6tnl local fee1:4::1 remote fee1:4::2 ip -net "$nsr1" link set tun6.10 up +ip -net "$nsr1" addr add 192.168.220.1/24 dev tun6.10 ip -net "$nsr1" addr add fee1:5::1/64 dev tun6.10 nodad +ip netns exec "$nsr1" sysctl net.ipv4.conf.tun6/10.forwarding=1 > /dev/null ip -6 -net "$nsr1" route delete default ip -6 -net "$nsr1" route add default via fee1:5::2 ip netns exec "$nsr1" nft -a insert rule inet filter forward 'meta oif tun6.10 accept' @@ -672,7 +686,9 @@ ip netns exec "$nsr2" sysctl net.ipv4.conf.tun0/10.forwarding=1 > /dev/null ip -net "$nsr2" link add name tun6.10 type ip6tnl local fee1:4::2 remote fee1:4::1 || ret=1 ip -net "$nsr2" link set tun6.10 up +ip -net "$nsr2" addr add 192.168.220.2/24 dev tun6.10 ip -net "$nsr2" addr add fee1:5::2/64 dev tun6.10 nodad +ip netns exec "$nsr2" sysctl net.ipv4.conf.tun6/10.forwarding=1 > /dev/null ip -6 -net "$nsr2" route delete default ip -6 -net "$nsr2" route add default via fee1:5::1 @@ -690,6 +706,15 @@ else ret=1 fi +ip -net "$nsr1" route change default via 192.168.220.2 +ip -net "$nsr2" route change default via 192.168.220.1 + +if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 "IP6IP4 tunnel over vlan"; then + echo "FAIL: flow offload for ns1/ns2 with IP6IP4 tunnel over vlan" 1>&2 + ip netns exec "$nsr1" nft list ruleset + ret=1 +fi + # Restore the previous configuration ip -net "$nsr1" route change default via 192.168.10.2 ip -net "$nsr2" route change default via 192.168.10.1 @@ -782,7 +807,7 @@ ip -net "$nsr1" addr add dead:1::1/64 dev veth0 nodad ip -net "$nsr1" link set up dev veth0 } -test_ipip +test_ip_tnls test_bridge -- 2.54.0