All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: David Wei <dw@davidwei.uk>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, willemdebruijn.kernel@gmail.com,
	ecree.xilinx@gmail.com
Subject: Re: [PATCH net-next 4/4] selftests: drv-net: rss_ctx: add tests for RSS configuration and contexts
Date: Thu, 20 Jun 2024 19:26:05 -0700	[thread overview]
Message-ID: <20240620192605.3ddba920@kernel.org> (raw)
In-Reply-To: <fc0b5d42-0ab6-4ce1-b0ee-2345b4ae9b2f@davidwei.uk>

On Thu, 20 Jun 2024 18:52:21 -0700 David Wei wrote:
> On 2024-06-20 16:29, Jakub Kicinski wrote:
> > +def get_rss(cfg):
> > +    return ethtool(f"-x {cfg.ifname}", json=True)[0]  
> 
> At this point I think json=True can be the default.

for ethtool specifically I'm constantly annoyed by how many sub-commands
don't support JSON. I don't think we'll win much, and the grand plan
is to have a netlink API for all of this, and switch to YNL calls.

> > +    cnts = _get_rx_cnts(cfg)
> > +    GenerateTraffic(cfg).wait_pkts_and_stop(20000)
> > +    cnts = _get_rx_cnts(cfg, prev=cnts)
> > +    # First two queues get less traffic than all the rest
> > +    ksft_ge(sum(cnts[2:]), sum(cnts[:2]), "traffic distributed: " + str(cnts))  
> 
> Do you need to check the number of queues? If it's 3 then would this
> check potentially fail?

Yeah, I lazy'd out, because ethtool -l doesn't support JSON! Ugh.
At least on my machine. I'll add the check base on qstat, like I did
in one of the later tests.

> > +        for i in range(ctx_cnt):
> > +            cnts = _get_rx_cnts(cfg)
> > +            GenerateTraffic(cfg, port=ports[i]).wait_pkts_and_stop(20000)
> > +            cnts = _get_rx_cnts(cfg, prev=cnts)
> > +
> > +            ksft_lt(sum(cnts[ :2]), 10000, "traffic on main context:" + str(cnts))  
> 
> What if the host is getting significant traffic during the test?

Then IDK how to write a reasonable RSS test :) Hopefully 10k compared
to the 20k of iperf is pretty safe, but we'll find out...

> > +            ksft_ge(sum(cnts[2+i*2:4+i*2]), 20000, f"traffic on context {i}: " + str(cnts))  
> 
> Is this exactly 20000?

Not sure I follow but ge means >=, iperf will probably do some more
before we manage to stop it.

> > +
> > +def test_rss_context_overlap2(cfg):
> > +    test_rss_context_overlap(cfg, True)  
> 
> Add a test case for other_ctx=0?

context 0 (i.e. the main one) will get tested when called directly.
Annoyingly ethtool userspace is a bit picky about using context 0
as an id on the command line, hence the special handling in the test.

  reply	other threads:[~2024-06-21  2:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 23:28 [PATCH net-next 0/4] selftests: drv-net: rss_ctx: add tests for RSS contexts Jakub Kicinski
2024-06-20 23:28 ` [PATCH net-next 1/4] selftests: drv-net: try to check if port is in use Jakub Kicinski
2024-06-21  1:52   ` David Wei
2024-06-23  7:34   ` Willem de Bruijn
2024-06-24 13:59   ` Przemek Kitszel
2024-06-20 23:28 ` [PATCH net-next 2/4] selftests: drv-net: add helper to wait for HW stats to sync Jakub Kicinski
2024-06-23  7:37   ` Willem de Bruijn
2024-06-24 14:43     ` Jakub Kicinski
2024-06-20 23:29 ` [PATCH net-next 3/4] selftests: drv-net: add ability to wait for at least N packets to load gen Jakub Kicinski
2024-06-21  1:14   ` David Wei
2024-06-20 23:29 ` [PATCH net-next 4/4] selftests: drv-net: rss_ctx: add tests for RSS configuration and contexts Jakub Kicinski
2024-06-21  1:52   ` David Wei
2024-06-21  2:26     ` Jakub Kicinski [this message]
2024-06-23  8:03   ` Willem de Bruijn
2024-06-24 14:50     ` Jakub Kicinski
2024-06-24 16:02       ` Jakub Kicinski
2024-06-24 12:55   ` Edward Cree
2024-06-24 14:54     ` Jakub Kicinski

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=20240620192605.3ddba920@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 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.