netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, petrm@nvidia.com,
	przemyslaw.kitszel@intel.com, ecree.xilinx@gmail.com
Subject: Re: [PATCH net-next 1/5] selftests: drv-net: rss_ctx: fix cleanup in the basic test
Date: Mon, 8 Jul 2024 09:13:26 -0700	[thread overview]
Message-ID: <20240708091326.4e704b46@kernel.org> (raw)
In-Reply-To: <66894c659cee8_12869e2942c@willemb.c.googlers.com.notmuch>

On Sat, 06 Jul 2024 09:53:41 -0400 Willem de Bruijn wrote:
> > @@ -89,6 +88,7 @@ from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
> >  
> >      # Set the indirection table
> >      ethtool(f"-X {cfg.ifname} equal 2")
> > +    reset_indir = defer(ethtool, f"-X {cfg.ifname} default")
> >      data = get_rss(cfg)
> >      ksft_eq(0, min(data['rss-indirection-table']))
> >      ksft_eq(1, max(data['rss-indirection-table']))
> > @@ -104,7 +104,7 @@ from lib.py import ethtool, ip, defer, GenerateTraffic, CmdExitFailure
> >      ksft_eq(sum(cnts[2:]), 0, "traffic on unused queues: " + str(cnts))
> >  
> >      # Restore, and check traffic gets spread again
> > -    ethtool(f"-X {cfg.ifname} default")
> > +    reset_indir.exec()  
> 
> When is this explicit exec needed?

When you want to run the cleanup _now_.

We construct the cleanup as soon as we allocate the resource,
it stays on the deferred list in case some exception makes us abort,
but the test may want to free the resource or reconfigure it further
as part of the test, in which case it can run .exec() (or cancel() to
discard the clean up without running it).

Here we do:
 1. constrain RSS
 2. run traffic (to check we're hitting expected queues)
 3. reset RSS
 4. run traffic (to check we're hitting all queues)

so step 3 runs the cleanup of step 1 explicitly.

  reply	other threads:[~2024-07-08 16:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  1:57 [PATCH net-next 0/5] selftests: drv-net: rss_ctx: more tests Jakub Kicinski
2024-07-05  1:57 ` [PATCH net-next 1/5] selftests: drv-net: rss_ctx: fix cleanup in the basic test Jakub Kicinski
2024-07-06 13:53   ` Willem de Bruijn
2024-07-08 16:13     ` Jakub Kicinski [this message]
2024-07-08 16:53       ` Willem de Bruijn
2024-07-05  1:57 ` [PATCH net-next 2/5] selftests: drv-net: rss_ctx: factor out send traffic and check Jakub Kicinski
2024-07-05  1:57 ` [PATCH net-next 3/5] selftests: drv-net: rss_ctx: test queue changes vs user RSS config Jakub Kicinski
2024-07-06 14:00   ` Willem de Bruijn
2024-07-08 16:17     ` Jakub Kicinski
2024-07-08 16:56       ` Willem de Bruijn
2024-07-08 20:04         ` Jakub Kicinski
2024-07-08 20:29           ` Willem de Bruijn
2024-07-05  1:57 ` [PATCH net-next 4/5] selftests: drv-net: rss_ctx: check behavior of indirection table resizing Jakub Kicinski
2024-07-06 14:03   ` Willem de Bruijn
2024-07-05  1:57 ` [PATCH net-next 5/5] selftests: drv-net: rss_ctx: test flow rehashing without impacting traffic Jakub Kicinski
2024-07-05 10:24 ` [PATCH net-next 0/5] selftests: drv-net: rss_ctx: more tests Pavan Chebbi

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=20240708091326.4e704b46@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).