]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: xsk: make stat tests not spin on getsockopt
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 10 May 2022 11:56:04 +0000 (13:56 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 11 May 2022 15:03:16 +0000 (08:03 -0700)
commitfb77b0b6c78ea443eba75feb4b3dc0dca95c054c
tree55016cebef2405d7d8b6b78f5297f0f5946fa502
parent1bf7aa9faf8cdf5adb9bc58f18b35fff589d47ec
selftests: xsk: make stat tests not spin on getsockopt

Convert the stats tests from spinning on the getsockopt to just check
getsockopt once when the Rx thread has received all the packets. The
actual completion of receiving the last packet forms a natural point
in time when the receiver is ready to call the getsockopt to check the
stats. In the previous version , we just span on the getsockopt until
we received the right answer. This could be forever or just getting
the "correct" answer by shear luck.

The pacing_on variable can now be dropped since all test can now
handle pacing properly.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/r/20220510115604.8717-10-magnus.karlsson@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h