[PATCH net-next v8 00/12] selftests: ncdevmem: Add ncdevmem to ksft

Stanislav Fomichev posted 12 patches 2 weeks, 2 days ago
.../selftests/drivers/net/hw/.gitignore       |   1 +
.../testing/selftests/drivers/net/hw/Makefile |   9 +
.../selftests/drivers/net/hw/devmem.py        |  45 +
.../selftests/drivers/net/hw/ncdevmem.c       | 789 ++++++++++++++++++
tools/testing/selftests/net/.gitignore        |   1 -
tools/testing/selftests/net/Makefile          |   8 -
tools/testing/selftests/net/ncdevmem.c        | 570 -------------
7 files changed, 844 insertions(+), 579 deletions(-)
create mode 100644 tools/testing/selftests/drivers/net/hw/.gitignore
create mode 100755 tools/testing/selftests/drivers/net/hw/devmem.py
create mode 100644 tools/testing/selftests/drivers/net/hw/ncdevmem.c
delete mode 100644 tools/testing/selftests/net/ncdevmem.c
[PATCH net-next v8 00/12] selftests: ncdevmem: Add ncdevmem to ksft
Posted by Stanislav Fomichev 2 weeks, 2 days ago
The goal of the series is to simplify and make it possible to use
ncdevmem in an automated way from the ksft python wrapper.

ncdevmem is slowly mutated into a state where it uses stdout
to print the payload and the python wrapper is added to
make sure the arrived payload matches the expected one.

v8:
- move error() calls into enable_reuseaddr() (Joe)
- bail out when number of queues is 1 (Joe)
- use socat instead of nc (Joe)
- fix warning about string truncation buf[256]->buf[40] (Jakub)

v7:
- fix validation (Mina)
- add support for working with non ::ffff-prefixed addresses (Mina)

v6:
- fix compilation issue in 'Unify error handling' patch (Jakub)

v5:
- properly handle errors from inet_pton() and socket() (Paolo)
- remove unneeded import from python selftest (Paolo)

v4:
- keep usage example with validation (Mina)
- fix compilation issue in one patch (s/start_queues/start_queue/)

v3:
- keep and refine the comment about ncdevmem invocation (Mina)
- add the comment about not enforcing exit status for ntuple reset (Mina)
- make configure_headersplit more robust (Mina)
- use num_queues/2 in selftest and let the users override it (Mina)
- remove memory_provider.memcpy_to_device (Mina)
- keep ksft as is (don't use -v validate flags): we are gonna
  need a --debug-disable flag to make it less chatty; otherwise
  it times out when sending too much data; so leaving it as
  a separate follow up

v2:
- don't remove validation (Mina)
- keep 5-tuple flow steering but use it only when -c is provided (Mina)
- remove separate flag for probing (Mina)
- move ncdevmem under drivers/net/hw, not drivers/net (Jakub)

Cc: Mina Almasry <almasrymina@google.com>

Stanislav Fomichev (12):
  selftests: ncdevmem: Redirect all non-payload output to stderr
  selftests: ncdevmem: Separate out dmabuf provider
  selftests: ncdevmem: Unify error handling
  selftests: ncdevmem: Make client_ip optional
  selftests: ncdevmem: Remove default arguments
  selftests: ncdevmem: Switch to AF_INET6
  selftests: ncdevmem: Properly reset flow steering
  selftests: ncdevmem: Use YNL to enable TCP header split
  selftests: ncdevmem: Remove hard-coded queue numbers
  selftests: ncdevmem: Run selftest when none of the -s or -c has been
    provided
  selftests: ncdevmem: Move ncdevmem under drivers/net/hw
  selftests: ncdevmem: Add automated test

 .../selftests/drivers/net/hw/.gitignore       |   1 +
 .../testing/selftests/drivers/net/hw/Makefile |   9 +
 .../selftests/drivers/net/hw/devmem.py        |  45 +
 .../selftests/drivers/net/hw/ncdevmem.c       | 789 ++++++++++++++++++
 tools/testing/selftests/net/.gitignore        |   1 -
 tools/testing/selftests/net/Makefile          |   8 -
 tools/testing/selftests/net/ncdevmem.c        | 570 -------------
 7 files changed, 844 insertions(+), 579 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/hw/.gitignore
 create mode 100755 tools/testing/selftests/drivers/net/hw/devmem.py
 create mode 100644 tools/testing/selftests/drivers/net/hw/ncdevmem.c
 delete mode 100644 tools/testing/selftests/net/ncdevmem.c

-- 
2.47.0
Re: [PATCH net-next v8 00/12] selftests: ncdevmem: Add ncdevmem to ksft
Posted by Joe Damato 2 weeks, 2 days ago
On Thu, Nov 07, 2024 at 10:11:59AM -0800, Stanislav Fomichev wrote:
> The goal of the series is to simplify and make it possible to use
> ncdevmem in an automated way from the ksft python wrapper.
> 
> ncdevmem is slowly mutated into a state where it uses stdout
> to print the payload and the python wrapper is added to
> make sure the arrived payload matches the expected one.
> 
> v8:
> - move error() calls into enable_reuseaddr() (Joe)
> - bail out when number of queues is 1 (Joe)

Thanks for all the work on the refactor; sorry for the nit-picking
on the queue counts. I just thought of it because in my test for
busy poll stuff, netdevsim uses 1 queue.

Having tests like this factored nicely really helps when people
(like me) go to try to write a test for the first time and have a
good example like this to follow :)
Re: [PATCH net-next v8 00/12] selftests: ncdevmem: Add ncdevmem to ksft
Posted by Stanislav Fomichev 2 weeks, 1 day ago
On 11/07, Joe Damato wrote:
> On Thu, Nov 07, 2024 at 10:11:59AM -0800, Stanislav Fomichev wrote:
> > The goal of the series is to simplify and make it possible to use
> > ncdevmem in an automated way from the ksft python wrapper.
> > 
> > ncdevmem is slowly mutated into a state where it uses stdout
> > to print the payload and the python wrapper is added to
> > make sure the arrived payload matches the expected one.
> > 
> > v8:
> > - move error() calls into enable_reuseaddr() (Joe)
> > - bail out when number of queues is 1 (Joe)
> 
> Thanks for all the work on the refactor; sorry for the nit-picking
> on the queue counts. I just thought of it because in my test for
> busy poll stuff, netdevsim uses 1 queue.
> 
> Having tests like this factored nicely really helps when people
> (like me) go to try to write a test for the first time and have a
> good example like this to follow :)

No worries, thanks for taking the time to review! nit-picks are fine
as wells since they are usually the easiest ones to address :-D