From patchwork Tue Nov 17 14:10:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5724 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:9292:b0:11a:f58a:e788 with SMTP id dc18csp2609515lab; Tue, 17 Nov 2026 06:11:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHoDwDuSREG5WIsVJtxIcB1Zki6B2pPCQXr7XvOlTXiJcj4Y53whqTqMSUQ0/Kh9CD/cHtvNfBGYXk=@openvpn.net X-Received: by 2002:a05:7301:718a:b0:382:4c1e:1c1a with SMTP id 5a478bee46e88-3824c1e200cmr138733eec.40.1794924683649; Tue, 17 Nov 2026 06:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794924683; cv=none; d=google.com; s=arc-20260327; b=p0h9FioQh4pYHfdVRUR6ly1+OhwbRCDeq2Dw81rroJMnxS96v0riQ8yljDQA8fmuiS 7rM3rPPuDxqEIf5kttDsPnVjCrl+q/4x87csHrKUnqnSTOuKkcABZQPQhXPR5VeKvXul sPJN+xyNXEl9HXr0VwftQkowk7q3S3FKXVL+73BMgzYNaXx1ynYY7G3TgVKCgK0xC8ZR TQmqJ5JIO+lWIZGzNUTJn2QBKPFEQ3VixV2Up+UFMU+CoLXY9gaIfF8PAgp6eTwpEpkx rzRrwBKB9hqZXhj5yUvz6qTPyDtSI/ahBBaQyFjKUSgqBBM/CJ2av/xT4PmvafN1kjN6 C1+g== 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=wSJZmJABj8U8vLX0EucNvy31970Hbk+bkxTAelMmOm4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=LIha7BuYDcUWWCG8SRmx4/1/kKRULKliQjA2P0yBYFD/d/z83cR6+nqypsXkm9YFhd mCmDvNYUUQRsP8FkZTWQTj6QCWd1soaUdb8CcM9YnXODCjicIOgGA/n3FhR+CBa4aFjm F1vW/RKO2wvXmnVHoTwyZq50o4zsVGEpG+ygSQouVj5rTdiOblH0pBfEA5JbBXVzzJnK dhLF8DPprueXSW4Z/EB0Np59mT8Mtm7PTgW+eh/p7CeVUJ12Z7o+1rYuEJHrDNF21tZ9 +UnvTcNVUVtxhqd/EGsNr2GA7tGHw1tOi9LlfBiXJ7T2/prggoZjnG3vqizenwEcbn9D 3Ueg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GV56P1yi; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fdRqNzFc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Jw6FUvUX; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=haS6E8DN; 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-379592d96f7si35984378eec.13.2026.11.17.06.11.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2026 06:11:23 -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=GV56P1yi; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fdRqNzFc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Jw6FUvUX; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=haS6E8DN; 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=wSJZmJABj8U8vLX0EucNvy31970Hbk+bkxTAelMmOm4=; b=GV56P1yi7KPDoq KzrCzIJCwebY0iIZs6jZwPLZgil3kIUWQRmt6u8OS721QC3ejr060aUST7JjSULPCGT3IJzezk5OZ jCwPoC5Et7HJbmWJEQm+s3v0YeuncyGTssAAagb71JbBZuvbCSFK5ZE5Xoffhxfx6O2Utj76lynFF MxI=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xTJu6-000000001sk-2wFQ; Tue, 17 Nov 2026 14:11:22 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xTJu3-000000001sS-1xP6 for openvpn-devel@lists.sourceforge.net; Tue, 17 Nov 2026 14:11:20 +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=LqhQKh7AjK1KVACPTGfTM15jWonWafxcm0cgxzgCmpU=; b=fdRqNzFcHIobt09Alf8QVzvLXP QpcWIyQ3pJvuPMorgG8Wq0jSzCchQlHdwTkUkbKZaG0Vy2m44wFEp0hTYbSCdKmkJaamLk2vehWxx rLy0nw+llU4YvDUymLN5AXvvMoSaJA42I+IHwcQ0bJ/Id+Fo1M9Of81F42Dc7CGvM2Xo=; 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=LqhQKh7AjK1KVACPTGfTM15jWonWafxcm0cgxzgCmpU=; b=Jw6FUvUXxhj/RCQN87FjkotMvc 8qyPacYiOo0eEc5J70NBrEERRsqbyV1O7D0aeqfKEIOOnMqq45L2N4y4xsdpCz2F6CBPzyWrHLWAH U4DXpxt3rNHfsidZAkoCVQZefCpLRp28o4kQaRpNWAr3vYxF6nd6vSFFyhnVRj5SP2HQ=; Received: from mout-b-105.mailbox.org ([195.10.208.50]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTJu2-000000007sw-00ea for openvpn-devel@lists.sourceforge.net; Tue, 17 Nov 2026 14:11:19 +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-105.mailbox.org (Postfix) with ESMTPS id 4jTRV61Vmcz9sP9 for ; Tue, 17 Nov 2026 15:11:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1794924670; 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=LqhQKh7AjK1KVACPTGfTM15jWonWafxcm0cgxzgCmpU=; b=haS6E8DNSQGmM8tstFsHaZMn9YgtuMd1UDyKKV0f2IZNnJsUVTMm1qWmgfhEg6e1qSMKdM eU16w5M31KHdKop4KOnwV+FqyIQAUAr8seNs8pxAtYgSCBz/Efqw7G7IbEG4nKSL+vMKXi htxOFz1sGWSgp6O0YyLt52Kv1hG55NyuTFk9mqBCXT/dNpvqonfUIu+DgwtEOk+DHmyDW9 m15pmnQA7syK7Lw6Zf6ozrg3XMpTW5VW2vTTduynYb6u8N0/wYxDgsXcmjOcGILWqlfK+t IWyN3o8RWrnHa0ExNVF2/UsnvTTzWkUXBqV/x8x45vUJlhYXlqeZK5KqAuWTGw== 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: openvpn-devel@lists.sourceforge.net Date: Tue, 17 Nov 2026 15:10:59 +0100 Message-ID: <7659be667398b1979db7b57d2a1e3ac240a35a81.1794922487.git.ralf@mandelbit.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4jTRV61Vmcz9sP9 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: ovpn retains the inner socket on encrypted UDP skbs so that write accounting and TCP Small Queues remain correct. netdev_pick_tx, however, interprets that socket as the transmitted flow and spreads on [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.10.208.50 listed in wl.mailspike.net] X-Headers-End: 1xTJu2-000000007sw-00ea Subject: [Openvpn-devel] [PATCH ovpn net-next 2/4] ovpn: select physical TX queues from the outer flow 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: 1882114944825547543 X-GMAIL-MSGID: 1882114945154088601 ovpn retains the inner socket on encrypted UDP skbs so that write accounting and TCP Small Queues remain correct. netdev_pick_tx, however, interprets that socket as the transmitted flow and spreads one outer OpenVPN channel across hardware queues according to the inner socket's cached queue, XPS and the producing CPU. Packets of one packet-ID sequence then race through different queues, and the resulting reordering can exceed the receiver's replay window. Clear the inner-flow hash and request hash-based queue selection in the UDP output path, so that the lower device hashes the completed outer tuple while skb->sk and its destructor keep describing the inner owner. Clear the policy again after decapsulation. With one peer between two directly connected mlx5 ports and four or eight inner TCP flows sent from different CPUs, the outer flow used five to nine TX queues and the receiver rejected 2000 to 4800 packets per 20-second run whose packet IDs had fallen behind the replay window. With this change, all of them used a single TX queue and no packet was rejected. Signed-off-by: Ralf Lici --- drivers/net/ovpn/io.c | 1 + drivers/net/ovpn/udp.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c index f14eb4e6c46a..e09a27969fce 100644 --- a/drivers/net/ovpn/io.c +++ b/drivers/net/ovpn/io.c @@ -76,6 +76,7 @@ static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb) /* skb hash for transport packet no longer valid after decapsulation */ skb_clear_hash(skb); + skb_clear_tx_queue_from_hash(skb); /* post-decrypt scrub -- prepare to inject encapsulated packet onto the * interface, based on __skb_tunnel_rx() in dst.h diff --git a/drivers/net/ovpn/udp.c b/drivers/net/ovpn/udp.c index 055cdb1bee13..892b33edaf8c 100644 --- a/drivers/net/ovpn/udp.c +++ b/drivers/net/ovpn/udp.c @@ -467,6 +467,11 @@ void ovpn_udp_send_skb(struct ovpn_peer *peer, struct sock *sk, skb->dev = peer->ovpn->dev; skb->mark = key.mark; + /* select the physical queue from the completed outer flow while + * skb->sk remains the inner socket for write accounting and TSQ + */ + skb_clear_hash(skb); + skb_set_tx_queue_from_hash(skb); /* no checksum performed at this layer */ skb->ip_summed = CHECKSUM_NONE;