[Openvpn-devel,net-next,1/5] net: tso: advance header state independently of the data cursor
| Message ID | eda873613a62eedfcab20c948e603ae6f2801a72.1794584066.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:18c:b0:11a:a05e:cb97 with SMTP id 12csp372167lag;
Fri, 13 Nov 2026 07:52:11 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AL+hErEMpxE1c/8ynOpMug1pcZ31PBP7pJE00GkA16IcebOwrA79DObsPUuWqJ+UjeuUd7Ei4O4dE7UXal0=@openvpn.net
X-Received: by 2002:a05:693c:414c:10b0:369:9062:c392 with SMTP id
5a478bee46e88-379680cf511mr2861137eec.37.1794585130680;
Fri, 13 Nov 2026 07:52:10 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1794585130; cv=none;
d=google.com; s=arc-20260327;
b=VyvxrhNnZ5loWke/EcHEtk1P0sx38KCWudtmf73MsV5pne3aQaVD56uzVbrpO7EmTv
Xlh8sem19pEtu2We1RVjB4CUOYUnKUH/OVknvhPu9pmk4ZbJPRe1tMoIiW6WLisbAalD
NirX4WjO2YE47lA6/v/hzpU76hNvy15sLtw+PG4VKdn2QWpFCRvawYx+q9NcEdjwxigz
F59pV9Hknl/rnO7HnD6LNWFxXkPwLz0RmzuXPQKL2R751VXADZ1Ut1yhz76gSzKIMhAN
RmjtXE2pQ+G4jUdIyN7Gx4vfFglBrHKEVPhmGb0kxSJqAjZym9p1LlUlrkIFQprK07Ch
6qPw==
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=JgZErJnpRdqIlrcUOLBSyAe0Tqhwpk7LcLRP0o117L8=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=oSxSN0b2aHey0aR0sSojRwPlKgQuwDc0k/HVZNF90hh5MEb0vZqAVIuP3kNxY03iCP
5BhF/sM80JpmG50FMCTUPG97VqRxzhxc6PHFTeQmxC5doqxKLy+J5SBihLuTlSGrF+ep
GqkSxADaRYR2oynO1vzW+dt6D67s6Cq6A9p/3IHPs8yhTMKdn+vOmDhsDa4x1EW6L9qq
+t4E7X4LmR+6cyW8mPjmRDKbWkzmBqnUnTAt4qHj1g0ECd4t9jozAVFC5G69kU3CjOUd
tlMUZ1d6wjPnwT+afmfkAyNh0otgbEAdhRcCW6CwZO+kJiBK6tU8mIsEQWlqlrYdMoq6
cZhA==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=MXc2G4Q7;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=abMnQwHM;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=b7EdUswT;
dkim=neutral (body hash did not verify) header.i=@mandelbit.com
header.s=MBO0001 header.b=ZeqjcpCE;
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
5a478bee46e88-3795a0973basi7935950eec.36.2026.11.13.07.52.10
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Fri, 13 Nov 2026 07:52:10 -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=MXc2G4Q7;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=abMnQwHM;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=b7EdUswT;
dkim=neutral (body hash did not verify) header.i=@mandelbit.com
header.s=MBO0001 header.b=ZeqjcpCE;
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=JgZErJnpRdqIlrcUOLBSyAe0Tqhwpk7LcLRP0o117L8=; b=MXc2G4Q7MG5o87
YMLkMkDZEzFi/nTJQ4TBgAEwlNTq5fJJTcbSP83VjzXhjClT4FqsshwrgufhCAVewflPsHyqEqArS
TrBNmHQXJNwSXe1nPHekl9jepaMoRoiHYTReYYHG53G0T6qxEaBx1IqGbvLh8rsLixh34MYYKM1kD
6kc=;
Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com)
by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.100.1)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xRtZP-000000001cn-2CdN;
Fri, 13 Nov 2026 15:52:07 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-1.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 1xRtZ3-000000001bt-1LEd
for openvpn-devel@lists.sourceforge.net;
Fri, 13 Nov 2026 15:51:45 +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=PnishJYZCdOosstd08Ph7cb7j/Qs7x0wTJFNKRd92y0=; b=abMnQwHMwHznijIAaf7dB19ssR
VTYtVi0vSpfaSWsY5volT98JUTpMhwvcMsTieHX9+5lFPe5PJCjBDWDXte2eqfvk0V1lZRnp/uCBa
5EOkXp2wFOA4vvMfEwxqcv5BR+9r8XnfI7ImaEnNtvk+WkoWCQ6GN6VQYnH48m2TLSNI=;
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=PnishJYZCdOosstd08Ph7cb7j/Qs7x0wTJFNKRd92y0=; b=b7EdUswT9UwMw9/ZaGW9LuvHzD
tILQr5Xzp4POAARexoLd01YoUyLFTM074qXw1SWrqBOQFhAidH5u/Y2LX2+dop0/KhTxdkFQmqbOQ
ndQVAy2Pyd7SDeuPJhKjmE9qqPR/wzWBk2wc+hnBOT3Bvjo0f2G2QUlE21j+VgsWrK4g=;
Received: from mout-b-107.mailbox.org ([195.10.208.47])
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1)
id 1xRtYp-0000000082e-0YDt for openvpn-devel@lists.sourceforge.net;
Fri, 13 Nov 2026 15:51:35 +0000
Received: from smtp202.mailbox.org (smtp202.mailbox.org
[IPv6:2001:67c:2050:b231:465::202])
(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-107.mailbox.org (Postfix) with ESMTPS id 4jR1vZ5Fh6z3xwJ
for <openvpn-devel@lists.sourceforge.net>;
Fri, 13 Nov 2026 16:51:22 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
s=MBO0001; t=1794585082;
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=PnishJYZCdOosstd08Ph7cb7j/Qs7x0wTJFNKRd92y0=;
b=ZeqjcpCEUaSHs8fOcVMzuZ6KCgJGmQb/0qvZ/dzo4/eobotu5ksaPF1AgaCCVhJQ2bBx2p
FWwUM3kWgdzqvzQbKyuXEMzUX17GeMulshjev9mpNhMUGecQd1ZfxhdydRs2XBDwO0E5TF
eLWzKTD/nRsfDuql7boz4OsQFlarMSXFdu+Gnc/50ot/4PtU4Bliodo/SfcKiasd1bkTTf
/zolt+HecoR7saOTDlvFSx++ouL7ff2w85L/UsvlMV2cp4EI5mBUAreAoi7sOS3oop7ku7
GJCKRcVovVRuPT8SUOtCvzn3NOFrQ8lxyViwWg0uKxogkt/mzhe01L6m7YK71A==
Authentication-Results: outgoing_mbo_mout; dkim=none;
spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates
2001:67c:2050:b231:465::202 as permitted sender)
smtp.mailfrom=ralf@mandelbit.com
From: Ralf Lici <ralf@mandelbit.com>
To: openvpn-devel@lists.sourceforge.net
Date: Fri, 13 Nov 2026 16:51:06 +0100
Message-ID:
<eda873613a62eedfcab20c948e603ae6f2801a72.1794584066.git.ralf@mandelbit.com>
X-Mailer: git-send-email 2.56.0
In-Reply-To: <cover.1794584066.git.ralf@mandelbit.com>
References: <cover.1794584066.git.ralf@mandelbit.com>
MIME-Version: 1.0
X-Rspamd-Queue-Id: 4jR1vZ5Fh6z3xwJ
X-Spam-Score: -0.2 (/)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-2.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: tso_build_data advances both the TCP sequence number used
by the next tso_build_hdr call and a cursor over the payload's virtual
addresses.
Callers which walk the payload in some other way, such as bn [...]
Content analysis details: (-0.2 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1xRtYp-0000000082e-0YDt
Subject: [Openvpn-devel] [PATCH ovpn net-next 1/5] net: tso: advance header
state independently of the data cursor
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: 1881758898125061543
X-GMAIL-MSGID: 1881758898125061543
|
| Series |
ovpn: encrypt GSO input in place without child skbs
|
|
Commit Message
Ralf Lici
Nov. 13, 2026, 3:51 p.m. UTC
tso_build_data advances both the TCP sequence number used by the next
tso_build_hdr call and a cursor over the payload's virtual addresses.
Callers which walk the payload in some other way, such as
bnxt_sw_udp_gso_xmit through tso_dma_map, can skip tso_build_data only
because UDP headers carry no sequence number, so a TCP user of the same
pattern has no way to advance the header state.
Add tso_advance_hdr for that and use it in tso_build_data.
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
---
include/net/tso.h | 15 +++++++++++++++
net/core/tso.c | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/net/tso.h b/include/net/tso.h index da82aabd1d48..0a8020274882 100644 --- a/include/net/tso.h +++ b/include/net/tso.h @@ -18,6 +18,21 @@ struct tso_t { u32 tcp_seq; }; +/** + * tso_advance_hdr - advance the header state past a segment's payload + * @tso: TSO state initialized by tso_start + * @size: payload length of the segment just built + * + * tso_build_data does this while also moving its cursor over the payload's + * virtual addresses. Callers which walk the payload in some other way, for + * example through tso_dma_map, use this to keep the TCP sequence number of + * the following headers correct. + */ +static inline void tso_advance_hdr(struct tso_t *tso, int size) +{ + tso->tcp_seq += size; /* not worth avoiding this operation for UDP */ +} + /* Calculate the worst case buffer count */ static inline int tso_count_descs(const struct sk_buff *skb) { diff --git a/net/core/tso.c b/net/core/tso.c index d2934bcfa795..c091bee795a7 100644 --- a/net/core/tso.c +++ b/net/core/tso.c @@ -47,7 +47,7 @@ EXPORT_SYMBOL(tso_build_hdr); void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size) { - tso->tcp_seq += size; /* not worth avoiding this operation for UDP */ + tso_advance_hdr(tso, size); tso->size -= size; tso->data += size;