diff mbox series

[net,v2,09/17] selftests: forwarding: hw_stats_l3_gre: Skip when using veth pairs

Message ID 20230808141503.4060661-10-idosch@nvidia.com (mailing list archive)
State Accepted
Commit 9a711cde07c245a163d95eee5b42ed1871e73236
Delegated to: Netdev Maintainers
Headers show
Series selftests: forwarding: Various fixes | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
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 success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ido Schimmel Aug. 8, 2023, 2:14 p.m. UTC
Layer 3 hardware stats cannot be used when the underlying interfaces are
veth pairs, resulting in failures:

 # ./hw_stats_l3_gre.sh
 TEST: ping gre flat                                                 [ OK ]
 TEST: Test rx packets:                                              [FAIL]
         Traffic not reflected in the counter: 0 -> 0
 TEST: Test tx packets:                                              [FAIL]
         Traffic not reflected in the counter: 0 -> 0

Fix by skipping the test when used with veth pairs.

Fixes: 813f97a26860 ("selftests: forwarding: Add a tunnel-based test for L3 HW stats")
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>
---
 tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

Hangbin Liu Aug. 9, 2023, 2:02 a.m. UTC | #1
On Tue, Aug 08, 2023 at 05:14:55PM +0300, Ido Schimmel wrote:
> Layer 3 hardware stats cannot be used when the underlying interfaces are
> veth pairs, resulting in failures:
> 
>  # ./hw_stats_l3_gre.sh
>  TEST: ping gre flat                                                 [ OK ]
>  TEST: Test rx packets:                                              [FAIL]
>          Traffic not reflected in the counter: 0 -> 0
>  TEST: Test tx packets:                                              [FAIL]
>          Traffic not reflected in the counter: 0 -> 0
> 
> Fix by skipping the test when used with veth pairs.
> 
> Fixes: 813f97a26860 ("selftests: forwarding: Add a tunnel-based test for L3 HW stats")
> 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>
> ---
>  tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> index eb9ec4a68f84..7594bbb49029 100755
> --- a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> +++ b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> @@ -99,6 +99,8 @@ test_stats_rx()
>  	test_stats g2a rx
>  }
>  
> +skip_on_veth
> +
>  trap cleanup EXIT
>  
>  setup_prepare

Petr has been add a veth check for this script in a9fda7a0b033 ("selftests:
forwarding: hw_stats_l3: Detect failure to install counters"). I think we can
remove it with your patch?

Thanks
Hangbin
Ido Schimmel Aug. 9, 2023, 5:45 a.m. UTC | #2
On Wed, Aug 09, 2023 at 10:02:22AM +0800, Hangbin Liu wrote:
> On Tue, Aug 08, 2023 at 05:14:55PM +0300, Ido Schimmel wrote:
> > Layer 3 hardware stats cannot be used when the underlying interfaces are
> > veth pairs, resulting in failures:
> > 
> >  # ./hw_stats_l3_gre.sh
> >  TEST: ping gre flat                                                 [ OK ]
> >  TEST: Test rx packets:                                              [FAIL]
> >          Traffic not reflected in the counter: 0 -> 0
> >  TEST: Test tx packets:                                              [FAIL]
> >          Traffic not reflected in the counter: 0 -> 0
> > 
> > Fix by skipping the test when used with veth pairs.
> > 
> > Fixes: 813f97a26860 ("selftests: forwarding: Add a tunnel-based test for L3 HW stats")
> > 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>
> > ---
> >  tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> > index eb9ec4a68f84..7594bbb49029 100755
> > --- a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> > +++ b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
> > @@ -99,6 +99,8 @@ test_stats_rx()
> >  	test_stats g2a rx
> >  }
> >  
> > +skip_on_veth
> > +
> >  trap cleanup EXIT
> >  
> >  setup_prepare
> 
> Petr has been add a veth check for this script in a9fda7a0b033 ("selftests:
> forwarding: hw_stats_l3: Detect failure to install counters"). I think we can
> remove it with your patch?

Yes, I plan to remove it in net-next.
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
index eb9ec4a68f84..7594bbb49029 100755
--- a/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
+++ b/tools/testing/selftests/net/forwarding/hw_stats_l3_gre.sh
@@ -99,6 +99,8 @@  test_stats_rx()
 	test_stats g2a rx
 }
 
+skip_on_veth
+
 trap cleanup EXIT
 
 setup_prepare