mbox series

[net-next,v2,0/4] selftests: drv-net: rss_ctx: add tests for RSS contexts

Message ID 20240625010210.2002310-1-kuba@kernel.org (mailing list archive)
Headers show
Series selftests: drv-net: rss_ctx: add tests for RSS contexts | expand

Message

Jakub Kicinski June 25, 2024, 1:02 a.m. UTC
Add a few tests exercising RSS context API.
In addition to basic sanity checks, tests add RSS contexts,
n-tuple rule to direct traffic to them (based on dst port),
and qstats to make sure traffic landed where we expected.

v2 adds a test for removing contexts out of order. When testing
bnxt - either the new test or running more tests after the overlap
test makes the device act strangely. To the point where it may start
giving out ntuple IDs of 0 for all rules :S

Ed, could you try the tests with your device?

  $ export NETIF=eth0 REMOTE_...
  $ ./drivers/net/hw/rss_ctx.py
  KTAP version 1
  1..8
  ok 1 rss_ctx.test_rss_key_indir
  ok 2 rss_ctx.test_rss_context
  ok 3 rss_ctx.test_rss_context4
  # Increasing queue count 44 -> 66
  # Failed to create context 32, trying to test what we got
  ok 4 rss_ctx.test_rss_context32 # SKIP Tested only 31 contexts, wanted 32
  ok 5 rss_ctx.test_rss_context_overlap
  ok 6 rss_ctx.test_rss_context_overlap2
  # .. sprays traffic like a headless chicken ..
  not ok 7 rss_ctx.test_rss_context_out_of_order
  ok 8 rss_ctx.test_rss_context4_create_with_cfg
  # Totals: pass:6 fail:1 xfail:0 xpass:0 skip:1 error:0

Jakub Kicinski (4):
  selftests: drv-net: try to check if port is in use
  selftests: drv-net: add helper to wait for HW stats to sync
  selftests: drv-net: add ability to wait for at least N packets to load
    gen
  selftests: drv-net: rss_ctx: add tests for RSS configuration and
    contexts

 .../testing/selftests/drivers/net/hw/Makefile |   1 +
 .../selftests/drivers/net/hw/rss_ctx.py       | 383 ++++++++++++++++++
 .../selftests/drivers/net/lib/py/env.py       |  20 +-
 .../selftests/drivers/net/lib/py/load.py      |  37 +-
 tools/testing/selftests/net/lib/py/ksft.py    |   5 +
 tools/testing/selftests/net/lib/py/utils.py   |  26 +-
 6 files changed, 457 insertions(+), 15 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/hw/rss_ctx.py

Comments

Jakub Kicinski June 25, 2024, 1:40 a.m. UTC | #1
On Mon, 24 Jun 2024 18:02:06 -0700 Jakub Kicinski wrote:
> v2 adds a test for removing contexts out of order. When testing
> bnxt - either the new test or running more tests after the overlap
> test makes the device act strangely. To the point where it may start
> giving out ntuple IDs of 0 for all rules :S

FWIW if I create the context with an indirection table, and then change
the key (without touching the indirection table) - it all works as
expected. So really seems like bnxt has a problem with setting the
indir table when context is created. That said I don't see anything
obviously wrong with the driver code.
Michael Chan June 25, 2024, 3:42 a.m. UTC | #2
On Mon, Jun 24, 2024 at 6:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 24 Jun 2024 18:02:06 -0700 Jakub Kicinski wrote:
> > v2 adds a test for removing contexts out of order. When testing
> > bnxt - either the new test or running more tests after the overlap
> > test makes the device act strangely. To the point where it may start
> > giving out ntuple IDs of 0 for all rules :S
>
> FWIW if I create the context with an indirection table, and then change
> the key (without touching the indirection table) - it all works as
> expected. So really seems like bnxt has a problem with setting the
> indir table when context is created. That said I don't see anything
> obviously wrong with the driver code.

We will look into it.  Thanks.
Willem de Bruijn June 25, 2024, 8:52 a.m. UTC | #3
Jakub Kicinski wrote:
> Add a few tests exercising RSS context API.
> In addition to basic sanity checks, tests add RSS contexts,
> n-tuple rule to direct traffic to them (based on dst port),
> and qstats to make sure traffic landed where we expected.
> 
> v2 adds a test for removing contexts out of order. When testing
> bnxt - either the new test or running more tests after the overlap
> test makes the device act strangely. To the point where it may start
> giving out ntuple IDs of 0 for all rules :S
> 
> Ed, could you try the tests with your device?
> 
>   $ export NETIF=eth0 REMOTE_...
>   $ ./drivers/net/hw/rss_ctx.py
>   KTAP version 1
>   1..8
>   ok 1 rss_ctx.test_rss_key_indir
>   ok 2 rss_ctx.test_rss_context
>   ok 3 rss_ctx.test_rss_context4
>   # Increasing queue count 44 -> 66
>   # Failed to create context 32, trying to test what we got
>   ok 4 rss_ctx.test_rss_context32 # SKIP Tested only 31 contexts, wanted 32
>   ok 5 rss_ctx.test_rss_context_overlap
>   ok 6 rss_ctx.test_rss_context_overlap2
>   # .. sprays traffic like a headless chicken ..
>   not ok 7 rss_ctx.test_rss_context_out_of_order
>   ok 8 rss_ctx.test_rss_context4_create_with_cfg
>   # Totals: pass:6 fail:1 xfail:0 xpass:0 skip:1 error:0
> 
> Jakub Kicinski (4):
>   selftests: drv-net: try to check if port is in use
>   selftests: drv-net: add helper to wait for HW stats to sync
>   selftests: drv-net: add ability to wait for at least N packets to load
>     gen
>   selftests: drv-net: rss_ctx: add tests for RSS configuration and
>     contexts

Good suggestion in patch 1 on symbolic errno.

Will leave one minor comment inline.

But overall LGTM, thanks.

Reviewed-by: Willem de Bruijn <willemb@google.com>