All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: John Fastabend <john.fastabend@gmail.com>,
	lmb@cloudflare.com, jakub@cloudflare.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, ast@kernel.org
Subject: Re: [bpf-next PATCH v2 00/12] bpf: selftests, test_sockmap improvements
Date: Sat, 16 May 2020 03:02:38 +0200	[thread overview]
Message-ID: <b2233fba-09b0-a530-780e-c8ed238c6dee@iogearbox.net> (raw)
In-Reply-To: <158939706939.15176.10993188758954570904.stgit@john-Precision-5820-Tower>

On 5/13/20 9:12 PM, John Fastabend wrote:
> Note: requires fixes listed below to be merged into bpf-next before
>        applied.
> 
> Update test_sockmap to add ktls tests and in the process make output
> easier to understand and reduce overall runtime significantly. Before
> this series test_sockmap did a poor job of tracking sent bytes causing
> the recv thread to wait for a timeout even though all expected bytes
> had been received. Doing this many times causes significant delays.
> Further, we did many redundant tests because the send/recv test we used
> was not specific to the parameters we were testing. For example testing
> a failure case that always fails many times with different send sizes
> is mostly useless. If the test condition catches 10B in the kernel code
> testing 100B, 1kB, 4kB, and so on is just noise.
> 
> The main motivation for this is to add ktls tests, the last patch. Until
> now I have been running these locally but we haven't had them checked in
> to selftests. And finally I'm hoping to get these pushed into the libbpf
> test infrastructure so we can get more testing. For that to work we need
> ability to white and blacklist tests based on kernel features so we add
> that here as well.
> 
> The new output looks like this broken into test groups with subtest
> counters,
> 
>   $ time sudo ./test_sockmap
>   # 1/ 6  sockmap:txmsg test passthrough:OK
>   # 2/ 6  sockmap:txmsg test redirect:OK
>   ...
>   #22/ 1 sockhash:txmsg test push/pop data:OK
>   Pass: 22 Fail: 0
> 
>   real    0m9.790s
>   user    0m0.093s
>   sys     0m7.318s
> 
> The old output printed individual subtest and was rather noisy
> 
>   $ time sudo ./test_sockmap
>   [TEST 0]: (1, 1, 1, sendmsg, pass,): PASS
>   ...
>   [TEST 823]: (16, 1, 100, sendpage, ... ,pop (1599,1609),): PASS
>   Summary: 824 PASSED 0 FAILED
> 
>   real    0m56.761s
>   user    0m0.455s
>   sys     0m31.757s
> 
> So we are able to reduce time from ~56s to ~10s. To recover older more
> verbose output simply run with --verbose option. To whitelist and
> blacklist tests use the new --whitelist and --blacklist flags added. For
> example to run cork sockhash tests but only ones that don't have a receive
> hang (used to test negative cases) we could do,
> 
>   $ ./test_sockmap --whitelist="cork" --blacklist="sockmap,hang"
> 
> Requires these two fixes from net tree,
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=3e104c23816220919ea1b3fd93fabe363c67c484
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=81aabbb9fb7b4b1efd073b62f0505d3adad442f3
> 
> v1->v2: Addressed Jakub's comments, exit to _exit and strerror typo.
>          Added Jakubs Reviewed-by tag, Thanks!
> 
> ---
> 
> John Fastabend (12):
>        bpf: sockmap, msg_pop_data can incorrecty set an sge length
>        bpf: sockmap, bpf_tcp_ingress needs to subtract bytes from sg.size
>        bpf: selftests, move sockmap bpf prog header into progs
>        bpf: selftests, remove prints from sockmap tests
>        bpf: selftests, sockmap test prog run without setting cgroup
>        bpf: selftests, print error in test_sockmap error cases
>        bpf: selftests, improve test_sockmap total bytes counter
>        bpf: selftests, break down test_sockmap into subtests
>        bpf: selftests, provide verbose option for selftests execution
>        bpf: selftests, add whitelist option to test_sockmap
>        bpf: selftests, add blacklist to test_sockmap
>        bpf: selftests, add ktls tests to test_sockmap
> 
> 
>   .../selftests/bpf/progs/test_sockmap_kern.h        |  299 +++++++
>   tools/testing/selftests/bpf/test_sockmap.c         |  913 ++++++++++----------
>   tools/testing/selftests/bpf/test_sockmap_kern.h    |  451 ----------
>   3 files changed, 770 insertions(+), 893 deletions(-)
>   create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_kern.h
>   delete mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h

Applied 3-12, thanks!

      parent reply	other threads:[~2020-05-16  1:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 19:12 [bpf-next PATCH v2 00/12] bpf: selftests, test_sockmap improvements John Fastabend
2020-05-13 19:12 ` [bpf-next PATCH v2 01/12] bpf: sockmap, msg_pop_data can incorrecty set an sge length John Fastabend
2020-05-13 19:12 ` [bpf-next PATCH v2 02/12] bpf: sockmap, bpf_tcp_ingress needs to subtract bytes from sg.size John Fastabend
2020-05-13 19:13 ` [bpf-next PATCH v2 03/12] bpf: selftests, move sockmap bpf prog header into progs John Fastabend
2020-05-13 19:13 ` [bpf-next PATCH v2 04/12] bpf: selftests, remove prints from sockmap tests John Fastabend
2020-05-13 19:13 ` [bpf-next PATCH v2 05/12] bpf: selftests, sockmap test prog run without setting cgroup John Fastabend
2020-05-13 19:14 ` [bpf-next PATCH v2 06/12] bpf: selftests, print error in test_sockmap error cases John Fastabend
2020-05-13 19:14 ` [bpf-next PATCH v2 07/12] bpf: selftests, improve test_sockmap total bytes counter John Fastabend
2020-05-13 19:14 ` [bpf-next PATCH v2 08/12] bpf: selftests, break down test_sockmap into subtests John Fastabend
2020-05-13 19:15 ` [bpf-next PATCH v2 09/12] bpf: selftests, provide verbose option for selftests execution John Fastabend
2020-05-13 19:15 ` [bpf-next PATCH v2 10/12] bpf: selftests, add whitelist option to test_sockmap John Fastabend
2020-05-13 19:15 ` [bpf-next PATCH v2 11/12] bpf: selftests, add blacklist " John Fastabend
2020-05-13 19:16 ` [bpf-next PATCH v2 12/12] bpf: selftests, add ktls tests " John Fastabend
2020-05-16  1:02 ` Daniel Borkmann [this message]

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=b2233fba-09b0-a530-780e-c8ed238c6dee@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=lmb@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    /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.