diff options
| author | Jiayuan Chen <jiayuan.chen@shopee.com> | 2026-03-12 15:25:44 +0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-03-24 13:38:43 -0700 |
| commit | d9d7125e445dc06c2d9bd3dbd070dcbcd41a540f (patch) | |
| tree | 640c0b2b1010cc5d0d94c00f24128f97a51941d7 /tools/perf/scripts/python/task-analyzer.py | |
| parent | 2790db208b44c881d23be745868f2679c3ff1be5 (diff) | |
selftests/bpf: Fix sockmap_multi_channels reliability
Previously I added a FIONREAD test for sockmap, but it can occasionally
fail in CI [1].
The test sends 10 bytes in two segments (2 + 8). For UDP, FIONREAD only
reports the length of the first datagram, not the total queued data.
The original code used recv_timeout() expecting all 10 bytes, but under
high system load, the second datagram may not yet be processed by the
protocol stack, so recv would only return the first 2-byte datagram,
causing a size mismatch failure.
Fix this by receiving exactly the expected bytes (matching FIONREAD) in
the first recv. The remaining datagram is then consumed in a second recv
block, which is only reachable for UDP since TCP's expected already
equals sizeof(buf).
Test:
./test_progs -a sockmap_basic
410/1 sockmap_basic/sockmap create_update_free:OK
...
Summary: 1/35 PASSED, 0 SKIPPED, 0 FAILED
[1] https://github.com/kernel-patches/bpf/actions/runs/22919385910/job/66515395423
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Fixes: 17e2ce02bf56 ("selftests/bpf: Add tests for FIONREAD and copied_seq")
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Link: https://lore.kernel.org/r/20260312072549.6766-1-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
