Spurious wakeups in tcp_msg_wait_data() isn't being handled by
tcp_bpf_recvmsg() and tcp_bpf_recvmsg_parser(), leading to unexpected
EAGAIN errors returned by recvfrom()/recv(). Adding handling for the
wakeup and a selftest.
Changes in v2:
- In tcp_bpf_recvmsg, handle signals and the socket closing in the loop.
- Fix spurious wakeups when SO_RCVTIMEO has been set on the socket.
- Link to v1: https://patch.msgid.link/ak_rR-Skd8Mvn4mH@localhost.localdomain
Changes in v3:
- Added the sockmap_recvfrom selftest.
- Link to v2: https://patch.msgid.link/alFRK66z45eDNZA7@localhost.localdomain
Signed-off-by: Nnamdi Onyeyiri <redacted>
---
Nnamdi Onyeyiri (2):
bpf, sockmap: handle spurious tcp_msg_wait_data() wakeup
bpf, sockmap: handle spurious tcp_msg_wait_data() wakeup
net/ipv4/tcp_bpf.c | 55 +++-
tools/testing/selftests/net/.gitignore | 2 +
tools/testing/selftests/net/Makefile | 6 +
.../selftests/net/sockmap_recvfrom.bpf.c | 31 ++
.../testing/selftests/net/sockmap_recvfrom.c | 288 ++++++++++++++++++
5 files changed, 373 insertions(+), 9 deletions(-)
create mode 100644 tools/testing/selftests/net/sockmap_recvfrom.bpf.c
create mode 100644 tools/testing/selftests/net/sockmap_recvfrom.c
--
2.52.0