From: Ralf Lici <ralf@mandelbit.com>
To: netdev@vger.kernel.org
Cc: Ralf Lici <ralf@mandelbit.com>,
Sabrina Dubroca <sd@queasysnail.net>,
Antonio Quartulli <antonio@openvpn.net>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net v2 0/3] fix poll behaviour for TCP-based tunnel protocols
Date: Mon, 20 Oct 2025 09:37:28 +0200 [thread overview]
Message-ID: <20251020073731.76589-1-ralf@mandelbit.com> (raw)
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. Patch 2 and 3 update
ovpn_tcp_poll() and espintcp_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 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 | 46 ++++++++++++++++++++++++++++++------------
net/xfrm/espintcp.c | 6 +-----
4 files changed, 59 insertions(+), 22 deletions(-)
--
2.51.0
next reply other threads:[~2025-10-20 7:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 7:37 Ralf Lici [this message]
2025-10-20 7:37 ` [PATCH net v2 1/3] net: datagram: introduce datagram_poll_queue for custom receive queues Ralf Lici
2025-10-20 10:17 ` Sabrina Dubroca
2025-10-20 12:22 ` Ralf Lici
2025-10-20 7:37 ` [PATCH net v2 2/3] espintcp: use datagram_poll_queue for socket readiness Ralf Lici
2025-10-20 7:37 ` [PATCH net v2 3/3] ovpn: use datagram_poll_queue for socket readiness in TCP Ralf Lici
2025-10-20 10:17 ` Sabrina Dubroca
2025-10-20 12:22 ` Ralf Lici
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251020073731.76589-1-ralf@mandelbit.com \
--to=ralf@mandelbit.com \
--cc=antonio@openvpn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).