Skip to content

fix poll behaviour for TCP-based tunnel protocols

Ralf Lici netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 5 repliesApplied 3/3
  2. v23 patches 4 repliesSuperseded
  3. v13 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Documented return value in datagram_poll() kernel-doc
- Replaced WARN_ON with WARN to print a custom message in ovpn_tcp_poll()

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net: datagram: introduce datagram_poll_queue for custom receive queuesinclude/linux/skbuff.h net/core/datagram.c+37 -102 repliesApplied
2/3espintcp: use datagram_poll_queue for socket readinessnet/xfrm/espintcp.c+1 -51 replyApplied
3/3ovpn: use datagram_poll_queue for socket readiness in TCPdrivers/net/ovpn/tcp.c+22 -42 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSabrina DubrocaAntonio Quartulli
1/3R-b R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/3] fix poll behaviour for TCP-based tunnel protocols

Hi all,

This patch series introduces a polling function for datagram-style sockets that operates on custom skb queues, and updates ovpn (the OpenVPN data-channel offload module) and espintcp (the TCP Encapsulation of IKE and IPsec Packets implementation) to use it accordingly.

Protocols like the aforementioned one decapsulate packets received over TCP and deliver userspace-bound data through a separate skb queue, not the standard sk_receive_queue. Previously, both relied on datagram_poll(), which would signal readiness based on non-userspace packets, leading to misleading poll results and unnecessary recv attempts in userspace.

Patch 1 introduces datagram_poll_queue(), a variant of datagram_poll() that accepts an explicit receive queue. This builds on the approach introduced in commit b50b058, which extended other skb-related functions to support custom queues. Patch 2 and 3 update espintcp_poll() and ovpn_tcp_poll() respectively to use this helper, ensuring readiness is only signaled when userspace data is available.

Each patch is self-contained and the ovpn one includes rationale and lifecycle enforcement where appropriate.

Thanks for your time and feedback.

Best Regards,

Ralf Lici
Mandelbit Srl

Changes since v2:
- Documented return value in datagram_poll() kernel-doc
- Replaced WARN_ON with WARN to print a custom message in ovpn_tcp_poll()

Changes since v1:
- Documented return value in datagram_poll_queue() kernel-doc
- Added missing CCs

---

Ralf Lici (3):
net: datagram: introduce datagram_poll_queue for custom receive queues
espintcp: use datagram_poll_queue for socket readiness
ovpn: use datagram_poll_queue for socket readiness in TCP

 drivers/net/ovpn/tcp.c | 26 +++++++++++++++++++++----
 include/linux/skbuff.h |  3 +++
 net/core/datagram.c    | 44 ++++++++++++++++++++++++++++++++----------
 net/xfrm/espintcp.c    |  6 +-----
 4 files changed, 60 insertions(+), 19 deletions(-)
Signature · 1 line
2.51.0