Re: [PATCH net-next v18 5/6] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags

From: netdev-bot+sashiko

Date: Thu Dec 03 2026 - 03:57:46 EST


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