🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7157

[PATCH net] net: dsa: clear the conduit RX queue on user port receive

#7157
From: John Macias
Date: Sun, 25 Oct 2026 07:22
65 lines
13162 bytes
A multi-queue conduit records its RX queue in skb->queue_mapping with
skb_record_rx_queue(), as stmmac, mtk_eth_soc, fec and dpaa2 do.
dsa_switch_rcv() passes the skb to the user port with that value
unchanged, but user ports have a single RX queue. For a packet that
arrived on conduit queue 1 or above, get_rps_cpu() finds the index past
the user port's real_num_rx_queues and returns without steering. The
WARN_ONCE() there stays silent because the port has only one queue. As
a result, rps_cpus on a user port takes effect only for packets that
arrived on conduit queue 0.

Clear the queue mapping when the skb is handed to the user port. TX
queue selection is unaffected: the user port's own netdev_pick_tx() sets
queue_mapping again before the conduit transmits.

Found on an IPQ8074 board (OpenWrt, Linux 6.18, conduit with four RX
rings): with rps_cpus set on the LAN and WAN user ports,
/proc/net/softnet_stat showed no RPS for traffic hashed to conduit
rings 1-3. With this change, that traffic is steered to the configured
CPUs.

Fixes: 91da11f870f0 ("net: Distributed Switch Architecture protocol support")
Assisted-by: LLM
Signed-off-by: John Macias <dencity7@gmail.com>
---
The Fixes tag points at the commit that added the DSA receive path. The
problem shows up once RPS is used on a user port, since get_rps_cpu()
checks the recorded queue against the port's own queue count.

This was found and fixed with an AI coding assistant (Claude, from
Anthropic). It traced the missing RPS to the stale queue_mapping, wrote
the change and this changelog, and ran the tests on my hardware. I have
reviewed the change.

Testing: the same change on OpenWrt's Linux 6.18 on a Netgear RAX120 v1
(IPQ8074, out-of-tree qca_edma conduit with four RX rings, RSS over all
four). Before, received_rps stayed at 0 on every CPU over 8 runs of
bidirectional UDP with rps_cpus set on lan1 and wan. After, it rises on
the configured CPUs for traffic from rings 1-3. On this tree (net,
7076f684d) the change is build-tested only (x86_64 defconfig with
NET_DSA, W=1, WERROR). I have not tested it with a mainline conduit
driver.

 net/dsa/tag.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/dsa/tag.c b/net/dsa/tag.c
index 6a5aa7fc3..ecd4d8669 100644
--- a/net/dsa/tag.c
+++ b/net/dsa/tag.c
@@ -115,6 +115,12 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
 		skb = nskb;
 	}
 
+	/* The conduit's RX queue index means nothing on the user port, which
+	 * has a single RX queue, and get_rps_cpu() skips RPS when the index
+	 * is out of range.
+	 */
+	skb_set_queue_mapping(skb, 0);
+
 	dev_sw_netstats_rx_add(skb->dev, skb->len + ETH_HLEN);
 
 	if (dsa_skb_defer_rx_timestamp(p, skb))
-- 
2.47.3
Technical Details
Message-ID: <20261025072203.1519561-1-dencity7@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351502-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351502-linux-kernel-netdev=dewy.ru
From: dencity7@gmail.com (John Macias)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] net: dsa: clear the conduit RX queue on user port receive
Date: Sun, 25 Oct 2026 00:22:03 -0700
Organization: Usenet Network
Message-ID: <20261025072203.1519561-1-dencity7@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="958841"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/7R/G93SFo1klvZYxMh3Q01ZVrI= sha256:SdC2QHSwyfs4aw8ZU1iuiSMHFggH4MK38hagae0jswI=
	sha1:BVrfx2qids+5mvBvW2EkUuyAUxM= sha256:k08SZ1S5DnAI+g+XHZiwDCOuVNsj3tlrU3VIwxC170k=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id D7F7E125B29; Sun, 25 Oct 2026 10:23:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.51
