All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, ecree.xilinx@gmail.com,
	gal@nvidia.com, joe@dama.to, linux-kselftest@vger.kernel.org,
	shuah@kernel.org
Subject: Re: [PATCH net-next 1/2] selftests: drv-net: rss_ctx: use Netlink for timed reconfig
Date: Mon, 1 Sep 2025 14:50:08 +0100	[thread overview]
Message-ID: <20250901135008.GC15473@horms.kernel.org> (raw)
In-Reply-To: <20250829220712.327920-1-kuba@kernel.org>

On Fri, Aug 29, 2025 at 03:07:11PM -0700, Jakub Kicinski wrote:
> The rss_ctx test has gotten pretty flaky after I increased
> the queue count in NIPA 2->3. Not 100% clear why. We get
> a lot of failures in the rss_ctx.test_hitless_key_update case.
> 
> Looking closer it appears that the failures are mostly due
> to startup costs. I measured the following timing for ethtool -X:
>  - python cmd(shell=True)  : 150-250msec
>  - python cmd(shell=False) :  50- 70msec
>  - timed in bash           :  45- 55msec
>  - YNL Netlink call        :   2-  4msec
>  - .set_rxfh callback      :   1-  2msec
> 
> The target in the test was set to 200msec. We were mostly measuring
> ethtool startup cost it seems. Switch to YNL since it's 100x faster.
> 
> Lower the pass criteria to ~75msec, no real science behind this number
> but we removed ~150msec of overhead, and the old target was 200msec.
> So any driver that was passing previously should still pass with 75msec.
> 
> Separately we should probably follow up on defaulting to shell=False,
> when script doesn't explicitly ask for True, because the overhead
> is rather significant.

+1

> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  tools/testing/selftests/drivers/net/hw/rss_ctx.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> index 9838b8457e5a..3fc5688605b5 100755
> --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> @@ -335,19 +335,20 @@ from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
>      data = get_rss(cfg)
>      key_len = len(data['rss-hash-key'])
>  
> -    key = _rss_key_rand(key_len)
> +    ethnl = EthtoolFamily()
> +    key = random.randbytes(key_len)

Is the update to the generation of key intended?
It's not clear to me how it relates to the rest of the patch.

>  
>      tgen = GenerateTraffic(cfg)
>      try:
>          errors0, carrier0 = get_drop_err_sum(cfg)
>          t0 = datetime.datetime.now()
> -        ethtool(f"-X {cfg.ifname} hkey " + _rss_key_str(key))
> +        ethnl.rss_set({"header": {"dev-index": cfg.ifindex}, "hkey": key})
>          t1 = datetime.datetime.now()
>          errors1, carrier1 = get_drop_err_sum(cfg)
>      finally:
>          tgen.wait_pkts_and_stop(5000)
>  
> -    ksft_lt((t1 - t0).total_seconds(), 0.2)
> +    ksft_lt((t1 - t0).total_seconds(), 0.075)
>      ksft_eq(errors1 - errors1, 0)
>      ksft_eq(carrier1 - carrier0, 0)
>  
> -- 
> 2.51.0
> 

  parent reply	other threads:[~2025-09-01 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 22:07 [PATCH net-next 1/2] selftests: drv-net: rss_ctx: use Netlink for timed reconfig Jakub Kicinski
2025-08-29 22:07 ` [PATCH net-next 2/2] selftests: drv-net: rss_ctx: make the test pass with few queues Jakub Kicinski
2025-09-01 13:50 ` Simon Horman [this message]
2025-09-01 17:26   ` [PATCH net-next 1/2] selftests: drv-net: rss_ctx: use Netlink for timed reconfig Jakub Kicinski
2025-09-02  9:01     ` Simon Horman

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=20250901135008.GC15473@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=joe@dama.to \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.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.