Article View: linux.kernel.netdev
Article #26224Re: [PATCH net-next v18 5/6] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 08:57
Date: Thu, 03 Dec 2026 08:57
106 lines
12128 bytes
12128 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] yt922x_tag_xmit() in net/dsa/tag_yt922x.c line 66 builds the
TX tag with YT922X_TAG_PRIO(skb->priority).
- [Low] The layout documentation in the header of net/dsa/tag_yt922x.c is
mislabelled, and the commit message describes the MAINTAINERS change…
--
net: dsa: tag_yt922x: add support for Motorcomm YT922x tags
This adds a new DSA tag driver for Motorcomm YT922x switches. They use the
same ETH_P_YT921X EtherType and 8-byte tag length as YT921x, but the tag
layout is different. The patch also adds a DSA_TAG_PROTO_YT922X protocol
value and a new maintainer to the Motorcomm YT921X MAINTAINERS entry.
> diff --git a/net/dsa/tag_yt922x.c b/net/dsa/tag_yt922x.c
> new file mode 100644
> index 0000000000000..ee5d44df0dc79
> --- /dev/null
> +++ b/net/dsa/tag_yt922x.c
> @@ -0,0 +1,133 @@
[ ... ]
> +/*
> + * To define the from cpu tag format 8 bytes.
> + *
> + * +----+----+-------+-----+----+---------
> + * | DA | SA | TagET | Tag | ET | Payload ...
> + * +----+----+-------+-----+----+---------
> + * 6 6 2 6 2 N
> + *
> + * To-CPU (RX) tag format, 8 bytes:
[Severity: Low]
This isn't a bug, but is "from cpu tag format" the right label for this
diagram? The DA | SA | TagET | Tag | ET layout covers both directions. The
comment then describes the To-CPU (RX) and From-CPU (TX) layouts
separately.
Also, the commit message says:
Update the co-maintainer for the Motorcomm DSA driver.
The MAINTAINERS hunk doesn't update an existing entry. It adds a new
"M: Kyle Switch" line to the MOTORCOMM YT921X ETHERNET SWITCH DRIVER
section, and that line isn't related to the new tag driver.
Could the commit message say that a maintainer is being added?
[ ... ]
> +#define YT922X_TAG_PRIO_M GENMASK(12, 10)
> +#define YT922X_TAG_PRIO_EN BIT(13)
> +#define YT922X_TAG_PRIO(x) (FIELD_PREP(YT922X_TAG_PRIO_M, (x)) | YT922X_TAG_PRIO_EN)
[ ... ]
> + tag[0] = htons(ETH_P_YT921X);
> + ports = dsa_xmit_port_mask(skb, netdev);
> + /*To fill in the case where the port index is not 0 */
> + ctrl = YT922X_TAG_PRIO(skb->priority) | YT922X_TAG_FORCE_DST |
> + YT922X_TAG_PORTS(ports >> 1);
[Severity: Medium]
In yt922x_tag_xmit(), what happens when skb->priority is larger than 7?
skb->priority is a runtime u32, so FIELD_PREP() does no range check here.
It only shifts the value and masks it into GENMASK(12, 10), which wraps it
modulo 8. For example, 8 becomes 0, 9 becomes 1, and a classid such as
0x10001 becomes 1.
YT922X_TAG_PRIO() always sets YT922X_TAG_PRIO_EN, so the switch applies the
wrapped value as the frame's internal priority. A frame given a high
priority via SO_PRIORITY, tc skbedit or a VLAN egress QoS map could then
be sent at the lowest hardware priority.
This path is used once yt922x_dsa_get_tag_protocol() returns
DSA_TAG_PROTO_YT922X in the follow-up patch "net: dsa: motorcomm: Add
support for Motorcomm YT922x".
Other taggers map the value and/or clamp it first. tag_lan9645x.c does:
qos_class = netdev_get_num_tc(ndev) ?
netdev_get_prio_tc_map(ndev, skb->priority) :
skb->priority;
qos_class = min_t(u32, qos_class, GENMASK(IFH_QOS_CLASS_SZ - 1, 0));
tag_ocelot.c also uses netdev_get_prio_tc_map().
Should yt922x_tag_xmit() map and clamp skb->priority in a similar way
before building the tag?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202084022.3716891-1-kyle.switch%40motor-comm.com
Technical Details
Message-ID:
<179628825391.3146.14161603947402253086@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376417-linux-kernel-netdev=dewy.ruReferences:
<20261202084022.3716891-6-kyle.switch@motor-comm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376417-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v18 5/6] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags Date: Thu, 03 Dec 2026 08:57:33 +0000 Organization: Usenet Network Message-ID: <179628825391.3146.14161603947402253086@kernel.org> References: <20261202084022.3716891-6-kyle.switch@motor-comm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2441519"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:a++OebbBrgWCu/YQlm/m0XjNgBQ= sha256:9PaWF/874NLUG2wO5tWMH6AZGm56Y1UmMWC2IhAW4jM= sha1:okN6Q6Xjzxu1fufBYKb2iju3BZE= sha256:p0vpvtxkYGN9tADau6uw2Pcs/sby34LV0xRHUomQ/B0= 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 210B311788D; Thu, 3 Dec 2026 11:58:06 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 5yYw1_eHm9KV; Thu, 3 Dec 2026 11:58:02 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376417-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4D89011787E; Thu, 3 Dec 2026 11:57:53 +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 C37482E06B; Thu, 3 Dec 2026 08:57:38 +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=1796288256; b=pLcG56CVAgQ7DTDCKMDibEyvQhoSwMJn3e50582vIVla/gFkrlc4kC80pKajymrtqqdl y0EW08VJsWl8gXlfKAoLo3J9nLMgnJgQaexfK55olWZWMYtx9/zR7z665AArbF1FdoAho n48cYENFxvPxiaC1HQpYU2oTmipvG7YTB10cmhGVYLz0kSaEZNTFHWOGWY6f1i3Mbfilx sBtnO6wsVD4GiUaZPZP+zmggziZua3r1p5Kgjd3v14ItCHC99bIsUYXNbK+6eY/HBd4v6 Di7EJOGfHICYBs0JYtMbzXobvMvRfvH0lLf78yULB05NGFu94GBsk8r/wYNH7jpYO0Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288256; 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=5mX8Xin5UQoPUpS4FXTbp81o/gWEOWLCqr++PzeMfnU=; b=T3hcnHVx4QUQvHXOdsLqfrxl5CX/yjWZzAF1ldQsbQPvOvoq/K3RCd1tM57n92gUqeaW vtA9jvSm1IdpYUd9iXXTgLrIwS6TRa7tJUJWNytQynyga2Q2pJf8UtAq/29tjJks2zgq1 WnhNydQ4pboLQ6VKDykB253wH/4Cjdrn5lIaNxiG2mgWIBnphXb08bKLYXRJXqVAD0c3/ Y35XYUBANbsxAJLDuvv0YBDk2tLCvCVylptwvdTQrBnYyVnmrpEgIqjw+Rcjf82HZr+fq 6cBybmX+7MWHnUG/nNqP9OmKatvAhwwg2Z3XM4B34uUZWQaLeTcifav8COJgZ8+V9Sw== 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="oQ/bI+7D"; 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 602B3606A69F; Thu, 3 Dec 2026 08:57:36 +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=oQ/bI+7D 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=1796288255; b=DGqFOcH7MO/3SBT56zpHXgN7Dt4Qogz5wt7s8AaBnrezTZj4ImVbqvXg0uTlCrGUTozB INDcUrVMpZH6Or9nw3s9srR6gdNpQdWNHF+ymOmTR/YdWmUEBF0X6OCj1EUmwn+yOW91t 8L3wHzIF4/IUGC5EszDNchvBL7rxU/U9dVo2u9eYUkTxkfVcTNOrcUcbvYuEozw/rnk7y Ufvmf7qJHGbeota9LqKP4jZNWSEBTmu/xK1Obs68QZSztcqgGrQIhFpRFih3SFqWJ1aqe XUwsANunR1XzReSxi6cmghoFtNne2/RU2wj424vyaCB4tRiNGctB6e1jNMaWze8qDHw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288255; 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=5mX8Xin5UQoPUpS4FXTbp81o/gWEOWLCqr++PzeMfnU=; b=N54EEgGZKHyGbfomFgjUZP5U4dvwSXhetiQvwCwEt9g247BAQYqCWQQvBUgxQnbLJ2On rezU2Fwv0amKVGHI8RLavYXtvZDLBUyZxsBu4N/MUXszjDKTGwux6OwY6yThIVoDQ/pjW kud9PeKyHCvZAlqaaqrsNgX3kAIzsnm5NV6csaZkAwSveIYc/WoMzuLuZyt2S4rNYwifC SL5mySIbjffIbyBsS8jrM4NB4SwIylv3xCQlewk6t3dpI+iH4JyvetgsVoII1h17Q05YJ KuraABdlqfOrxoLZyurbHh8Qp+6ta7gyQqFnE5M0F2iBpO08v3hl+qXCF2ZOHzftYhg== 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="oQ/bI+7D"; 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 81A63606A68D; Thu, 3 Dec 2026 08:57:35 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 522111F008A0; Thu, 3 Dec 2026 08:57:34 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796288255; bh=5mX8Xin5UQoPUpS4FXTbp81o/gWEOWLCqr++PzeMfnU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=oQ/bI+7D9px3jl4rzoIp2Wti4GtuxfYfahLpU+z5QRWPBVeNfOKk9UfMM4albuiuu dAyZVwU4nFzES+NLvlzIVCIHZFAR+Lhc+3GyfQmFvWqiUpxXtZUYeDIN3OSWwT5c0C SlsK132Ih2reyxPw34/rbQI7Sdis+G6UeG0FCcwtn9EdrSCF47nSxWbNWKjwvPcU37 4hK20qe34DAXHVqdksdzXjpbYVOJ4LYUVAyfJbqZ27qS6+bj4JiwUw+/AM9ahUP8+2 Q2j5/827rWLka5P4lJblv5aRDoXphEt5aWeRrNZN2oOeuqprEEzRiRlj8KSFsEG92P q4TnaFpSnV3bg== X-Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mmyangfl@gmail.com, horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, david.laight.linux@gmail.com, ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com, wei.zhang@gl-inet.com, sijia.huang@gl-inet.com X-In-Reply-To: <20261202084022.3716891-6-kyle.switch@motor-comm.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