Skip to contentSkip to conversation

selftests: fib_tests: Fixes for multipath list receive tests

PATCH Applied Ido Schimmel 4 participants 8 messages Oct 10, 2023 – Oct 13, 2023

Subsystems (4)
lore
Share & tools
lore

Ido Schimmel

author maintainer
#0 lore raw

cover selftests: fib_tests: Fixes for multipath list receive tests

Fix two issues in recently added FIB multipath list receive tests.

Ido Schimmel (2):
selftests: fib_tests: Disable RP filter in multipath list receive test
selftests: fib_tests: Count all trace point invocations

 tools/testing/selftests/net/fib_tests.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 1/2 selftests: fib_tests: Disable RP filter in multipath list receive test

The test relies on the fib:fib_table_lookup trace point being triggered once for each forwarded packet. If RP filter is not disabled, the trace point will be triggered twice for each packet (for source validation and forwarding), potentially masking actual bugs. Fix by explicitly disabling RP filter.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.99) [ OK ]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive tests")
---
 tools/testing/selftests/net/fib_tests.sh | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/net/fib_tests.sh +3 -0
index e7d2a530618a..0dbb26b4fa4a 100755
@@ -2437,6 +2437,9 @@ ipv4_mpath_list_test()
 	run_cmd "ip -n ns2 route add 203.0.113.0/24
 		nexthop via 172.16.201.2 nexthop via 172.16.202.2"
 	run_cmd "ip netns exec ns2 sysctl -qw net.ipv4.fib_multipath_hash_policy=1"
+	run_cmd "ip netns exec ns2 sysctl -qw net.ipv4.conf.veth2.rp_filter=0"
+	run_cmd "ip netns exec ns2 sysctl -qw net.ipv4.conf.all.rp_filter=0"
+	run_cmd "ip netns exec ns2 sysctl -qw net.ipv4.conf.default.rp_filter=0"
 	set +e
 
 	local dmac=$(ip -n ns2 -j link show dev veth2 | jq -r '.[]["address"]')
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH net 1/2] selftests: fib_tests: Disable RP filter in multipath list receive test

Quoted 20 lines · Ido Schimmel

The test relies on the fib:fib_table_lookup trace point being triggered once for each forwarded packet. If RP filter is not disabled, the trace point will be triggered twice for each packet (for source validation and forwarding), potentially masking actual bugs. Fix by explicitly disabling RP filter.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.99) [ OK ]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Quoted 9 lines
Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive tests")
---
 tools/testing/selftests/net/fib_tests.sh | 3 +++
 1 file changed, 3 insertions(+)
#3 lore raw

RE: [PATCH net 1/2] selftests: fib_tests: Disable RP filter in multipath list receive test

Quoted 46 lines

-----Original Message-----
From: David Ahern <[email protected]>
Sent: Tuesday, 10 October 2023 17:21
To: Ido Schimmel <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sriram Yagnaraman <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH net 1/2] selftests: fib_tests: Disable RP filter in multipath list receive test

Quoted 23 lines · Ido Schimmel

The test relies on the fib:fib_table_lookup trace point being triggered once for each forwarded packet. If RP filter is not disabled, the trace point will be triggered twice for each packet (for source validation and forwarding), potentially masking actual bugs. Fix by explicitly disabling RP filter.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.99) [ OK ]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive

tests")

Quoted 9 lines

Closes:
https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.
com/

---
 tools/testing/selftests/net/fib_tests.sh | 3 +++
 1 file changed, 3 insertions(+)
Quoted 2 lines

Thanks a lot for fixing this

author maintainer
#4 lore raw

PATCH 2/2 selftests: fib_tests: Count all trace point invocations

In reply to Ido Schimmel

The tests rely on the IPv{4,6} FIB trace points being triggered once for each forwarded packet. If receive processing is deferred to the ksoftirqd task these invocations will not be counted and the tests will fail. Fix by specifying the '-a' flag to avoid perf from filtering on the mausezahn task.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.68) [FAIL]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.27) [FAIL]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.00) [ OK ]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive tests")
---
 tools/testing/selftests/net/fib_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/net/fib_tests.sh +2 -2
