mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf, sockmap: Fix udp_bpf_recvmsg() spinning on backlog-only ingress
@ 2026-09-29  8:34 chenyuan_fl
  2026-09-29  8:34 ` [PATCH bpf-next 1/2] " chenyuan_fl
  2026-09-29  8:34 ` [PATCH bpf-next 2/2] selftests/bpf: Add a test for udp_bpf_recvmsg() with a stuck backlog chenyuan_fl
  0 siblings, 2 replies; 5+ messages in thread
From: chenyuan_fl @ 2026-09-29  8:34 UTC (permalink / raw)
  To: netdev, bpf
  Cc: john.fastabend, jakub, jiayuan.chen, daniel, ast, cong.wang,
	linux-kernel

From: Yuan Chen <chenyuan@kylinos.cn>

udp_bpf_recvmsg() re-arms its receive loop on backlog-only skbs that
sk_msg_recvmsg() can never consume: whenever the backlog stays
populated, the loop re-arms on the same skb forever and recvmsg()
spins while holding the socket lock instead of sleeping.

Patch 1 aligns the re-arm condition with TCP and unix_bpf_recvmsg();
patch 2 adds a selftest that reproduces the hang.

Yuan Chen (2):
  bpf, sockmap: Fix udp_bpf_recvmsg() spinning on backlog-only ingress
  selftests/bpf: Add a test for udp_bpf_recvmsg() with a stuck backlog

 net/ipv4/udp_bpf.c                            |   2 +-
 .../bpf/prog_tests/sockmap_udp_backlog.c      | 141 ++++++++++++++++++
 .../bpf/progs/test_sockmap_udp_backlog.c      |  21 +++
 3 files changed, 163 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_udp_backlog.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_udp_backlog.c

-- 
2.54.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-30  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29  8:34 [PATCH bpf-next 0/2] bpf, sockmap: Fix udp_bpf_recvmsg() spinning on backlog-only ingress chenyuan_fl
2026-09-29  8:34 ` [PATCH bpf-next 1/2] " chenyuan_fl
2026-09-30  9:01   ` Alexei Starovoitov
2026-09-29  8:34 ` [PATCH bpf-next 2/2] selftests/bpf: Add a test for udp_bpf_recvmsg() with a stuck backlog chenyuan_fl
2026-09-29  9:26   ` bot+bpf-ci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®