From patchwork Tue Sep 15 15:23:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5338 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6446:b0:8a0:ea1f:253a with SMTP id n6csp5063801mag; Tue, 15 Sep 2026 08:24:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBz3fbJXXf8L/Y/qyvZlhsRC3jlkS4NhK4OZU5DMMNu2tS2ZecSQqc79HNxiHNAvrorZvwqTWS44x2g=@openvpn.net X-Received: by 2002:a05:6808:17aa:b0:4b9:a88b:8891 with SMTP id 5614622812f47-4c7b6175989mr6713180b6e.39.1789485862947; Tue, 15 Sep 2026 08:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789485862; cv=none; d=google.com; s=arc-20260327; b=GH+6DNA8ZwVh8/y2dhc57Kad536g7aPQjeENl1LzlBpaDkiKV8OiUR5IjDHGc4pax4 +n0uUmEKWQLZ2CGhs/FQ5hVMMIyjWmyrqWPcApYfN7cZi75q+HokJNL7vcu/ojCTx6o7 jDJhBHgqa+3PU/LU6dzqiIqAm25zDInG22jbxj1pn9b/E6TUJgWjUG3U9gh6gUUbnuQ4 KfQM1Vj/qlNGE1iZJsJNlV+kZT9ctMWJZwKrDf+iDCWe3GPE9OhWaISkHP4BGv2Pz1d9 EhBT9x3b5jLNDxucR6XmnAMSXCFX1cw8j1sWUEs6+pDiUAQlbJwUIueTzjmuns/+va8J FN5Q== 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=huMbEKmhqtxWOwaC28zEkqwUuiUBlRseYdcerYoOj6U=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=eYyZFdE+6PoEkpLh2IikPocQgmfauUhdcrWcEGE86qG9Ynqu1lM7mC6an/ZaLH3X3a d2WtH1tPqgGfBQAJGLiaaeNDpEcylVI7LFDdLco+ICZABP1mayKr5bv+pK0FV5ce5VtZ 36GtOJDjtpZc/Z6NnZDTXPYgk/3LtKCaQNOgcPX+EJPJSeVESktl0+4uspWVAIfRHxAl zuciKP/2f25N9Jo9KTgcPVwhCJLbA/ELGQddm+18Dm97A2qlRZ97tZBm7uKiEYlZw1MP v1ztFm3iXpO3SdOV2Ih1gzgrY0eZ+tngeitwp8iVfVZiAA3AHRvVFkS3wBWtQLXs22N/ DtRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="JtS/ZMfG"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Dx9c+qtq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PtqMxYbL; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=PJn69eNj; 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-4c9b72d9e99si738329b6e.125.2026.09.15.08.24.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2026 08:24:22 -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="JtS/ZMfG"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Dx9c+qtq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PtqMxYbL; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=PJn69eNj; 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=huMbEKmhqtxWOwaC28zEkqwUuiUBlRseYdcerYoOj6U=; b=JtS/ZMfG3Dnu856W6r7xztkwdw 4Oh92ZbHtWOTNIuzm0EN73ZMncHwwYw2vlMZJ8QHvO2X/HN/H5BjiQ8M9BU4/JcjJl4U1wPApuBtD BDxigU2rsYcEas96qtlHXJ4p978rNFR/FLA3aoibAFOyF4niMtdUOOK6jhkp3vr5J054=; 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 1x6V1B-0007I8-6j; Tue, 15 Sep 2026 15:24:18 +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 1x6V15-0007Hp-Se for openvpn-devel@lists.sourceforge.net; Tue, 15 Sep 2026 15:24:13 +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=Sp4yS6pMwtHpQ+TUjkzeCY+3UBvWernpFq7/9GyYFko=; b=Dx9c+qtqdk3BnuU0hYlYh1nsnm g098jhTaf1HUPwUjrdogE/nsalW3PEXhjJ5G7Qv+3eO11Ncj7xKB6oEM/8lRnw9V0py71tjR6oNc2 X03q1NWsmYSkGBYBv3IlZnzsFEo84FY+am3zgrgqkUABszowznkGX0avGvHeAJ49mS9s=; 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=Sp4yS6pMwtHpQ+TUjkzeCY+3UBvWernpFq7/9GyYFko=; b=PtqMxYbLgLbBeNstPEUbsboRpf 8v3xgPJfp7MZLWYwaOEKu22vmU5GWwx1ftVvHoi/eCC+/KDgB2dTNV3wCPI8U3JPAQUIPEg948/eU H1SS8bg5BE4OSDvHwT+qcOsxaxcfgLbTzdjB8mGx5ZTTjdUdAEJIklK0vLxA/uRlEyhQ=; Received: from mout-b-210.mailbox.org ([195.10.208.40]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1x6V12-000773-SN for openvpn-devel@lists.sourceforge.net; Tue, 15 Sep 2026 15:24:13 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-210.mailbox.org (Postfix) with ESMTPS id 4hkm5K3xYjzFqxF for ; Tue, 15 Sep 2026 17:24:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1789485845; 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=Sp4yS6pMwtHpQ+TUjkzeCY+3UBvWernpFq7/9GyYFko=; b=PJn69eNjbXtjlm8XWiz2Xx78DKUf3gOAxpPuBU87WbXpgnhV7D4rt+0NZaDpWdYnQFWLaH FSqa5EG9+yteKhqakENCbtnxKxsi8j3QCeuvfP/1wwoM4ms6gtIdw8XnbFiMtBsjQw+WyV NZht3SDDKJNrZ151kakHwmUV0I0dzC4uTSuXEQLGYHH8lWn/cVgD4pZbQ0LC8IIq49a0bU bDZRb5r2hsFgqCzw7ZzhRKaYb++lRys4BKlsRssdlvolRljDqyE77YB0RjEE7AREgyQSfC t9cfp0OUIVJR+BQcX7CwzfgEn8EfuZPi048w4FYPK3rvcru1k+kjw5QWVw/TCg== From: Ralf Lici To: openvpn-devel@lists.sourceforge.net Date: Tue, 15 Sep 2026 17:23:55 +0200 Message-ID: <382879c187b1acca65198c467d1263266243ea50.1789485693.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-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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-Headers-End: 1x6V12-000773-SN Subject: [Openvpn-devel] [RFC ovpn net-next 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: 1876411927811963335 X-GMAIL-MSGID: 1876411927811963335 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 --- 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);