Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3CD2606A323 for ; Wed, 25 Nov 2026 15:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.a=rsa-sha256 header.s=beta header.b=Gx06YsTr; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.a=rsa-sha256 header.s=x header.b=S3wdCoSt; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.a=rsa-sha256 header.s=x header.b=ld1IgUns; dkim=neutral header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=cTmEh4/Q 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:Cc: 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:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post:List-Owner; bh=BWte3XMqEJXhrG4GHx7HZeKQY6UrGGrzx2V9/v8l8SM=; b=Gx06YsTrR7iV3fV5yefIourPgN Vz45qQCNJMGUPGxjTdT+ZEPhK3knJ+mjUMoVlAKtntoKp6+EqXh+VPKR9B1GXZuntzY3k2y+/TC9g +WM6B28XVnbgBMK9S3BpKTqF5df/F15BSK5M1VOEujVCxgxEF0JmSx9hM+aC+eMfYav8=; 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 ) id 1xWEej-000000007AZ-3OZs; Wed, 25 Nov 2026 15:11:33 +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 ) id 1xWEeh-000000007AE-0Fnv for openvpn-devel@lists.sourceforge.net; Wed, 25 Nov 2026 15:11:31 +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:Cc:To:From:Sender:Reply-To: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=GE8pwHrVhZXC0RBOzlWuxu54+4qoBBXgi0JfT9KfXOY=; b=S3wdCoStL0/SCnquB46M9Yx1CS lUiRX1laf/isIwkz0kEABrwZs6GkSsmv4vTtZsF7Ic8ZFzZOuDZGISN29RmDE+bkI5JllNXuW23qc jhUhP1Mi8HVag23Z0VGi/WaalVE/3Cj8TCWW1qc92vF1dxoYtEZpOnmR9RJv7c5lBKPo=; 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:Cc:To:From:Sender:Reply-To: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=GE8pwHrVhZXC0RBOzlWuxu54+4qoBBXgi0JfT9KfXOY=; b=ld1IgUnsr/qmepeFuuYMkYQz3n KViAoCynww0fztsgMSVuIYHHnlF1YZvRDUTCcCzN1q4aBX2LCg/FYlL2ztrn0nPOX14uA7IfxQrba H4OQhHhVB3Mhf7x3SyUcd7KBwaURNjI0Iv1QNn6NN9RytnWYH1Pc1Lx8HmaHzKLb5fXs=; Received: from mout-b-107.mailbox.org ([195.10.208.47]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xWEee-000000005Md-3Mlb for openvpn-devel@lists.sourceforge.net; Wed, 25 Nov 2026 15:11:30 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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 4jZNRr6JSQz3xgf; Wed, 25 Nov 2026 16:11:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1795619480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GE8pwHrVhZXC0RBOzlWuxu54+4qoBBXgi0JfT9KfXOY=; b=cTmEh4/QacVtXoMdr2iD82sqc8EMnlelURJzI2bc3L4BcK5rptlz7eYHwQ59JOTtqN3FK+ ZmI95E5zATfb8rja+vK/dwgFBALl3oYkoDMeOBE9B0qvNFDKrkqrevlBDFOIZ2klKB5cID vP6MIn6xrjNgM027MmKCm1BxDkRNA2cU/+EBLBPlWstD39qsPwxvHa8kIwiTEyPqTy/56h 7nb9f1pbUbXFi7tBFUGBSO7i6m62rggIL5izdkgqZ5Arv5Gh0JYruC5rw6Q8e64/97buEq Yb4FWjzn0zJrb4+r9Wz/HyDzOlGk/NvJtm6BHNvJqMCOnVAYr8PiyA1nP0kQVg== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com From: Ralf Lici To: Antonio Quartulli Date: Wed, 25 Nov 2026 16:11:13 +0100 Message-ID: <20261125151115.56230-1-ralf@mandelbit.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261125135821.1808454-1-a@unstable.cc> References: <874ca8e9efb787fd37a942817239c8ba1a4fa4b3.1794388607.git.ralf@mandelbit.com> <20261125015243.238861-1-a@unstable.cc> <20261125135821.1808454-1-a@unstable.cc> X-Archived-By: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4jZNRr6JSQz3xgf X-Spam-Score: -0.2 (/) X-Headers-End: 1xWEee-000000005Md-3Mlb Subject: Re: [Openvpn-devel] [PATCH ovpn net-next v3 6/6] ovpn: prefetch encrypted records before GRO batch decryption X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openvpn-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Antonio, I think the idea is a valid optimization but, as you reported, currently it doesn't translate to a measurable improvement on top of GRO v3. As long as decryption dominates the per-record cost, prefetching two records ahead while the current one is decrypted already hides most of the memory latency. There's also a scenario where this change can make things worse: if RPS is enabled on the ethernet interface, the GRO NAPI issues the prefetch on the wrong CPU (that is, not the one responsible for decryption). When the skb then arrives in ovpn, there's no longer any prefetching happening and the crypto stalls on data owned by the GRO CPU. On your perf-next, steering to a CPU on the other CCD already costs the window a lot (38.1 -> 24.2 Gbit/s), and join loses another 31% on top of that (16.7 Gbit/s). On Wed, 25 Nov 2026 14:58:21 +0100, Antonio Quartulli wrote: > On 25/11/2026 02:52, Antonio Quartulli wrote: > > On our perf branch (your v3 plus some RX changes of ours), single stream > > over UDP transport, ConnectX-5 back to back, mlx5 with RX look-ahead > > prefetch, NIC MTU 1500, 3 rounds, Gbit/s: > [...] > > A follow-up, now measured on your series alone: your GSO v5 + GRO v3, > same setup (on a 7.4-rc4 based kernel), AES-GCM, 3 rounds, Gbit/s: > > window join > TCP 30.57 31.04 +1.5% > UDP GSO 32.26 32.18 -0.2% > I started with the posted series (GSO v5 + GRO v3) on my usual setup (9950X with a CX5 hairpin, one pinned TCP flow): Gbit/s RX CPU cycles/B window join join vs window stock mlx5 24.96 25.07 +1.1% + mlx5 prefetch v2 27.45 27.50 -1.2% + TSO series 29.97 30.13 +0.1% Then I also ran your perf-next branch as of today (4a8182fa1798): Gbit/s RX CPU cycles/B window join join vs window TCP 38.14 38.39 -1.7% inner UDP GSO 24.49 24.52 -0.2% So the receive cost does drop a bit with TCP once the path is cheaper, but I can't reproduce the throughput gain yet. A window distance of 4 instead of 2 gets about half of the TCP saving (-0.9%). I also wonder how your UDP GSO runs reach 45-48 Gbit/s: here the sender offers about that much, but the receiver can't keep up, the NIC drops about half, and ~24.5 Gbit/s arrives. Is yours the received rate? What's the secret recipe? As expected, with RPS on the physical port, steering to a CPU on the other CCD already costs the window a lot (38.1 -> 24.2 Gbit/s), and join loses another 31% on top of that (16.7 Gbit/s), with the decrypting CPU reading the ciphertext from DRAM. > Given that, I think it fits better as a follow-up than folded into > patch 6: no need to respin v3 for it. > Agreed. Cheers! -- Ralf Lici Mandelbit Srl _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel