]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Selftests, improve test_sockmap total bytes counter
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 13 May 2020 19:14:25 +0000 (12:14 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 16 May 2020 00:56:49 +0000 (02:56 +0200)
commitc4c3af1a2e1e52fa2e951cfc126b62259ce1421c
tree78827911ef4cfb0e31c8e946f71c94560fe5636f
parent9a8a4c0f1a7588607a9a3e7a5c17942907dfb73e
bpf: Selftests, improve test_sockmap total bytes counter

The recv thread in test_sockmap waits to receive all bytes from sender but
in the case we use pop data it may wait for more bytes then actually being
sent. This stalls the test harness for multiple seconds. Because this
happens in multiple tests it slows time to run the selftest.

Fix by doing a better job of accounting for total bytes when pop helpers
are used.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/158939726542.15176.5964532245173539540.stgit@john-Precision-5820-Tower
tools/testing/selftests/bpf/test_sockmap.c