[Openvpn-devel,net-next,v5,5/9] udp: preserve write ownership across GSO segmentation
| Message ID | 84055d076e4df97aa0658920a14359d8543c7a84.1794244231.git.ralf@mandelbit.com |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:6022:63cb:10b0:11a:a05e:cb97 with SMTP id
w11-n1csp981166lat;
Mon, 9 Nov 2026 09:16:53 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AL+hErHBuoof2UoYnkR0fNH4wKaOTguv1pHZHnJUgxDlF3DLmqz5GYJvcvuzji2Yt+iwH5ybf2NzvjFFRHo=@openvpn.net
X-Received: by 2002:a05:6808:124d:b0:4d7:17d5:6c9b with SMTP id
5614622812f47-5683c73be25mr260412b6e.9.1794244613101;
Mon, 09 Nov 2026 09:16:53 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1794244613; cv=none;
d=google.com; s=arc-20260327;
b=Ck6pLPaptjtyfG1uLjgbeoa4/ZfQbpKzH8Rcpaz6CHF2jajje3XKHLPXWChT67JxIk
nnXs5UEKT1jSXCxBj2Kn/jP8Pi595IvEJWhAWaO9u5Zszd80xe5R/HReUKZYrV4djtcW
elMPKIdPr9woxpzCNnyDXZ2QHAzDP0maNLuovLx0bwTSSvMQnkjy04meMkjGCr16Bg80
awX4eYgnU6IkoLkdTgaykOBLtpE4sOuC/QE9834/uEHYvUaOGNigep35vS5CK+4yPPZM
+pLR90WvXHSoYb1P1ZWWjVsUfTeRyf/giONxwIOXJbWSdqI+pKqYZlv9mFcDwHsn4dR1
M9iw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature:dkim-signature;
bh=UcYANbV+gT4UYVEtqkacmwIfQaxQQ3xDB3kRPM6K7Lc=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=WGLBplpbrNtEbFGYTMipqjJjYAmZgUSC8Hp+3RYVhJYo7WK0Kpov2032dXnWXz/C3F
vo2NZaz5W8MGkRDivvkgnyZLS28wOWVPPJFsmgSN5VlPVlVkzgQLWTR4ybczXLdHkHJP
gwntJq0i8IInqv75+AhhOi2Gmi8nSxBHXIdzVsUqCaGQX1WRbnklyAnFXKNR8tjStDPm
bbG8RyK/LJJBpDoU+AaZ4o7u8bvdPXQObAOevfWKUXe0FZmTV1dPcTg7fzRgSBNwp4cH
/wMQZFJITmZtCDEwXXQ/gx6R8g/hsoIeufSkipzLKHkZOkLw+kXqJ3vwAoiS5lXfKvD8
EG+A==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=Prkw8AOK;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=VrNyaWVt;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=BsWPq9FJ;
dkim=neutral (body hash did not verify) header.i=@mandelbit.com
header.s=MBO0001 header.b=sbREPBDt;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
5614622812f47-56813b5616bsi5176828b6e.66.2026.11.09.09.16.52
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 09 Nov 2026 09:16:53 -0800 (PST)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=Prkw8AOK;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=VrNyaWVt;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=BsWPq9FJ;
dkim=neutral (body hash did not verify) header.i=@mandelbit.com
header.s=MBO0001 header.b=sbREPBDt;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post:
List-Owner; bh=UcYANbV+gT4UYVEtqkacmwIfQaxQQ3xDB3kRPM6K7Lc=; b=Prkw8AOKNR3PZz
6qW8DIzbSwyEL1mgLtSC4amSsMPAAilyjcxV9CPBUE6zo0DQ/NsnJgZpCH946Wq7BQO2zx07AqTd1
Vostuk0sFRXy1GbHse7pRxc+sw1ijWHESg7+zFl1BAeKFUpQBGEPcLNmaYUJCIqKHz1H0uHMku/7z
3Vg=;
Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com)
by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xQSzC-0000000071f-0gVh;
Mon, 09 Nov 2026 17:16:50 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1)
(envelope-from <ralf@mandelbit.com>) id 1xQSz9-0000000071Q-2KIb
for openvpn-devel@lists.sourceforge.net;
Mon, 09 Nov 2026 17:16:48 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive;
bh=+zLtSnmWsvLRpgfDMIGDTINlrWeCJaBlFoakE+L4Xp8=; b=VrNyaWVt/IjYU965IzV3SEIMna
L0x8aTNeyNhMf3LxWqWugf0YBENcI0w/LVkwXuAIgWzZqmboFdt/HtxL4R5LHnZTVwCgrPMy9GSbE
Q0pFXMZNPWn8ZWhYvcBEVuElM+8AcNI31eupAuI9g1fxDrt/Peeq4Rthrt+U5qYz0qFQ=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=+zLtSnmWsvLRpgfDMIGDTINlrWeCJaBlFoakE+L4Xp8=; b=BsWPq9FJs7c9D2pt8awTkDWfmo
oxNvEZvIlsjdpap+hzMvtE6J/04GhgzG+sWkl/B+cRigWk1Hy7oKP3tkhtDFneSc+H4LxSFYwLqjL
kIENAX8qgcdXH4Dfktdh0sx59Xt2IW40uQjlGJGG+L5gXT770QA1PusfCx08hcv82ZXM=;
Received: from mout-b-201.mailbox.org ([195.10.208.61])
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1)
id 1xQSz8-000000004gd-0KXi for openvpn-devel@lists.sourceforge.net;
Mon, 09 Nov 2026 17:16:47 +0000
Received: from smtp2.mailbox.org (smtp2.mailbox.org
[IPv6:2001:67c:2050:b231:465::2])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits)
server-digest
SHA256) (No client certificate requested)
by mout-b-201.mailbox.org (Postfix) with ESMTPS id 4jNbzp1VtBzLlb5
for <openvpn-devel@lists.sourceforge.net>;
Mon, 09 Nov 2026 18:16:38 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
s=MBO0001; t=1794244598;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=+zLtSnmWsvLRpgfDMIGDTINlrWeCJaBlFoakE+L4Xp8=;
b=sbREPBDtt2nw8Z0XUpkWCdx0PI1EWxquenmj6vNYRdBQ0J0d/5Vra/RPrT3Z8y2OnmMutm
jHVxf0RroihSChLr7jndm2b5ZdqVTgbsKpHBOWP324MiXb9AObaIg3FNzCt0E9QyqAva6e
ABw2Vy2MYBOw8wQV5iERWhr7umx0uMzuKJg7hZTXSRW6VP9VKOL+k9hMG2aPJSDnz+OMGi
mMBCTAbbiAXHoCxVxzYc3YSdLOJ6KbIHJXZaEbpuE4+WlAkOtfQlVqDIdOiiGxNp7KwFox
lpljDeent9iNda2LuxJ/0ojj8dWV1bwfe3Hh9k49nQA2RoxvwX0xu9pFbGSLCw==
Authentication-Results: outgoing_mbo_mout; dkim=none;
spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates
2001:67c:2050:b231:465::2 as permitted sender)
smtp.mailfrom=ralf@mandelbit.com
From: Ralf Lici <ralf@mandelbit.com>
To: openvpn-devel@lists.sourceforge.net
Date: Mon, 9 Nov 2026 18:16:21 +0100
Message-ID:
<84055d076e4df97aa0658920a14359d8543c7a84.1794244231.git.ralf@mandelbit.com>
X-Mailer: git-send-email 2.56.0
In-Reply-To: <cover.1794244231.git.ralf@mandelbit.com>
References: <cover.1794244231.git.ralf@mandelbit.com>
MIME-Version: 1.0
X-Rspamd-Queue-Id: 4jNbzp1VtBzLlb5
X-Spam-Score: -0.2 (/)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: UDP GSO segmentation currently propagates socket write
ownership
only when the aggregate uses sock_wfree. An encapsulator such as ovpn can
instead retain ownership from the payload socket, including t [...]
Content analysis details: (-0.2 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1xQSz8-000000004gd-0KXi
Subject: [Openvpn-devel] [PATCH ovpn net-next v5 5/9] udp: preserve write
ownership across GSO segmentation
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1881401839419248081
X-GMAIL-MSGID: 1881401839419248081
|
| Series |
ovpn: preserve GSO batching
|
|
Commit Message
Ralf Lici
Nov. 9, 2026, 5:16 p.m. UTC
UDP GSO segmentation currently propagates socket write ownership only
when the aggregate uses sock_wfree. An encapsulator such as ovpn can
instead retain ownership from the payload socket, including tcp_wfree,
while repackaging its data as UDP GSO.
In that case the destructor remains on the aggregate and runs when
software segmentation consumes it, before the resulting UDP packets
complete transmission. This releases the write-memory charge early and
can wake TCP Small Queues prematurely.
Use is_skb_wmem to recognize the standard write-accounting destructors
and propagate the original destructor to every segment. These
destructors all release ownership using skb->sk and skb->truesize, so
the existing truesize adjustment remains applicable. Skbs owned through
sock_wfree are handled as before.
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
---
No changes since v4 https://lore.kernel.org/openvpn-devel/84055d076e4df97aa0658920a14359d8543c7a84.1794234673.git.ralf@mandelbit.com/
New in v4.
net/ipv4/udp_offload.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index cf07c3c6611a..d41529030fbb 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -481,6 +481,7 @@ static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb, struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, netdev_features_t features, bool is_ipv6) { + void (*destructor)(struct sk_buff *skb) = gso_skb->destructor; struct sock *sk = gso_skb->sk; unsigned int sum_truesize = 0; struct sk_buff *segs, *seg; @@ -542,7 +543,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, skb_pull(gso_skb, sizeof(*uh)); /* clear destructor to avoid skb_segment assigning it to tail */ - copy_dtor = gso_skb->destructor == sock_wfree; + copy_dtor = is_skb_wmem(gso_skb); if (copy_dtor) { gso_skb->destructor = NULL; gso_skb->sk = NULL; @@ -551,7 +552,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, segs = skb_segment(gso_skb, features); if (IS_ERR_OR_NULL(segs)) { if (copy_dtor) { - gso_skb->destructor = sock_wfree; + gso_skb->destructor = destructor; gso_skb->sk = sk; } return segs; @@ -571,7 +572,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, for (;;) { if (copy_dtor) { - seg->destructor = sock_wfree; + seg->destructor = destructor; seg->sk = sk; sum_truesize += seg->truesize; }