X-Spam-Status: No, score=0.51 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SBL_CSS=3.558,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id wedjB_fhBwwm;
	Sun, 25 Oct 2026 10:22:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351502-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E1AD5125B2A; Sun, 25 Oct 2026 10:22:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 1CDC54797B; Sun, 25 Oct 2026 07:22:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792912958;
	b=ar9rKMLwx/zGrg5YD1Bcnv/Ei391XxDn4GqUkCZpzmqiNxIprPBKfnI8dizj6+1CpG/I
	 0nUf7jxNakZ7QAHDovBKLfNHeNr/1JMuVeBmj+HgWrrE+aCwFhmV+vnf7BRdrk/hD2FEO
	 +IhVZHej2AqYN6VHtwCI2Y6Z27n9JUZUDfW1izRvGIS3ky/s+ZuXmlsICHut6hTSVrr5A
	 GuutQuBrawF149omCk5LFs8Te7Q6tK6BwtdJGYVmtmmyMhxQ3JJ2yJE98iGET1UIVHweY
	 fLK/phueVGb87q5i9V2G5VLmlxltB6X7ShRQmhy8Ki4roqvs9zY16HfBoCxMgezMrjA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792912958;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=/GcpDOIHzeZZHHnDHnE8tFmy0iBveN0FRIH1VtyXChM=;
	b=SIy2Tjk3IGfsPnQX9U7Jqbi2Wr/wT3UcGG7IyYViX5M/c9OVitZqtK6WR/hxOe83B86Z
	 tKra/GSPda2wUvDYUD53d0z5/lajHCdQL196PeVx3/iMMZ79O+374g45SScrsGrsfo7Hw
	 BoB7AfI3GLSTJI/vw5pW5WgcQjw6w/bjcMvzHnI0R7aVEeTUDOc5QPE8MIb2u/x8CRDb8
	 /AwnGis2bpbpaoupCfu2Lt0+FqQnu5YsQrEuxuDTlITvErp0j24MCYeR1TDZMhSF8rN6L
	 X8EAvZIYKgQwGsRkB8EBXW5vHU7pFmw0ze3tNKlMWruZ3BDsP3lWkxOEEjkEGvoYVaw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b="I/Ef2Atf";
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A112D606A325;
	Sun, 25 Oct 2026 07:22:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=I/Ef2Atf
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792912952;
	b=v8dC95bvDn8CRxUAYctr4GOIEGnKVFx8ORwwbCqXMww0Q5R1OhPGaeUxFx4owsornjAb
	 QkeT9YrcF+OdN2w8oIN+y+/9E9eLq3431HJlOpr1BppyRbgPdYlXjNUTM7kdVOWSxCILy
	 hSnsiqQvznLJH8Oq3d6IPXIfo+dvOAIGyObZvJfYXW6kmI0l9NxB/QnK3fvpRrK5e+1SL
	 G1HcbXelMKKeXbxysLHOHI4+DHu2unj5jHDaZCanpnxCATjmRfKMEBDshsDVzkSWcD3JA
	 1oyu4l6gfPVyXfQgvtiRSO36Oxhk2UNrkrDs9I6VN5bUnG0GbEyxYMnEYpHs4YdjOzg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792912952;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=/GcpDOIHzeZZHHnDHnE8tFmy0iBveN0FRIH1VtyXChM=;
	b=coG7AQk4bN4C2WKeDl2yxFj+VL7S8tj1744Y68L/k2+Ci4rvbddhZIoSB3oilICtF6S0
	 0LM5IBJhpyux/n8wT1MtT0MiWJrxNVt+ZWHW4rbobDFbMmR1S3oJHo9IZwBNPkkgMiV4G
	 y3vKXwjv7Qu1VP73o3BVNY0K3xbqGelu0eF6bd2QHO0YpCwAt3rFGlwKHTSZqCSJ1fDc+
	 tYvxe/8mpRZ7IZV5UCoTSdhLpyCg9Stn+u+LEnOZLue6DPphiWi375ZQeQ8uTnePko8FY
	 Fy0t6nDwVDSEPIRhuUYgPNfccRBE2LomLVKs+NPedvQludqVs8TUlr7jnK1si34oBow==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b="I/Ef2Atf";
	arc=none smtp.remote-ip=74.125.82.173
