๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12845

Re: [PATCH net v3] net: dsa: clear the conduit RX queue on receive

#12845
From: netdev-bot+sashiko
Date: Sun, 08 Nov 2026 21:08
83 lines
11053 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message lists what changes for "code that reads the
  recorded queue later" (skb_tx_hash() and sk_rx_queue_mapping/xps_rxqs).

--

net: dsa: clear the conduit RX queue on receive

This patch clears skb->queue_mapping in dsa_switch_rcv() after the tagger
has chosen skb->dev. The conduit's RX queue index is then no longer carried
over to a DSA user port, or to a bond/team that receives trunk-tagged
frames. With that, rps_cpus on user ports applies to traffic from every
conduit queue, not just queue 0.

> diff --git a/net/dsa/tag.c b/net/dsa/tag.c
> index 6a5aa7fc331c3..e53dc3f3c477c 100644
> --- a/net/dsa/tag.c
> +++ b/net/dsa/tag.c
> @@ -95,6 +95,13 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
>  	skb->pkt_type = PACKET_HOST;
>  	skb->protocol = eth_type_trans(skb, skb->dev);
>  
> +	/* The RX queue the conduit recorded is an index into the conduit's
> +	 * queues. It means nothing on skb->dev, a user port with a single RX
> +	 * queue or a bond/team with its own queue count, and get_rps_cpu()
> +	 * would check it against that device. Leave no queue recorded.
> +	 */
> +	skb_set_queue_mapping(skb, 0);

[Severity: Medium]
The commit message lists what changes for code that reads the recorded
queue later:

  This leaves no RX queue recorded, rather than recording queue 0. Both
  make get_rps_cpu() use the first RX queue's map. They differ for code
  that reads the recorded queue later:

It then covers skb_tx_hash() and sk_rx_queue_mapping/xps_rxqs. Are there
other readers of skb->queue_mapping on the user port or bond/team that
the message should mention?

One reader that userspace can see is PACKET_FANOUT_QM, in
net/packet/af_packet.c:

static unsigned int fanout_demux_qm(struct packet_fanout *f,
				    struct sk_buff *skb,
				    unsigned int num)
{
	return skb_get_queue_mapping(skb) % num;
}

Take a QM fanout group bound to a DSA user port, or to the bond/team that
receives trunk-tagged frames. Before this patch, its packets were spread
across members by conduit RX ring, as (ring + 1) % num.

Now that queue_mapping is always 0 here, will every packet go to member 0?
Recording queue 0 instead would send them all to member 1 % num. In both
cases the group would stop spreading load.

The same applies to tc/BPF ingress programs that read
__sk_buff->queue_mapping, and to the tc ematch meta queue_mapping
selector. On DSA ports they would now always see 0, not the conduit ring
index.

