All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <petrm@nvidia.com>, <razor@blackwall.org>,
	<mirsad.todorovac@alu.unizg.hr>, Ido Schimmel <idosch@nvidia.com>,
	<dcaratti@redhat.com>
Subject: [PATCH net v2 13/17] selftests: forwarding: tc_tunnel_key: Make filters more specific
Date: Tue, 8 Aug 2023 17:14:59 +0300	[thread overview]
Message-ID: <20230808141503.4060661-14-idosch@nvidia.com> (raw)
In-Reply-To: <20230808141503.4060661-1-idosch@nvidia.com>

The test installs filters that match on various IP fragments (e.g., no
fragment, first fragment) and expects a certain amount of packets to hit
each filter. This is problematic as the filters are not specific enough
and can match IP packets (e.g., IGMP) generated by the stack, resulting
in failures [1].

Fix by making the filters more specific and match on more fields in the
IP header: Source IP, destination IP and protocol.

[1]
 # timeout set to 0
 # selftests: net/forwarding: tc_tunnel_key.sh
 # TEST: tunnel_key nofrag (skip_hw)                                   [FAIL]
 #       packet smaller than MTU was not tunneled
 # INFO: Could not test offloaded functionality
 not ok 89 selftests: net/forwarding: tc_tunnel_key.sh # exit=1

Fixes: 533a89b1940f ("selftests: forwarding: add tunnel_key "nofrag" test case")
Reported-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Acked-by: Davide Caratti <dcaratti@redhat.com>
---
Cc: dcaratti@redhat.com
---
 tools/testing/selftests/net/forwarding/tc_tunnel_key.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/tc_tunnel_key.sh b/tools/testing/selftests/net/forwarding/tc_tunnel_key.sh
index 5ac184d51809..5a5dd9034819 100755
--- a/tools/testing/selftests/net/forwarding/tc_tunnel_key.sh
+++ b/tools/testing/selftests/net/forwarding/tc_tunnel_key.sh
@@ -104,11 +104,14 @@ tunnel_key_nofrag_test()
 	local i
 
 	tc filter add dev $swp1 ingress protocol ip pref 100 handle 100 \
-		flower ip_flags nofrag action drop
+		flower src_ip 192.0.2.1 dst_ip 192.0.2.2 ip_proto udp \
+		ip_flags nofrag action drop
 	tc filter add dev $swp1 ingress protocol ip pref 101 handle 101 \
-		flower ip_flags firstfrag action drop
+		flower src_ip 192.0.2.1 dst_ip 192.0.2.2 ip_proto udp \
+		ip_flags firstfrag action drop
 	tc filter add dev $swp1 ingress protocol ip pref 102 handle 102 \
-		flower ip_flags nofirstfrag action drop
+		flower src_ip 192.0.2.1 dst_ip 192.0.2.2 ip_proto udp \
+		ip_flags nofirstfrag action drop
 
 	# test 'nofrag' set
 	tc filter add dev h1-et egress protocol all pref 1 handle 1 matchall $tcflags \
-- 
2.40.1


  parent reply	other threads:[~2023-08-08 15:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 14:14 [PATCH net v2 00/17] selftests: forwarding: Various fixes Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 01/17] selftests: forwarding: Skip test when no interfaces are specified Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 02/17] selftests: forwarding: Switch off timeout Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 03/17] selftests: forwarding: bridge_mdb: Check iproute2 version Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 04/17] selftests: forwarding: bridge_mdb_max: " Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 05/17] selftests: forwarding: Set default IPv6 traceroute utility Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 06/17] selftests: forwarding: Add a helper to skip test when using veth pairs Ido Schimmel
2023-08-09  1:55   ` Hangbin Liu
2023-08-09  5:47     ` Ido Schimmel
2023-08-09  6:46       ` Hangbin Liu
2023-08-08 14:14 ` [PATCH net v2 07/17] selftests: forwarding: ethtool: Skip " Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 08/17] selftests: forwarding: ethtool_extended_state: " Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 09/17] selftests: forwarding: hw_stats_l3_gre: " Ido Schimmel
2023-08-09  2:02   ` Hangbin Liu
2023-08-09  5:45     ` Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 10/17] selftests: forwarding: ethtool_mm: Skip when MAC Merge is not supported Ido Schimmel
2023-08-10 17:28   ` Vladimir Oltean
2023-08-08 14:14 ` [PATCH net v2 11/17] selftests: forwarding: tc_actions: Use ncat instead of nc Ido Schimmel
2023-08-08 14:14 ` [PATCH net v2 12/17] selftests: forwarding: tc_flower: Relax success criterion Ido Schimmel
2023-08-08 14:14 ` Ido Schimmel [this message]
2023-08-08 14:15 ` [PATCH net v2 14/17] selftests: forwarding: tc_flower_l2_miss: Fix failing test with old libnet Ido Schimmel
2023-08-08 14:15 ` [PATCH net v2 15/17] selftests: forwarding: bridge_mdb: " Ido Schimmel
2023-08-08 14:15 ` [PATCH net v2 16/17] selftests: forwarding: bridge_mdb_max: " Ido Schimmel
2023-08-08 14:15 ` [PATCH net v2 17/17] selftests: forwarding: bridge_mdb: Make test more robust Ido Schimmel
2023-08-09  6:47 ` [PATCH net v2 00/17] selftests: forwarding: Various fixes Hangbin Liu
2023-08-09 12:10 ` Nikolay Aleksandrov
2023-08-09 22:00 ` patchwork-bot+netdevbpf

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=20230808141503.4060661-14-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.