X-Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6638F606A31A
	for <netdev@vger.kernel.org>; Sun, 25 Oct 2026 07:22:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6638F606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-35f036b17easo5154827eec.1
        for <netdev@vger.kernel.org>; Sun, 25 Oct 2026 00:22:32 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792912951; x=1793517751; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=/GcpDOIHzeZZHHnDHnE8tFmy0iBveN0FRIH1VtyXChM=;
        b=I/Ef2AtfGeMluXC7NTZ+RuqYBNmgd3N4TLprBbVmpnXS4YEivT/OnxgyDoABtA0idd
         PB5EjL6+hzFMHPOTK3xlzOer4n8Umrc9czxgGHTASL5oV/UFbduAjKx+hahx6lXO/whj
         V20JnkwWZG6POBM2VT+IByM4TFYyzI7LQaaUNsvJACSTcDlDAbxG36EuO16NbbV9EfdD
         BgtTJTtl9R4fOJyrIv9Mj4SzATnJR5JdwhZWWak5DJuRO6dYq2kihliflhYmrUfv5T96
         VoGVuBN03e0oErK4aRuBYH+f+Rjh4RoR88Yr7gzebKakIh1TbKbD+OHxkGHALC98ROST
         /drA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792912951; x=1793517751;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/GcpDOIHzeZZHHnDHnE8tFmy0iBveN0FRIH1VtyXChM=;
        b=EJwmImGc9UpQdO0YwaKU1y5QVlV0IRu8+g4u0VKYWatIVupnfFt2/DxDTy/l1s1YOd
         lwmjRGxnn4F6PGocbtM2Mup2OjOtHvaXgzQULbxxhGl0mFg4snmmFJawGHvr1NLYR7vS
         pCpoH5smH4ll3uvcfxanaSf898K30DTFqymfVKHYJuVt+lO0tjYctPTMIFtmUoAw1AKk
         vuNxt2t6ZyqUqF5nu/cYkzLp+pvGaeLguT/ANrwNQTsSh9ZDyOmoIc3pFVMC7QayGt2M
         lmFGvuc73YoHalRo/ffK2+WVrW8gNCUnxACs0vYHpkRo4N/fcLSN/65sszwZuNpZYE5S
         GY/g==
X-Gm-Message-State: AFq9FYJrxJbhsMlNWow1XiqxUWzMagDEEylAqMl8EjSa0SqfhR2YyucX
	FFsQn1TS70JiqraEjlFlbyEDwKZUGgh6TuJViLPuvHZUCEMnWRU5xabdMBN0q0NR6zk=
X-Gm-Gg: AYBFou28jezO6L78mfDy71OWdSxej4PDlbGvYbO/+Iawxvg6rDwug5pPZDDa8gkhmJP
	isd9t9mxjqzEgmTmfpxAEY2/QO4mUSgiJgxuK/jX0JaphTOPO8N5t0BVVmu72e2zqXGPJn3tCUq
	aIuOWjizh5NO3hsQG/TgBWwd9lHohXPwTTXxMbE5iOgwKmhWHijpI1ZPivAh21GLWIDd4Ox9qjy
	17JvT+Gs1q9hS9SszE1p+SipOLbbFE3qwCThbw3GD5uxcpyxl+lXCp7s2tpwpW+2omMRpIBYokT
	tWNRYgblcCdWnFmNY7PQu+luc8y5j+lMuthqgv3NibGz5u4QvkQWTH41aHwfcBlCSScNtv0pwNX
	pEGFirOB93n98aivivIYzVWzfSl1Uol8fgZtmAEpK/rvOLTNz3W3+cTtmzmRc+wV0wFJMEUGI1/
	YekfCa4QiTwv1IQIflcPXrPGfqt/lU883yfYR/KCtEWYtG1C8erFSCpg7AdKvmrtEJLbKGHJZAK
	hga4TQEYmtH6rDt2wdZqIt8WVCw0WIbM2jfSrm1WGKbakl3Ca/3JFB+VWnmXyvL3wMODXkqsWzd
X-Received: by 2002:a05:7301:6182:20b0:366:c0a2:642f with SMTP id 5a478bee46e88-369e84ddf59mr5292495eec.22.1792912951407;
        Sun, 25 Oct 2026 00:22:31 -0700 (PDT)
X-Received: from ZephyrLabServer.internal ([165.162.64.148])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-369e8ec4d73sm18682269eec.22.2026.10.25.00.22.30
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 25 Oct 2026 00:22:30 -0700 (PDT)
X-Cc: andrew@lunn.ch,
	olteanv@gmail.com,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.47.3
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list