From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE4AE40F8C6; Mon, 13 Jul 2026 12:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783946815; cv=none; b=l1L4oLOrkiabflxY60jmUPK+k+AfmI3zZrwGUduQfawOs4nZiPzENqiq5vZ0eIO0M+sNbqycDz7l9ypXeAJxf3c1KZynRr8qX/qqGnghZaS/RhVNZmC7KUlT+2qLPEnWy+utCK60gQjAoR5PTDu+BqWpgVBNMex9mnFRbC7e10o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783946815; c=relaxed/simple; bh=ymsp8cl9M8Fd7PxJTRqXLQ4Vfj/qZiueawGHqUmGaDk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OgWN9YN1wLOZrSYRuOQVYf69vSDfd9TfOTFNV/CROuWVZMcbI3qF2zR63p6RZJ2glbvhodDJuTc6gqVYPpgWIbFu8eN5VeIfRHbMvAOmNuQ4iWr/9D8Lalp3t63LjK8lfpEzb5DEiTBEf6zkL5gOxGszNKoIQbRhnDaNwkBHEj8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GRP/gz25; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GRP/gz25" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B64F1F000E9; Mon, 13 Jul 2026 12:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783946812; bh=cltpqVXnS+UipegdVjG6H4JzgTof6aV8cNIddYFm8VQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=GRP/gz25w2xR1NAqfs1ePOYLCePYh+8HZDvERuQkPTadEb/NBt0KmPV350hByp9+E 2eCypfoCj7VfhK2ZfFu53tetuL4Ok+6KY3UC3fPsuO8fwDvo0U/YQFS0QEBUmIa9B1 ZyLB/Pl+nnilO1e3zhzYvo+vHaERBwzYvNIje3CyTtN8kTJp1Ci/GaTxSsNP0+Mrj0 srnbCUYEJ4k8yJ4/KqFqXm32NYSN6f8Brz/9P0z5R0haG82HxT+TxLEhRoZ+EtdVmJ cfaIuer1dC27OQZK9v+tFdDDLs4EfYkhk6320XFSGN8TrKvTpJRVcgS3mWM94BLk8Y Zn8hibrzWaIGQ== From: Lorenzo Bianconi Date: Mon, 13 Jul 2026 14:46:21 +0200 Subject: [PATCH nf-next v6 4/6] selftests: netfilter: nft_flowtable.sh: add IPv4 over IPv6 flowtable selftest Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260713-b4-flowtable-sw-accel-ip6ip-v6-4-33f0155fc658@kernel.org> References: <20260713-b4-flowtable-sw-accel-ip6ip-v6-0-33f0155fc658@kernel.org> In-Reply-To: <20260713-b4-flowtable-sw-accel-ip6ip-v6-0-33f0155fc658@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 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 d9a21ca8ed2c..1cb5c65351b7 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 encaplimit none 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 encaplimit none || 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 @@ -640,6 +643,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 "IP4IP6 tunnel"; then + echo "FAIL: flow offload for ns1/ns2 with IP4IP6 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 @@ -661,7 +673,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 encaplimit none 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 \ @@ -682,7 +696,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 encaplimit none || 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 @@ -700,6 +716,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 "IP4IP6 tunnel over vlan"; then + echo "FAIL: flow offload for ns1/ns2 with IP4IP6 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 @@ -792,7 +817,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.55.0