diff mbox series

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

Message ID 20231010132113.3014691-3-idosch@nvidia.com (mailing list archive)
State Accepted
Commit aa13e5241a8fa32b26d5a6b8b63d04c6357243f4
Delegated to: Netdev Maintainers
Headers show
Series selftests: fib_tests: Fixes for multipath list receive tests | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 2 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch warning WARNING: line length of 100 exceeds 80 columns WARNING: line length of 98 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ido Schimmel Oct. 10, 2023, 1:21 p.m. UTC
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")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.com/
Tested-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 tools/testing/selftests/net/fib_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Ahern Oct. 10, 2023, 3:21 p.m. UTC | #1
On 10/10/23 7:21 AM, Ido Schimmel wrote:
> 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")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.com/
> Tested-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
>  tools/testing/selftests/net/fib_tests.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
Sriram Yagnaraman Oct. 11, 2023, 12:23 p.m. UTC | #2
> -----Original Message-----
> From: David Ahern <dsahern@kernel.org>
> Sent: Tuesday, 10 October 2023 17:22
> To: Ido Schimmel <idosch@nvidia.com>; netdev@vger.kernel.org
> Cc: davem@davemloft.net; kuba@kernel.org; pabeni@redhat.com;
> edumazet@google.com; dsahern@gmail.com; Sriram Yagnaraman
> <sriram.yagnaraman@est.tech>; oliver.sang@intel.com; mlxsw@nvidia.com
> Subject: Re: [PATCH net 2/2] selftests: fib_tests: Count all trace point
> invocations
> 
> On 10/10/23 7:21 AM, Ido Schimmel wrote:
> > 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")
> > Reported-by: kernel test robot <oliver.sang@intel.com>
> > Closes:
> > https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.
> > com/
> > Tested-by: kernel test robot <oliver.sang@intel.com>
> > Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> > ---
> >  tools/testing/selftests/net/fib_tests.sh | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> 
> Reviewed-by: David Ahern <dsahern@kernel.org>
> 
Tested-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index 0dbb26b4fa4a..66d0db7a2614 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -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