mbox series

[bpf-next,0/9] selftests: xsk: add busy-poll testing plus various fixes

Message ID 20220510115604.8717-1-magnus.karlsson@gmail.com (mailing list archive)
Headers show
Series selftests: xsk: add busy-poll testing plus various fixes | expand

Message

Magnus Karlsson May 10, 2022, 11:55 a.m. UTC
This patch set adds busy-poll testing to the xsk selftests. It runs
exactly the same tests as with regular softirq processing, but with
busy-poll enabled. I have also included a number of fixes to the
selftests that have been bugging me for a while or was discovered
while implementing the busy-poll support. In summary these are:

* Fix the error reporting of failed tests. Each failed test used to be
  reported as both failed and passed, messing up things.

* Added a summary test printout at the end of the test suite so that
  users do not have to scroll up and look at the result of both the
  softirq run and the busy_poll run.

* Added a timeout to the tests, so that if a test locks up, we report
  a fail and still get to run all the other tests.

* Made the stats test just look and feel like all the other
  tests. Makes the code simpler and the test reporting more
  consistent. These are the 3 last commits.

* Replaced zero length packets with packets of 64 byte length. This so
  that some of the tests will pass after commit 726e2c5929de84 ("veth:
  Ensure eth header is in skb's linear part").

* Added clean-up of the veth pair when terminating the test run.

* Some smaller clean-ups of unused stuff.

Note, to pass the busy-poll tests commit 8de8b71b787f ("xsk: Fix
l2fwd for copy mode + busy poll combo") need to be present. It is
present in bpf but not yet in bpf-next.

Thanks: Magnus

Magnus Karlsson (9):
  selftests: xsk: cleanup bash scripts
  selftests: xsk: do not send zero-length packets
  selftests: xsk: run all tests for busy-poll
  selftests: xsk: fix reporting of failed tests
  selftests: xsk: add timeout to tests
  selftests: xsk: cleanup veth pair at ctrl-c
  selftests: xsk: introduce validation functions
  selftests: xsk: make the stats tests normal tests
  selftests: xsk: make stat tests not spin on getsockopt

 tools/testing/selftests/bpf/test_xsk.sh    |  53 +-
 tools/testing/selftests/bpf/xdpxceiver.c   | 547 ++++++++++++++-------
 tools/testing/selftests/bpf/xdpxceiver.h   |  42 +-
 tools/testing/selftests/bpf/xsk_prereqs.sh |  47 +-
 4 files changed, 439 insertions(+), 250 deletions(-)


base-commit: 43bf087848ab796fab93c9b4de59a7ed70aab94a
--
2.34.1

Comments

Alexei Starovoitov May 10, 2022, 5:07 p.m. UTC | #1
On Tue, May 10, 2022 at 01:55:55PM +0200, Magnus Karlsson wrote:
> This patch set adds busy-poll testing to the xsk selftests. It runs
> exactly the same tests as with regular softirq processing, but with
> busy-poll enabled. I have also included a number of fixes to the
> selftests that have been bugging me for a while or was discovered
> while implementing the busy-poll support. In summary these are:
> 
> * Fix the error reporting of failed tests. Each failed test used to be
>   reported as both failed and passed, messing up things.
> 
> * Added a summary test printout at the end of the test suite so that
>   users do not have to scroll up and look at the result of both the
>   softirq run and the busy_poll run.
> 
> * Added a timeout to the tests, so that if a test locks up, we report
>   a fail and still get to run all the other tests.
> 
> * Made the stats test just look and feel like all the other
>   tests. Makes the code simpler and the test reporting more
>   consistent. These are the 3 last commits.
> 
> * Replaced zero length packets with packets of 64 byte length. This so
>   that some of the tests will pass after commit 726e2c5929de84 ("veth:
>   Ensure eth header is in skb's linear part").
> 
> * Added clean-up of the veth pair when terminating the test run.
> 
> * Some smaller clean-ups of unused stuff.

Sounds like a good set of improvements and fixes.

Bjorn,
please review.
Björn Töpel May 11, 2022, 2:08 p.m. UTC | #2
On Tue, 10 May 2022 at 13:56, Magnus Karlsson <magnus.karlsson@gmail.com> wrote:
>
> This patch set adds busy-poll testing to the xsk selftests. It runs
> exactly the same tests as with regular softirq processing, but with
> busy-poll enabled. I have also included a number of fixes to the
> selftests that have been bugging me for a while or was discovered
> while implementing the busy-poll support. In summary these are:
>

Nice additions, and nice cleanups. Awesome, Magnus!

Acked-by: Björn Töpel <bjorn@kernel.org>
patchwork-bot+netdevbpf@kernel.org May 11, 2022, 3:10 p.m. UTC | #3
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Tue, 10 May 2022 13:55:55 +0200 you wrote:
> This patch set adds busy-poll testing to the xsk selftests. It runs
> exactly the same tests as with regular softirq processing, but with
> busy-poll enabled. I have also included a number of fixes to the
> selftests that have been bugging me for a while or was discovered
> while implementing the busy-poll support. In summary these are:
> 
> * Fix the error reporting of failed tests. Each failed test used to be
>   reported as both failed and passed, messing up things.
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/9] selftests: xsk: cleanup bash scripts
    https://git.kernel.org/bpf/bpf-next/c/685e64a3c91d
  - [bpf-next,2/9] selftests: xsk: do not send zero-length packets
    https://git.kernel.org/bpf/bpf-next/c/f3e619bb34d3
  - [bpf-next,3/9] selftests: xsk: run all tests for busy-poll
    https://git.kernel.org/bpf/bpf-next/c/f90062b53229
  - [bpf-next,4/9] selftests: xsk: fix reporting of failed tests
    https://git.kernel.org/bpf/bpf-next/c/895b62eed2ab
  - [bpf-next,5/9] selftests: xsk: add timeout to tests
    https://git.kernel.org/bpf/bpf-next/c/db1bd7a99454
  - [bpf-next,6/9] selftests: xsk: cleanup veth pair at ctrl-c
    https://git.kernel.org/bpf/bpf-next/c/d41cb6c47474
  - [bpf-next,7/9] selftests: xsk: introduce validation functions
    https://git.kernel.org/bpf/bpf-next/c/76c576638f5d
  - [bpf-next,8/9] selftests: xsk: make the stats tests normal tests
    https://git.kernel.org/bpf/bpf-next/c/4fec7028ffea
  - [bpf-next,9/9] selftests: xsk: make stat tests not spin on getsockopt
    https://git.kernel.org/bpf/bpf-next/c/27e934bec35b

You are awesome, thank you!