Skip to content

selftests/bpf: Fix sockmap_multi_channels reliability#11371

Closed
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf_basefrom
series/1065440=>bpf
Closed

selftests/bpf: Fix sockmap_multi_channels reliability#11371
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf_basefrom
series/1065440=>bpf

Conversation

@kernel-patches-daemon-bpf
Copy link
Copy Markdown

Pull request for series with
subject: selftests/bpf: Fix sockmap_multi_channels reliability
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: e06e6b8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 146bd2a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: a1e5c46
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 4a04d13
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: ec69c9e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

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: 17e2ce0 ("selftests/bpf: Add tests for FIONREAD and copied_seq")
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: c369299
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1065440 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot deleted the series/1065440=>bpf branch March 24, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant