From patchwork Wed Sep 16 06:52:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5348 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6446:b0:8a0:ea1f:253a with SMTP id n6csp5853236mag; Tue, 15 Sep 2026 23:53:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBzWDLEnVkAWOhWzsNWGGs0XJoPlcI7RcqGFM+8RPQrLzkiatJvOXl+BAvRJoxwqYzWLte0VM4rcKQI=@openvpn.net X-Received: by 2002:a05:6870:b013:b0:47b:cd37:f931 with SMTP id 586e51a60fabf-484771aacfdmr2336874fac.13.1789541597700; Tue, 15 Sep 2026 23:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789541597; cv=none; d=google.com; s=arc-20260327; b=f+ZTK5aSe7YCgPh7Ksn/NGzufs/rLM1+4eJPz838+C/SWQrIhrEkWLY3/uZCT63bOK g5+iMzox6Kzopna3gwUnsokSZl69QgEsnAdSZl4SiU0ZfmTlaqhlJM5eX/kcS4wmMbcP sOeTr1FftJR4kS47RfqLwz7whKP/tW50JD5BvLoNdKR4S025MQD0bmUQGWD1rG9Kr9uT yvnjFipdu5BPmOMuhJYBp1uxxyjmM6+5HsfLGuy456cTmTyTRHTD0oXPdsIz0feDUrJd OAtXq2NNfUBpckR5xza9rO58R5H7ZLIYEUTOjwsuhn9p65njxosjLG3sc53GiH+/1IDQ 8X6w== 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=b3dnzvtKs4Rh3Dy2ph/so0rk2itzZbhEer1AC5qZ7cw=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=N50Bl5p7gJG5u+hswkJjH0EE43W7csws6g8ITTSvnQ+A+6GuchBVi3kGjEX4S7ZIAT 9nPDqav7Mx4yXHF2ptJ51YMgZ92p/5aQ7YtyRKyXDX5GIVWk7X25K1B7HG8+rGoEn+oL IRYI2eVxrlhdXcHzNcHrXQUciS24HyZOR8OecQCvs6ado18Iw4iCnKAumbAQLY9SCORZ lo+FuS+VX1RGdNMVz3QCEJ3VoqXMODxqNXjAl6aRyi/+ZOS0gfg3NseE9L03SKK+ccNR 0ALwF2BSns6jQZ+wwGbdJZOXpizg3CRVZDGfuS/96StVi8Q2uOMIvK99ldFGUzwQtikc DaXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=VVoD7Qdm; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=b4bPXity; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CdVUguSc; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=0sCBNy4D; 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 586e51a60fabf-4842aac077dsi2234713fac.323.2026.09.15.23.53.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2026 23:53: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=VVoD7Qdm; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=b4bPXity; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CdVUguSc; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=0sCBNy4D; 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=b3dnzvtKs4Rh3Dy2ph/so0rk2itzZbhEer1AC5qZ7cw=; b=VVoD7QdmZ6rhGKNdf84rdwcEOa o7bhbO1g5WNVhteHIxulOzDYUe9rqwrNPaAzQASIM8YZrLa7jFSvvnfWutp9EBURGFZxhA67/bJUk w1L44/4ZQVAUozCxB3dftT7hYINuq/Z7e9v2m9qDMzG/u7Kc9sVoM5E9M1zzFVIL+Vcc=; 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 1x6jW7-00051S-3h; Wed, 16 Sep 2026 06:53:12 +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 1x6jW5-000519-Hj for openvpn-devel@lists.sourceforge.net; Wed, 16 Sep 2026 06:53:11 +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=lROSELap/mVvudmaNb+lHtUVa5vNhgpljj95LyEOrIk=; b=b4bPXityjPsvfuvwbpNZqeqera 4Nfk5wfDp+uOkwAk7zAhZhYqmIZ+D1U+G/Zyir2WqqBxIJ6U5q5eFlIYkQ5KyUMhYeVCEQ/gCme0n kW9fbjvFsFgpfooZr/VK13udu01I7aX5xLsiT9Un7+Pp8rsVd2NzKlA5ofnhAt8JbYDQ=; 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=lROSELap/mVvudmaNb+lHtUVa5vNhgpljj95LyEOrIk=; b=CdVUguSczsXGFkyGy4miH6JvIv EuISaZWjd60TFJe39sRsIq+Y+/eribj/dOhujgYPrlDWH86FymKB8B9h49yx5rnC/r1nNiMHImrJf /ASZ89cNADsE2toL3f7LA7hvDMtGQ3f1vGgD33rzSl+NEuAdOwq3O24cj4iVglUuYRP8=; Received: from mout-b-112.mailbox.org ([195.10.208.42]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1x6jW1-000675-BV for openvpn-devel@lists.sourceforge.net; Wed, 16 Sep 2026 06:53:10 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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 4hl8j95F2Nz5x0N for ; Wed, 16 Sep 2026 08:53:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1789541581; 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=lROSELap/mVvudmaNb+lHtUVa5vNhgpljj95LyEOrIk=; b=0sCBNy4DUlkPliCiZ7tTowTyS8XHqiwbvlqhdeWOov4SPWwQeMPpQjceZ5aoO7eNaPQopn BaWXwP1tbPu32jr1tyyXuY1VeIeeh7lSRku61fu1WFf2rrozIXEL3a8aprsD9PUUSOeKoN 74MBp+gTrLx7eQV73vL6eHLzmgcYdL5iZ2L9TSQJNFBoB/uHdTZNm0xq5i8vTVFUnf9C5t 1qatRmFkP1mE/el8vZ6GrRUm/O7IAKEJDuCIDQqdzIT6qThmgat1zv+4wlmgjGk73jV1x6 iRcwxsf8etCv4/1/y4ag1d1agaZRDi/yHuoxwvNhnN0Bvyd/UTXSqRixnQoHZQ== From: Ralf Lici To: openvpn-devel@lists.sourceforge.net Date: Wed, 16 Sep 2026 08:52:48 +0200 Message-ID: <3f903692549ee58887b1bb421f8b283059f66a1d.1789540779.git.ralf@mandelbit.com> In-Reply-To: References: MIME-Version: 1.0 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: 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-Headers-End: 1x6jW1-000675-BV Subject: [Openvpn-devel] [RFC ovpn net-next v2 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: 1876470370224944013 X-GMAIL-MSGID: 1876470370224944013 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 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);