From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 522111F008A0; Thu, 3 Dec 2026 08:57:34 +0000 (UTC) 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== Subject: Re: [PATCH net-next v18 5/6] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags From: netdev-bot+sashiko@kernel.org To: kyle.switch@motor-comm.com 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 Date: Thu, 03 Dec 2026 08:57:33 +0000 Message-ID: <179628825391.3146.14161603947402253086@kernel.org> In-Reply-To: <20261202084022.3716891-6-kyle.switch@motor-comm.com> References: <20261202084022.3716891-6-kyle.switch@motor-comm.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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