index 0dbb26b4fa4a..66d0db7a2614 100755
@@ -2452,7 +2452,7 @@ ipv4_mpath_list_test()
 	# words, the FIB lookup tracepoint needs to be triggered for every
 	# packet.
 	local t0_rx_pkts=$(link_stats_get ns2 veth2 rx packets)
-	run_cmd "perf stat -e fib:fib_table_lookup --filter 'err == 0' -j -o $tmp_file -- $cmd"
+	run_cmd "perf stat -a -e fib:fib_table_lookup --filter 'err == 0' -j -o $tmp_file -- $cmd"
 	local t1_rx_pkts=$(link_stats_get ns2 veth2 rx packets)
 	local diff=$(echo $t1_rx_pkts - $t0_rx_pkts | bc -l)
 	list_rcv_eval $tmp_file $diff
@@ -2497,7 +2497,7 @@ ipv6_mpath_list_test()
 	# words, the FIB lookup tracepoint needs to be triggered for every
 	# packet.
 	local t0_rx_pkts=$(link_stats_get ns2 veth2 rx packets)
-	run_cmd "perf stat -e fib6:fib6_table_lookup --filter 'err == 0' -j -o $tmp_file -- $cmd"
+	run_cmd "perf stat -a -e fib6:fib6_table_lookup --filter 'err == 0' -j -o $tmp_file -- $cmd"
 	local t1_rx_pkts=$(link_stats_get ns2 veth2 rx packets)
 	local diff=$(echo $t1_rx_pkts - $t0_rx_pkts | bc -l)
 	list_rcv_eval $tmp_file $diff
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH net 2/2] selftests: fib_tests: Count all trace point invocations

Quoted 30 lines · Ido Schimmel

The tests rely on the IPv{4,6} FIB trace points being triggered once for each forwarded packet. If receive processing is deferred to the ksoftirqd task these invocations will not be counted and the tests will fail. Fix by specifying the '-a' flag to avoid perf from filtering on the mausezahn task.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.68) [FAIL]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.27) [FAIL]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.00) [ OK ]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Quoted 9 lines
Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive tests")
---
 tools/testing/selftests/net/fib_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#6 lore raw

RE: [PATCH net 2/2] selftests: fib_tests: Count all trace point invocations

Quoted 56 lines

-----Original Message-----
From: David Ahern <[email protected]>
Sent: Tuesday, 10 October 2023 17:22
To: Ido Schimmel <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sriram Yagnaraman <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH net 2/2] selftests: fib_tests: Count all trace point invocations

Quoted 33 lines · Ido Schimmel

The tests rely on the IPv{4,6} FIB trace points being triggered once for each forwarded packet. If receive processing is deferred to the ksoftirqd task these invocations will not be counted and the tests will fail. Fix by specifying the '-a' flag to avoid perf from filtering on the mausezahn task.

Before:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (.68) [FAIL]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.27) [FAIL]

After:

 # ./fib_tests.sh -t ipv4_mpath_list

IPv4 multipath list receive tests
TEST: Multipath route hit ratio (1.00) [ OK ]

 # ./fib_tests.sh -t ipv6_mpath_list

IPv6 multipath list receive tests
TEST: Multipath route hit ratio (.99) [ OK ]

Fixes 8ae9efb859c0 ("selftests: fib_tests: Add multipath list receive

tests")

Quoted 9 lines

Closes:
https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.
com/

---
 tools/testing/selftests/net/fib_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 2 lines
#7 lore raw
In reply to Ido Schimmel
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 10 Oct 2023 16:21:11 +0300 you wrote:

Fix two issues in recently added FIB multipath list receive tests.

Ido Schimmel (2):
selftests: fib_tests: Disable RP filter in multipath list receive test
selftests: fib_tests: Count all trace point invocations

 tools/testing/selftests/net/fib_tests.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Here is the summary with links:
- [net,1/2] selftests: fib_tests: Disable RP filter in multipath list receive test

    https://git.kernel.org/netdev/net/c/dbb13378ba30
  - [net,2/2] selftests: fib_tests: Count all trace point invocations
    https://git.kernel.org/netdev/net/c/aa13e5241a8f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html