bpf, sockmap: handle spurious tcp_msg_wait_data() wakeup
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest2 patches 4 repliesIn review
- v62 patches 6 repliesSuperseded
- v52 patches 1 replySuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 2 patches | 3 replies | Superseded | |
| v3 | 2 patches | 0 replies | Superseded |
Changes in v7 from the cover letter
- In tcp_bpf_recvmsg check for data in the TCP_CLOSE, !timeo and signal_pending branches.
- Refactored changes to tcp_bpf_recvmsg to reduce duplication.
- Increase the number of iterations in the selftests.
- Documented selftests numeric constants.
- Link to v6: https://patch.msgid.link/[email protected]
Patches in v7 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf, sockmap: handle spurious tcp_msg_wait_data() wakeupnet/ | +63 | 2 replies | |
| 2/2 | selftests/bpf: add sockmap recvfrom EAGAIN selftesttools/ | +136 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jiayuan Chen |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v7 0/2] bpf, sockmap: handle spurious tcp_msg_wait_data() wakeup
Spurious wakeups in tcp_msg_wait_data() aren'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.
This issue was first discovered in an application that adds sockets to a sockmap as a way to view the received data. No redirects or any other operations are performed.
Sashiko has noted a few other pre-existing issues in the same area
(https://patch.msgid.link/[email protected])
that can lead to EAGAIN in tcp_bpf_recvmsg() and tcp_bpf_recvmsg_parser(). A local run of Sashiko also identified a potential issue in tcp_bpf_recvmsg() handling zero-data FIN packets when the MSG_PEEK flag is set. To prevent this patchset from growing too large, I intend to submit follow up patches to address these once this one has been accepted.
Changes in v7:
- In tcp_bpf_recvmsg check for data in the TCP_CLOSE, !timeo and signal_pending branches.
- Refactored changes to tcp_bpf_recvmsg to reduce duplication.
- Increase the number of iterations in the selftests.
- Documented selftests numeric constants.
- Link to v6: https://patch.msgid.link/[email protected]
Changes in v6:
- Closing the file descriptor in the selftest worker thread.
- Ensuring the selftest loop breaks early for an error in the worker thread.
- Added comments to selftest regarding focus on EAGAIN error.
- Updated selftest commit message to imperative mood.
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- Move selftest from net into bpf/prog_tests/sockmap_basic.c
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Fix potential data loss in tcp_bpf_recvmsg() when a FIN or RST has been received.
- Check the return code of pthread_create() in the selftest.
- Fix race caused by using EXPECT macros in a thread in selftest.
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- Added the sockmap_recvfrom selftest.
- Link to v2: https://patch.msgid.link/[email protected]
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/[email protected]
---
Nnamdi Onyeyiri (2):
bpf, sockmap: handle spurious tcp_msg_wait_data() wakeup selftests/bpf: add sockmap recvfrom EAGAIN selftest
net/ipv4/tcp_bpf.c | 72 ++++++++-- .../selftests/bpf/prog_tests/sockmap_basic.c | 136 ++++++++++++++++++ 2 files changed, 199 insertions(+), 9 deletions(-)
Signature · 1 line
2.52.0