diff mbox series

[net-next,v2,01/12] selftests: drv-net: rss_ctx: add identifier to traffic comments

Message ID 20240803042624.970352-2-kuba@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series ethtool: rss: driver tweaks and netlink context dumps | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; GEN HAS DIFF 2 files changed, 119 insertions(+);
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 2 maintainers not CCed: linux-kselftest@vger.kernel.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-06--00-00 (tests: 707)

Commit Message

Jakub Kicinski Aug. 3, 2024, 4:26 a.m. UTC
Include the "name" of the context in the comment for traffic
checks. Makes it easier to reason about which context failed
when we loop over 32 contexts (it may matter if we failed in
first vs last, for example).

Reviewed-by: Joe Damato <jdamato@fastly.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/drivers/net/hw/rss_ctx.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gal Pressman Aug. 4, 2024, 6:40 a.m. UTC | #1
On 03/08/2024 7:26, Jakub Kicinski wrote:
> Include the "name" of the context in the comment for traffic
> checks. Makes it easier to reason about which context failed
> when we loop over 32 contexts (it may matter if we failed in
> first vs last, for example).
> 
> Reviewed-by: Joe Damato <jdamato@fastly.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  tools/testing/selftests/drivers/net/hw/rss_ctx.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> index 011508ca604b..1da6b214f4fe 100755
> --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> @@ -90,10 +90,10 @@ from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
>      ksft_ge(directed, 20000, f"traffic on {name}: " + str(cnts))
>      if params.get('noise'):
>          ksft_lt(sum(cnts[i] for i in params['noise']), directed / 2,
> -                "traffic on other queues:" + str(cnts))
> +                f"traffic on other queues ({name})':" + str(cnts))

You've already converted to an f-string, why not shove in the 'str(cnts)'?

Reviewed-by: Gal Pressman <gal@nvidia.com>
Jakub Kicinski Aug. 5, 2024, 9:35 p.m. UTC | #2
On Sun, 4 Aug 2024 09:40:58 +0300 Gal Pressman wrote:
> > diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> > index 011508ca604b..1da6b214f4fe 100755
> > --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> > +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> > @@ -90,10 +90,10 @@ from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
> >      ksft_ge(directed, 20000, f"traffic on {name}: " + str(cnts))
> >      if params.get('noise'):
> >          ksft_lt(sum(cnts[i] for i in params['noise']), directed / 2,
> > -                "traffic on other queues:" + str(cnts))
> > +                f"traffic on other queues ({name})':" + str(cnts))  
> 
> You've already converted to an f-string, why not shove in the 'str(cnts)'?

For (possibly misguided) consistency, there are 2 other functions which
use the " + str(cnts)" format to append the per-queue stats to comment.

> Reviewed-by: Gal Pressman <gal@nvidia.com>

Thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index 011508ca604b..1da6b214f4fe 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -90,10 +90,10 @@  from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
     ksft_ge(directed, 20000, f"traffic on {name}: " + str(cnts))
     if params.get('noise'):
         ksft_lt(sum(cnts[i] for i in params['noise']), directed / 2,
-                "traffic on other queues:" + str(cnts))
+                f"traffic on other queues ({name})':" + str(cnts))
     if params.get('empty'):
         ksft_eq(sum(cnts[i] for i in params['empty']), 0,
-                "traffic on inactive queues: " + str(cnts))
+                f"traffic on inactive queues ({name}): " + str(cnts))
 
 
 def test_rss_key_indir(cfg):