From patchwork Wed Sep 16 08:35:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5364 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6446:b0:8a0:ea1f:253a with SMTP id n6csp5930459mag; Wed, 16 Sep 2026 01:36:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBw7E/le4J/7UyD/D4GM9LvVw+EDZRNIWV8hC4TGz4rnwpx9oxCNfln3b4LhdP6NwMsnW1+j5U/Va6w=@openvpn.net X-Received: by 2002:a05:6830:378c:b0:800:a53f:707c with SMTP id 46e09a7af769-80b2c181571mr1824780a34.2.1789547777160; Wed, 16 Sep 2026 01:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789547777; cv=none; d=google.com; s=arc-20260327; b=UQnhhMUxzG9beYOyCoePUGKV4xF8ttmC/720yO6Ppk1qTmHqGlu2jbLjDHdXL1XCpY HvjX98lUfT/dP3x5/qfdoil76n/Jdo/RdRp78jvSErSw2Slb/TmrLMM8gMYBTCd7gMW+ POxvipkLua6thLNXrKqr6oC5/eYg1O5qdEWMCfofjbVcZf8uAKajghLDAyHqvve7hRHF gS4smxRcWY0NxDTQnaRyP3zJ1Tkl37Yh0Ks2A1sn8bNNgnwQfrXI4muCGkIlNVhNOaro fyuxzwAU6atZ+cV8J6q6DZTzR6/mGplIihxXb3i/haNTyHyhZPUbztKQxpBXvze62sXF 4hjw== 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=3nCZERF5M1HPfsFEXkxlIFnd16ySsbeCXUPBPQRggMg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=hIagOseDaRwMoZEAeIkzaWV1r5o/k8pnKP2IyDH63QVl9pWAzeNIJRVg5iOaOKKNUp ZKKdWOfVQT94k7JIJZ01QbsYmIdEMtYNcM+YGBYVgkw3MJdcIC+jXfMCpG7CYT/xITqQ JnfnQ+UZqAcvGOGHTBUfGC5dYbk3CEazmK8SVCB8sv3Hn2ujQctcaNnsgZzzoo5/5pJ4 ZFhbV/JEavQwxrcLibC7+xPCCYeCIlIJSliv2+A6507abnNZR1M7hYIQc2ERFdaKwMAu W1u6PAlWyflzWnzdj9iTUX9CQH9XHlm0QdVZobHP7rQTwsRCIojQA89i6rgbKSxOF/TZ 8fLg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=i1dLJOXV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="CGN/R75a"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UjgSlJe7; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=dtdHOaqU; 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 46e09a7af769-80b0860c624si2762876a34.94.2026.09.16.01.36.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2026 01:36:17 -0700 (PDT) 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=i1dLJOXV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="CGN/R75a"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UjgSlJe7; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=dtdHOaqU; 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-Owner; bh=3nCZERF5M1HPfsFEXkxlIFnd16ySsbeCXUPBPQRggMg=; b=i1dLJOXVlK4ErS17Xb1Sp+L6V8 +iABHE5utCtv5DzHqTWi9ETPvJahF1STo7JEGqv2oSJxK8iiHuEs5ez1AMdKN+vK1tDSyDQg5dsYf UbjRd4NCAqCRgnAH4LOKElAXiEJ7Wb6fPqCYcD9zCLgoX4NKoc7rm5jzEi0FDmCueEYI=; 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.95) (envelope-from ) id 1x6l7o-0004l8-3x; Wed, 16 Sep 2026 08:36:13 +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.95) (envelope-from ) id 1x6l7L-0004cF-Bn for openvpn-devel@lists.sourceforge.net; Wed, 16 Sep 2026 08:35:44 +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-Subscribe:List-Post:List-Owner:List-Archive; bh=/HBAEcX+VIZvYPe/5m0G2nDlCHVefic+vzCRj3Yb0Ik=; b=CGN/R75aNujCf/e5YCdQM6lrRL 8ZfgLfCefusyTpQDX5DwQo+Epnjbz3D1qo8Yua3yFsz6UOGUx0rpM7SqhrjcosdaCU/JIqfYw/opd 9DjEe90cpEWJqIdorXBZ4gZsU+ZUsGS+VnVcd67NGNOPMzQvJEHUi5CKg0sJy3sVZ44M=; 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-Subscribe: List-Post:List-Owner:List-Archive; bh=/HBAEcX+VIZvYPe/5m0G2nDlCHVefic+vzCRj3Yb0Ik=; b=UjgSlJe7PFYMp25YvKqvY29fjh R9uRHoG6HOzNPCA09usU1TKyfgSr0zkiuEcie5JEqa98x5yzXxzOI1NrvbW7sB8HUXzKCZIXxwY6b biZcOtDYzA0jRlyFBawJckDPfJoIX3Z+vKC9nQSwEEJAzUCDzR2fuqfMSJzu3JBq1Q0o=; Received: from mout-b-112.mailbox.org ([195.10.208.42]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1x6l7F-00053K-Tq for openvpn-devel@lists.sourceforge.net; Wed, 16 Sep 2026 08:35:44 +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 x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-112.mailbox.org (Postfix) with ESMTPS id 4hlBzT57SNz5x0c for ; Wed, 16 Sep 2026 10:35:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1789547733; 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=/HBAEcX+VIZvYPe/5m0G2nDlCHVefic+vzCRj3Yb0Ik=; b=dtdHOaqUKCaalgRI0DRjK7Kxya+CoWvNNVfnEVAwAHeGPnBZjwEaFGbMFKRxRUFhN/60fu 47WPAsNnmzVqH3BvX5iaegVG7DUB5XEoDBWoWAvwPVznYOU2L+GAL3oXjBKMncfNEtFWz/ sAKuSCdKKjaXIfMAwFbDPgfOwsgEw4dS/fCVomcNOdSVFEHmXzbm/YLAVPa2b75eRu0oBz lPkWXXNC2cLc1iGQIrNTkMXPC1vCR+ffCk0tVbLokeUvGGxYo6ij38ConJSQefxrxP9gxL hvVEJCYUmhS+ebMm7zOH+XktVYElMXSKVAgD9LCrHF+xWt6VvYMOYXmMxNVl1Q== 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 To: openvpn-devel@lists.sourceforge.net Date: Wed, 16 Sep 2026 10:35:16 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4hlBzT57SNz5x0c 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: Software segmentation exposes the complete skb list before encryption begins. While encrypting each segment, request write ownership of the next linear segment cache line by cache line. A single skb n [...] 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_VALID Message has at least one valid DKIM or DK signature -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 X-Headers-End: 1x6l7F-00053K-Tq Subject: [Openvpn-devel] [RFC ovpn net-next v3 7/9] ovpn: prefetch GSO segments before in-place encryption X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1876476850095499086 X-GMAIL-MSGID: 1876476850095499086 Software segmentation exposes the complete skb list before encryption begins. While encrypting each segment, request write ownership of the next linear segment cache line by cache line. A single skb naturally skips the prefetch path. Signed-off-by: Ralf Lici --- No changes since v2 https://lore.kernel.org/openvpn-devel/3f903692549ee58887b1bb421f8b283059f66a1d.1789540779.git.ralf@mandelbit.com/ No changes since v1 https://lore.kernel.org/openvpn-devel/382879c187b1acca65198c467d1263266243ea50.1789485693.git.ralf@mandelbit.com/ drivers/net/ovpn/io.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c index 11f7f16d7b79..cb7503a3e79c 100644 --- a/drivers/net/ovpn/io.c +++ b/drivers/net/ovpn/io.c @@ -472,6 +472,12 @@ static void ovpn_send(struct ovpn_priv *ovpn, struct sk_buff *skb, * independently */ skb_list_walk_safe(skb, curr, next) { + /* encrypting this segment can hide the cost of fetching the + * next segment's data into the cache + */ + if (next) + ovpn_skb_prefetchw(next); + if (unlikely(!ovpn_encrypt_one(peer, curr))) { ovpn_dev_dstats_tx_dropped(ovpn->dev, 1); kfree_skb(curr);