This patch has a Fixes: tag and is headed for net/stable. Could the
commit message also describe these two changes: how QM fanout distributes
packets, and the queue_mapping value that tc/BPF sees on DSA ports?

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261107210653.2007194-1-dencity7%40gmail.com
Technical Details
Message-ID: <179417208676.994134.17082599035866210951@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358857-linux-kernel-netdev=dewy.ru
References: <20261107210653.2007194-1-dencity7@gmail.com>

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-358857-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3] net: dsa: clear the conduit RX queue on receive
Date: Sun, 08 Nov 2026 21:08:06 +0000
Organization: Usenet Network
Message-ID: <179417208676.994134.17082599035866210951@kernel.org>
References: <20261107210653.2007194-1-dencity7@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="204381"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:q57dBugk3umYBbOer+ZlLURGPDU= sha256:uXgstlld9VhfHrBEmZtw3Qlz1dZz+mXKQVybIQ5ZZj0=
	sha1:OS73u3h1Zs7T34swqH7NZfpUVnU= sha256:xww8FeRxEKyb+rm37JBG3Yq+qAwXHzluiI0FtMFi2GM=
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 3960E11360B; Mon,  9 Nov 2026 00:10:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 LSFEcjrgIQWr;
	Mon,  9 Nov 2026 00:10:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-358857-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 667C8113606; Mon,  9 Nov 2026 00:09:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id B0D0B35DC1; Sun,  8 Nov 2026 21:08:10 +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=1794172089;
	b=AiApZCGHJZOxBvvWxhwr4KN6gYrXzv3COpWo2A1+7E9VJzz/3KNSfsHDlTSfXuk7iuS5
	 jBzuN0ryyzF9lYh5IR0ZGh3boNnZiyZRAkuBcOfVWIaxHZRwulZ8hQ8w5SADLB1XToan+
	 TSvO+nGqemMkcahULM8eP7kaQfpVcXd1XrVtWpTLKWzXZvsjN7fSEylFPCnotnsupVRJ6
	 ewuA61r4bhPEI1qpHTRj5E3kbOmPHsSw72jnmN0u81HAjH0nv4inNjvpATV9phUwzQx/0
	 YmY7oI3eQ2n5lRoRs2s30G3bHCuvzaWUjOSw37e7uk+KjJit2oxfzrWVJ7wFH06lG2w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794172089;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Y7JWEwg9Ct2ossjTf4kZV+QIKiz/YwDb7vKoIKIg5Pg=;
	b=awzCEh9kYED5trx2M2GaA4JKxCt44XuTXcxLjL0j2qPPWMDNHeWk3a1yPG6zT9VLUOs1
	 BB7E6WgAoKvoyraky4AQabcv4CwVmFyV7ui8AAWrE9B6bLFk0w9j0EH9TzismIsIwdaV2
	 6i7zynQUJCSc7nj6YWoTznFP3CwaK7dxtkzxTxDQapL7HxT9ijzFUP7OhseDDKN4s4vpC
	 /uPNhX3uS3HNdvuV2xq4Kzs/pcO59Xtv+GpjF+s+PkMtgBINihB6EBaALZKDLtY35cj5r
	 0fz/nYmJVoCcYZwoLIGMsgC0avO9Lld5zI1mHibigXZj3fQZ4Tu7ReCxjpkqYAlQb6w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="ki0vmA/G";
	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 C6F20606A338;
	Sun,  8 Nov 2026 21:08:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ki0vmA/G
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794172088;
	b=XA5STblskWK+jnaZrHPHeoqwo0BGe4Oz3hs7NUPTxW0tKufYTq0BqIbE6pT778Sz+2HY
	 eVpr85eBqJVG0taScmiWrvgZZHQu2C9tF0sdzO/dc/pRzXaOL5n8S1jD4eGc2I3Qo/Obd
	 5K0Ma7WUB5AZ0BgQs3jPVMeqEzRxa4ynbBS45qIZsFsBQ6t1+nATJgiqZdJD3lKcMVosV
	 QrYXjVB14RUN6oAG7m2ciIEo8UMFAgynCPJfGnv/TvtgKoXOJrX9SvTW8FvpkDvvQahHi
	 B68RYNwI/2Uj81Tc8ok3BtQ+4xDwKAPuij1jFkcSL68GMEZWVuPqvSekV3WvAJJpWfg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794172088;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Y7JWEwg9Ct2ossjTf4kZV+QIKiz/YwDb7vKoIKIg5Pg=;
	b=3iB/WdB9cwEvIDBkLeONIu0BOjN8/RV6vTCbOP3btlTbJWg+oL3ZWV2unE9MA0k9ySca
	 Y7EEG/yv0OGAjitTDox5ZMklxoORc0RuiDIx+xGaBMU3gkKVNdl4R3QTuQlU+FN0PFf7r
	 VhArkdpfRBPTubMJLK9Cq4INpveHU9sGfozvg4D7SANCdS1NdyGAXRU8mDRBgPHiAiatr
	 r5YScKUqOkWx4hqUDpcic2iRK+wLbz2qdAcsimLeFKfch9i6VH+zz0jgyPEwWKT7K60hs
	 DTKLSoy/6H5i48bXFua/5E1xrYIa2PdUcbrde466jc4IeDepf9xEGwouLiievWc8NEQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="ki0vmA/G";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3872D606A31C;
	Sun,  8 Nov 2026 21:08:07 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B3881F0089F;
	Sun,  8 Nov 2026 21:08:07 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794172087;
	bh=Y7JWEwg9Ct2ossjTf4kZV+QIKiz/YwDb7vKoIKIg5Pg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ki0vmA/GXah8WIGjXye7gsUwmK5t16oHld4y12MwkB7ntU38OWnaPADjYuR9LnEnx
	 IryscbnrQcqwbwggEzZWX6L3XUsSyw3CyTEGco1/vAw4QsrZsSKU/2xTj6msqDeKWn
	 3WhwzkvhlwD/2LQeLp9uHbr3H+qHNWixdx1OVV7sPrG+k7AndCDjzxkUkjHHUfk1PX
	 D+rBWQ0PT/qV83LbckRT2Ik4PQko74LzRbS/4v8yuYezoSifQ5pEFV4y4frnPwHcRW
	 SGWMsUvLOWjfq/uufLAsk4u4ONwqODDPm/bAiA+n5qyss+jm+qWdgs4z4WODhB6TH+
	 AfMWo0TYEYjuw==
X-Cc: netdev@vger.kernel.org, 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-In-Reply-To: <20261107210653.2007194-1-dencity7@gmail.com>
X-sashiko-severity: Medium
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