diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2020-12-10 17:34:07 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-12-10 23:13:43 +0100 |
commit | 092fde0f863b72b67c4d6dc03844f5658fc00a35 (patch) | |
tree | 5a20111f66b94fd0aa33b22bbc7d59104cdb77c3 /samples/bpf/tracex2_user.c | |
parent | selftests/bpf: Make selftest compilation work on clang 11 (diff) | |
download | linux-092fde0f863b72b67c4d6dc03844f5658fc00a35.tar.xz linux-092fde0f863b72b67c4d6dc03844f5658fc00a35.zip |
samples/bpf: Fix possible hang in xdpsock with multiple threads
Fix a possible hang in xdpsock that can occur when using multiple
threads. In this case, one or more of the threads might get stuck in
the while-loop in tx_only after the user has signaled the main thread
to stop execution. In this case, no more Tx packets will be sent, so a
thread might get stuck in the aforementioned while-loop. Fix this by
introducing a test inside the while-loop to check if the benchmark has
been terminated. If so, return from the function.
Fixes: cd9e72b6f210 ("samples/bpf: xdpsock: Add option to specify batch size")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20201210163407.22066-1-magnus.karlsson@gmail.com
Diffstat (limited to 'samples/bpf/tracex2_user.c')
0 files changed, 0 insertions, 0 deletions