From patchwork Tue Nov 17 14:10:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5725 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:9292:b0:11a:f58a:e788 with SMTP id dc18csp2609512lab; Tue, 17 Nov 2026 06:11:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErE8i9jMXSf/wkuBXn3S5LKCocG1hBK7du/XtO12uV3pqhngqkqvvfMBCcr9SN2battNnNfNUCVcUL4=@openvpn.net X-Received: by 2002:a05:7022:2581:b0:1b3:b8a2:825d with SMTP id a92af1059eb24-1b50306c59bmr17857910c88.3.1794924683435; 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=p3nMi471RK/MfgJ3xnKRhWTGaCZ822+bi/1ZmQ0j/GY2mu/GCMppA+XG/0XZEkSxAV 0X/EHxdMAmYuh+GCtXsRbzMllzt2CftAIbYOVJD/1Pgd0z2H7kMdZ+ogFc0qZGffzu+Y xFa3XGh8OfSs6BJJ6Afv2HkCWznogGPgljryn5E+APoiwbYCk4UodokRUmD4y298x17y 7q5R9YtegKKvTU+EeFfEL/xbjjuPvcYvqoiCVkIl+b1+iTn8bmAp1P+Suu461zy5xZZm Mdk0q3ynFDXQdXSoxAeP0o1ofwdDuCFAdFbhSiekXlN0uelpi9dodN2XfNqwhGe3WiZj NKCg== 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=SM3zZ/HcNeHhOq9l7RWe6EfLUbDRRiLGHO4wm2H7BwQ=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ok54sLhnkQwUsoXEtRFklluyVxmJHhwJt1aDwhIn6MplnjwpdThyfFAk/Al7euFbAZ 9whfeOIWOE7eFBLRmZ+F/+orE5+Uu0pAd/Rps2VD3Ch4jKeXDEeXthOm7ZrHoUnteGyV 8vue+FimBKXXpGn4emtoGVvt+CYkhsKyJwJ9BgjzwfnfunPg8PbOX4kKDXfYITNJIDyF 51h1Dpc02TGPnqZpw4+Vl8qq2iI9Dz8Gn3sMnlKrEdg04ib0t3NBCrOFz3MwXDckqK8y gsO+sxkX5JAmXIvFsLOZNRkEtYHX9iJGrn16Q48/XdURzGi25ILHFQ2ZZXSzIaMpOqwx jdRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=YiTsBZEP; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=AkT1UMST; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PjvEgo7B; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=mq+gZ9c3; 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 a92af1059eb24-1b5031dc867si35797181c88.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=YiTsBZEP; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=AkT1UMST; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PjvEgo7B; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=mq+gZ9c3; 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=SM3zZ/HcNeHhOq9l7RWe6EfLUbDRRiLGHO4wm2H7BwQ=; b=YiTsBZEPuw/OyT lVtnAcXZ292EYV9UNiml+9nYW9d/GdfJXe0Fwk9WQTeM+nkZDXRjdwgyKkamtHpA+1YmON1YtUdUR Qm60UdGLfu0r18CqiCDAMYflaRRtoRu5IsNrSbqLd0MXyBvcMAwogpSIJ3o7yZLSMis65Q/feQfwO HCU=; 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 1xTJu6-0000000021I-18WH; Tue, 17 Nov 2026 14:11:22 +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 1xTJu4-00000000212-3JDn 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=9OBo0xgyqYJrCBn0r8bdho/zHv3WCWK75dct43w9B6Y=; b=AkT1UMSTg68f/Pb78f05r5pr1O CARD8cPMzjI+VGvoi6Qoy07UwhTsn5U1rb755ZjZRzQkfw4dXpxuo0MsaeOys3Xft3avJ9kr3Yj57 0LZyMfsJtWWrdqr8txGKYkpwyJAH3NjMVv1wqCWm/kJAewuNT0unpBm6mHO0khclaxiI=; 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=9OBo0xgyqYJrCBn0r8bdho/zHv3WCWK75dct43w9B6Y=; b=PjvEgo7BsEYN4T2sI6Nlbrbcl+ +qhCAFm6xzKScEw9UIC4FWe8x5a8BkGx+rCzeGRprSMw+NZwoh8PKt4VllTbxNn3Z3Z+DLDB54Fzl yUhrx4JypTOvoLxdZiAsl9g8VRgDECQ6cvaTaFoyitRaK+2uLox34f54x9jj0ftVbMsg=; Received: from mout-b-203.mailbox.org ([195.10.208.52]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTJu1-000000003Ny-3i2E for openvpn-devel@lists.sourceforge.net; Tue, 17 Nov 2026 14:11:20 +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 SHA512) (No client certificate requested) by mout-b-203.mailbox.org (Postfix) with ESMTPS id 4jTRV55hPXzLm0V for ; Tue, 17 Nov 2026 15:11:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1794924669; 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=9OBo0xgyqYJrCBn0r8bdho/zHv3WCWK75dct43w9B6Y=; b=mq+gZ9c35TWPPvPyHgJqRnuHQYLNjjDviVaNe2M+RtBPWILh484rNV4HZEQ/daMQ6CdJp4 nU1BHIt65AmAZBN9xIThB7yTvi+njqIGWAS/8FRVQ258ukb0avqoEDaQbFxcrJkFMWr6m4 e05BYjQGH+ygDprbG3RDCt88J1Ykrz/7hBGlihzdG4VE5Kzd0nfR2o7+dMK2NDHK1HwGVH kJMGzFNybSwfHZVWucv4M9dMOuMH7wQNHYu7+ezyUR6gmEiehU61UhvaF8ckkfs/TBMV3R 7P3BNgOmruL3Sf2aqzLSrUyQ/HlsjHh9nKFSZspdLTX7zq8IUml9D4i7s+adVQ== 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:58 +0100 Message-ID: X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4jTRV55hPXzLm0V 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: An skb may retain a socket for write accounting even when encapsulation has changed the flow represented by the packet. In that case the socket's cached TX queue and XPS placement describe the inner f [...] 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 X-Headers-End: 1xTJu1-000000003Ny-3i2E Subject: [Openvpn-devel] [PATCH ovpn net-next 1/4] net: allow selecting TX queues from the packet hash 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: 1882114944905304400 X-GMAIL-MSGID: 1882114944905304400 An skb may retain a socket for write accounting even when encapsulation has changed the flow represented by the packet. In that case the socket's cached TX queue and XPS placement describe the inner flow rather than the completed outer packet. This matters when one outer flow multiplexes several inner flows and must stay in order, for example because a replay window protects its sequence. Add an skb policy bit which makes netdev_pick_tx select within the packet's traffic-class queue range using skb_get_hash. The policy bypasses the owning socket's cached queue, XPS and a recorded RX queue, and is copied with the skb so that it remains effective through stacked devices. The bit takes previously unused space next to tc_depth, so sk_buff does not grow. Signed-off-by: Ralf Lici --- include/linux/skbuff.h | 18 ++++++++++++++++++ net/core/dev.c | 8 ++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1d6832878930..aaa33d44b01c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -833,6 +833,8 @@ enum skb_tstamp_type { * @_nfct: Associated connection, if any (with nfctinfo bits) * @skb_iif: ifindex of device we arrived on * @tc_depth: counter for packet duplication + * @tx_queue_from_hash: select the TX queue from the packet hash rather + * than the owning socket or producer CPU * @tc_index: Traffic control index * @hash: the packet hash * @queue_mapping: Queue mapping for multiqueue devices @@ -1043,6 +1045,7 @@ struct sk_buff { #endif __u8 unreadable:1; __u8 tc_depth:2; + __u8 tx_queue_from_hash:1; #if defined(CONFIG_NET_SCHED) || defined(CONFIG_NET_XGRESS) __u16 tc_index; /* traffic control index */ #endif @@ -5268,6 +5271,21 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu to->queue_mapping = from->queue_mapping; } +static inline void skb_set_tx_queue_from_hash(struct sk_buff *skb) +{ + skb->tx_queue_from_hash = 1; +} + +static inline void skb_clear_tx_queue_from_hash(struct sk_buff *skb) +{ + skb->tx_queue_from_hash = 0; +} + +static inline bool skb_tx_queue_from_hash(const struct sk_buff *skb) +{ + return skb->tx_queue_from_hash; +} + static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue) { skb->queue_mapping = rx_queue + 1; diff --git a/net/core/dev.c b/net/core/dev.c index a230ecce9327..e150d5e92712 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3625,7 +3625,7 @@ static u16 skb_tx_hash(const struct net_device *dev, } } - if (skb_rx_queue_recorded(skb)) { + if (!skb_tx_queue_from_hash(skb) && skb_rx_queue_recorded(skb)) { DEBUG_NET_WARN_ON_ONCE(qcount == 0); hash = skb_get_rx_queue(skb); if (hash >= qoffset) @@ -4925,9 +4925,13 @@ u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb, struct net_device *sb_dev) { struct sock *sk = skb->sk; - int queue_index = sk_tx_queue_get(sk); + int queue_index; sb_dev = sb_dev ? : dev; + if (skb_tx_queue_from_hash(skb)) + return skb_tx_hash(dev, sb_dev, skb); + + queue_index = sk_tx_queue_get(sk); if (queue_index < 0 || skb->ooo_okay || queue_index >= dev->real_num_tx_queues) { 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; From patchwork Tue Nov 17 14:11:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5726 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:9292:b0:11a:f58a:e788 with SMTP id dc18csp2609519lab; Tue, 17 Nov 2026 06:11:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFp2pYBLUsMd3TaNfoIqCreWt8cJfKHx1zis8+1eSQK8llQj7xLbR4XRGI4smNwEaLVA/5YndukanQ=@openvpn.net X-Received: by 2002:a05:701b:4584:b0:144:fb87:5b91 with SMTP id a92af1059eb24-1b50310ae62mr12560520c88.44.1794924683814; 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=VaDlsauBgEXNVyQ1fex0i2vN95f7fHrFjD2tQqLkaK7gVcsFYiFyHROuT03bBRnEO0 8QNeW5gpNFG2zvN984vhHixp8MW2wT54Fei6VTgtUAX+2eYtjFwD3MFp27cHuvmXP7qQ /HLlYzKy0Nsj2tctqDt5e5mp8GR+HUpwMcutA0j6Hg5HAwz2Civ1whnzFpsqL3Gkwll0 5X2OLFtWCmgnkApohTMbIdelVIMHZ8JKFgQCkVc6gMw0ERQlc3bWCgyui00+KXTUS1fJ Idx6NIZQxmXzwmAN7ahyOHzzS9mvirRwQ6gPScNorYQxBXCjJlbYstettN4b3BDi3H3O dxIA== 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=+JiYLcDdg08cZ6PPFcfNU/BmiK5efHPnX1ubO7cYu60=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=hx4N8F08T9FFBvBHUsX7nnD1XmdrWlgRHNf7481fLuaRMQMgegj8l70r6FT5nLAdTh hC3btNbBKAaYmZFp6LwcQL42zcV0TXFRwVazNcjxUYcgbW3dbIu40icVbwDqWQsogTsu ig3DcCnwNmE09Y5xm7EJYk9FQiBdKbCF8NBbpeVOEhl6BjxB5Np2YLvyMrgxU0oaEJq6 RH2pWtjHtuJ2KVRw0z7cN8fRNnmBUkkGR0jYAHWAEjg9ZtRc1mAsSLmr0QhkhsI8xhz1 WiNIHqzYetr0aNk5aTo0iQ8F5gGPzHDjiM7v2+6yjEplgntZUHfFujiDCmB1PD2V2heO 5d+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=dXfAYbvz; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=TcgRnj2A; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VvaCicxy; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=eXdQRJ71; 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-3816d419631si5354411eec.54.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=dXfAYbvz; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=TcgRnj2A; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VvaCicxy; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=eXdQRJ71; 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=+JiYLcDdg08cZ6PPFcfNU/BmiK5efHPnX1ubO7cYu60=; b=dXfAYbvz7/Bnp1 AGJiLiyjOgGzvLgAPsqY8l7mIEuDedNkjLZyb7ZRKcvh7SwNnP+5w+B6AtnpwuADfqLy7oEEML6Ty HyB/6R7yQ0gQTW2SALn8jrGXXzGtv68BHqC8nQN6gnnl62JqdDTlJXJYrH/ikD0Q5T5wnrAPpHdLF Ixo=; 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-000000001sx-3ME1; 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 1xTJu5-000000001sZ-0UxJ for openvpn-devel@lists.sourceforge.net; Tue, 17 Nov 2026 14:11:21 +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=el38liqVEHYqmnWDeZ1yuP1/i4B9z0xN3MNdso0KXR0=; b=TcgRnj2AIzi/1HsyneSUlkl+oa Ah3l1hJd7pS9WBxkavmRNZcYLEKVOkXeGHCYDg1DabFtjM4edMavc38Fy3EBOa4s0Ji/EzHFYPEuK IpLT63QIBNFcwXw7atKpaRDTZhADM9ydfegUgQNeaoeiepeyKcPDsq+CgEc+1cmtTXcA=; 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=el38liqVEHYqmnWDeZ1yuP1/i4B9z0xN3MNdso0KXR0=; b=VvaCicxydc16DnD7BRDwjkYrr3 PXc9zaQDDtZ8bLdMmdKryet6kMAX0vYd6H0+ozPM8Xx2CSibzJtVjmwk7An0k3Lpfyv0IqzSDFjNh jMzTALH6EqDKiKBb0y5pzJG6E2bfYXXmldovo1bfmdmC33DegndhvMrfy/cfusjQNujU=; Received: from mout-b-202.mailbox.org ([195.10.208.62]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTJu2-000000007sy-1ddx for openvpn-devel@lists.sourceforge.net; Tue, 17 Nov 2026 14:11:21 +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-202.mailbox.org (Postfix) with ESMTPS id 4jTRV63ZrxzKmcv 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=el38liqVEHYqmnWDeZ1yuP1/i4B9z0xN3MNdso0KXR0=; b=eXdQRJ71wBvrcgW4YFdJYiXxcHFmJsfZkt304/DPgqcoL48/+o+qb7NIIbwnimqtWsIRlr 5DVbwDvqSyF1q2vLTXFmqr6ZI+ERsbHndz+Ew7QxYH+LKUIT4Ogwb5ZzQ1pBXihFQOx1dX LCzj/FgDvV1HCZpsfQKTZGWxB3V4UHNDRtgSElHCxgTS//J60Lm2eRzI2WtXCqR6gnWQZg kqvcw0qqBTj0puvgbbTLaPALnCv+l2uymL1EHlAfRd4krowkJB7nLE342I6yfqyFECIHok nDUnETwvLO0Qdk3sD754n3kLSBAPA6g7HVfMls0Ge8kjGerxpYItSHjpR3y0NQ== 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:11:00 +0100 Message-ID: <45fd7978aa65dca13632657bcaba9fab6002f6c3.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: 4jTRV63ZrxzKmcv 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: __get_hash_from_flowi4 was removed for lack of users in commit de7a0f871fab ("net: Remove unused get_hash_from_flow functions"), while its IPv6 counterpart survived for automatic flow labels. A tunnel [...] 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1xTJu2-000000007sy-1ddx Subject: [Openvpn-devel] [PATCH ovpn net-next 3/4] net: restore __get_hash_from_flowi4 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: 1882114945225652898 X-GMAIL-MSGID: 1882114945225652898 __get_hash_from_flowi4 was removed for lack of users in commit de7a0f871fab ("net: Remove unused get_hash_from_flow functions"), while its IPv6 counterpart survived for automatic flow labels. A tunnel which routes its outer packets with a flowi can use these helpers to set the outer flow hash without dissecting the packet, as ovpn will. Restore the helper and add skb_get_hash_flowi4 next to skb_get_hash_flowi6. Like the IPv6 variant, it leaves basic.n_proto unset, so the hash is stable for a flow but not identical to the one the flow dissector computes from the packet itself. Signed-off-by: Ralf Lici --- include/linux/skbuff.h | 13 +++++++++++++ include/net/flow.h | 1 + net/core/flow_dissector.c | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index aaa33d44b01c..1c8bcacd4d0d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1679,6 +1679,19 @@ static inline __u32 skb_get_hash(struct sk_buff *skb) return skb->hash; } +static inline __u32 skb_get_hash_flowi4(struct sk_buff *skb, + const struct flowi4 *fl4) +{ + if (!skb->l4_hash && !skb->sw_hash) { + struct flow_keys keys; + __u32 hash = __get_hash_from_flowi4(fl4, &keys); + + __skb_set_sw_hash(skb, hash, flow_keys_have_l4(&keys)); + } + + return skb->hash; +} + static inline __u32 skb_get_hash_flowi6(struct sk_buff *skb, const struct flowi6 *fl6) { if (!skb->l4_hash && !skb->sw_hash) { diff --git a/include/net/flow.h b/include/net/flow.h index ae9481c40063..7a6ccd0d56bd 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -194,5 +194,6 @@ static inline struct flowi_common *flowi6_to_flowi_common(struct flowi6 *fl6) } __u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys); +__u32 __get_hash_from_flowi4(const struct flowi4 *fl4, struct flow_keys *keys); #endif diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 1be6c739e3c7..8533a9ce232e 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -2020,6 +2020,22 @@ __u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys) } EXPORT_SYMBOL(__get_hash_from_flowi6); +__u32 __get_hash_from_flowi4(const struct flowi4 *fl4, struct flow_keys *keys) +{ + memset(keys, 0, sizeof(*keys)); + + keys->addrs.v4addrs.src = fl4->saddr; + keys->addrs.v4addrs.dst = fl4->daddr; + keys->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; + keys->ports.src = fl4->fl4_sport; + keys->ports.dst = fl4->fl4_dport; + keys->keyid.keyid = fl4->fl4_gre_key; + keys->basic.ip_proto = fl4->flowi4_proto; + + return flow_hash_from_keys(keys); +} +EXPORT_SYMBOL(__get_hash_from_flowi4); + static const struct flow_dissector_key flow_keys_dissector_keys[] = { { .key_id = FLOW_DISSECTOR_KEY_CONTROL, From patchwork Tue Nov 17 14:11:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Lici X-Patchwork-Id: 5727 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:9292:b0:11a:f58a:e788 with SMTP id dc18csp2609550lab; Tue, 17 Nov 2026 06:11:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErF9hndORkGhh0ewi6hvn5AKwaqseZW7BaeuDxNtwgSx30GqeEiFcPLaVx0xgCEvLRTiolAMMzjFyks=@openvpn.net X-Received: by 2002:a05:701b:2044:20b0:1b5:1f62:7b51 with SMTP id a92af1059eb24-1b53a47612emr2339100c88.23.1794924684977; Tue, 17 Nov 2026 06:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794924684; cv=none; d=google.com; s=arc-20260327; b=XPpRSRZPvdFgowwU0dxsLGML22sAmG8Pr3/d+4TwnZYe03hswQfVm4dPYyIjLEu5kj jT8E4n4O8wGBjEEfyjXrS7p3VWOcb4theQGGJwA2p38FBuwZ+K+dLW+omavVJzc5kZZ6 szgxQidXp/8aPTHNnch6kQnQ7ke/iA1xz8yQQ1L1B0pih/O3e03B1QteZIa/rN3eBuZ6 dIZBPGOcaiuFsHjvysWSzxAqtlkk11rvsjQs8Odrq4DpXuxo8DqbxI5vvjkZdeNxPc+m 8h1avtVu25gi5654vxAhbrxwQr4K/oPrJltyooyldofeb34OMjMqBJBlVlP2/DAeKnsg EL4w== 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=w7JkQ29F/32j9OTHXUaNDYXFg/wmOWy4WA8qJK1cenI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ApU+Rta/gOWDmxPV592e/qIQ6A/XjL9lyKfkw/KPqxhSqW2pg84ZlpU8PAn/GZGslX auCu3uthUUWm6dVKZsG0yW3BWVnsd9JWLygDw/dVGszcpiCyx12YJpxOuqJlQXsqX1jV TxRmv2Z8944V6UHn3/uTIS5R7L05Bu2hOmkDswL5Yer/DtxP6+UpX4ER+wsW4R/hj6Nb IvrFmZ+3+nblFazH2rnDAWIV9i3Bi7ExyFOLnJLO97pcyZVzPZTlmYIPbPL3oyfX/fhY usuIjjp8L8TI9Eg0nYKXv0cwMngBXRSapysZjOPeq80wP0ObxWgio0Ix607bbrLK0nzP TyJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=KxJxAT9d; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZBTTNEcb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PedlbSbP; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=Q7rPNm+q; 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-379599bcc02si55135187eec.26.2026.11.17.06.11.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2026 06:11:24 -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=KxJxAT9d; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ZBTTNEcb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PedlbSbP; dkim=neutral (body hash did not verify) header.i=@mandelbit.com header.s=MBO0001 header.b=Q7rPNm+q; 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=w7JkQ29F/32j9OTHXUaNDYXFg/wmOWy4WA8qJK1cenI=; b=KxJxAT9dYFxV1/ FkB0x1ya0TdOdKM/OYz6Qdq6ACfHl5xD5VPcHbmj0Sq/0np7a4YAemwwIGFNYoPa3NBmcBYIIBf64 y5a9Z6Ngdm6P8Z1fnOFlPBDQYuSRwqrZZbX0Cw1yUWXmo43aBY66QCzMMM9WThuZQV5P822ny46sj iY8=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xTJu8-000000006qu-0Ato; Tue, 17 Nov 2026 14:11:24 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.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-000000006qj-31JN 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=DQj1ziqMEKpHWDaqoM4Ka48aAbfdgTEL750t4tRlk/U=; b=ZBTTNEcbkHKV3e45H2Td7qtjYb AxrvIwdC+2+rEi9LAB/3Xz+SC9+fgQEn070DWgBqZVKx6gdSH4uDGwOxqcsx+K4CYbQHunOFTUTUZ RqDXQsQInB3V7BiY6Yevg9qAL2cbpQdBNrpgtlrzDfjrMNL3jhZbqG4UfbrGZyIP68mk=; 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=DQj1ziqMEKpHWDaqoM4Ka48aAbfdgTEL750t4tRlk/U=; b=PedlbSbPZnMT17BqDV75F1n3xt 6Le0vmpmEuciZ7Gvcz3Iumg28g8jVNSeGwqAYZLE+td2W8GM5eQsr0Z5aZGvHqC52SB11Cktl3bWL OGZRa31GuMkX+/PvmreXEguS6gfdW/LKjlyHhj5g1r5NH53it5O1jRtn/fRWWyfDoVuE=; Received: from mout-b-201.mailbox.org ([195.10.208.61]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTJu2-000000003Nz-0rQx 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-201.mailbox.org (Postfix) with ESMTPS id 4jTRV66PqYzLlp6 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=DQj1ziqMEKpHWDaqoM4Ka48aAbfdgTEL750t4tRlk/U=; b=Q7rPNm+qpa/rZPdKrV4u/DwkAqL45ESZ8Sad6kb4xPPErgo3iZu8kJQvy2ZOURfj4508AF D4flT7TjYmTYVFEqpS1FWSv7o46uFcCW48EsQaqHxUbL3l/cIBY/QbYVW4NqV0xX0d7LV5 93Qs98ixJFTkc/IXbDWhbN/wxo3u1YL9f+vm3azEGixJxEXztOiiGCFKeVQ4db7r69KZs9 dlLXjNvuSypnlkDV/AU2oAZXlStsY//67aSC6LFuPo1qByUCcg36uAyN/xzUMQxmHlPWjv f8nSvWLK9dUF7HpOQ4s1pIHVeVd88n+JSKsDzp+ukwZd1cMghm+aU/OuDUtgrA== 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:11:01 +0100 Message-ID: <148b9524e5fcbbe18a18368ba6a2abe3904b4d24.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: 4jTRV66PqYzLlp6 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: Selecting the physical TX queue from the packet hash makes netdev_pick_tx dissect every outer packet, although ovpn already holds the outer flow in the flowi it routes with. On IPv6, the stack derives [...] 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1xTJu2-000000003Nz-0rQx Subject: [Openvpn-devel] [PATCH ovpn net-next 4/4] ovpn: hash the outer flow from its flowi 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: 1882114946640959353 X-GMAIL-MSGID: 1882114946640959353 Selecting the physical TX queue from the packet hash makes netdev_pick_tx dissect every outer packet, although ovpn already holds the outer flow in the flowi it routes with. On IPv6, the stack derives the hash from that flowi only when it generates an automatic flow label. Set the hash from the outer flowi in both output paths, so that queue selection depends neither on dissecting the packet nor on automatic flow labels. Signed-off-by: Ralf Lici --- drivers/net/ovpn/udp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ovpn/udp.c b/drivers/net/ovpn/udp.c index 892b33edaf8c..f9741fd86c20 100644 --- a/drivers/net/ovpn/udp.c +++ b/drivers/net/ovpn/udp.c @@ -288,6 +288,8 @@ static int ovpn_udp4_output(struct ovpn_peer *peer, struct ovpn_bind *bind, spin_unlock_bh(&peer->lock); transmit: + /* hash the outer flow for queue selection without dissecting it */ + skb_get_hash_flowi4(skb, &fl); udp_tunnel_xmit_skb(rt, sk, skb, fl.saddr, fl.daddr, 0, ip4_dst_hoplimit(&rt->dst), 0, fl.fl4_sport, fl.fl4_dport, false, sk->sk_no_check_tx, 0); @@ -388,6 +390,8 @@ static int ovpn_udp6_output(struct ovpn_peer *peer, struct ovpn_bind *bind, * udp_tunnel_xmit_skb() */ skb->ignore_df = 1; + /* hash the outer flow for queue selection without dissecting it */ + skb_get_hash_flowi6(skb, &fl); udp_tunnel6_xmit_skb(dst, sk, skb, skb->dev, &fl.saddr, &fl.daddr, 0, ip6_dst_hoplimit(dst), 0, fl.fl6_sport, fl.fl6_dport, udp_get_no_check6_tx(sk), 0);