Netdev List
 help / color / mirror / Atom feed
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,
	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
Subject: Re: [PATCH net-next v14 4/5] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags
Date: Wed, 14 Oct 2026 01:59:26 +0000	[thread overview]
Message-ID: <179194316648.434549.16755403758005812605@kernel.org> (raw)
In-Reply-To: <20261013011122.1889766-5-kyle.switch@motor-comm.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The tag-layout comment in net/dsa/tag_yt922x.c does not match
  what yt922x_tag_xmit() writes.
- [Low] Concern: yt922x_tag_rcv() never calls
  dsa_default_offload_fwd_mark(), so the software bridge might forward…

--

net: dsa: tag_yt922x: add support for Motorcomm YT922x tags

This adds a new DSA tag driver for Motorcomm YT922x switches. YT922x uses
the same ETH_P_YT921X EtherType and 8-byte tag length as YT921x, but the
tag layout is different. The patch also adds a co-maintainer to the
Motorcomm DSA MAINTAINERS entry.

> diff --git a/net/dsa/tag_yt922x.c b/net/dsa/tag_yt922x.c
> new file mode 100644
> index 0000000000000..b6146a9af98b3
> --- /dev/null
> +++ b/net/dsa/tag_yt922x.c
> @@ -0,0 +1,122 @@

[ ... ]

> +/*
> + * To define the from cpu tag format 8 bytes.
> + *
> + * To-CPU (RX) tag format, 8 bytes:
> + *
> + *   tag[0]: TPID (default: 0x9988)
> + *   tag[1]: VID lookup
> + *   tag[2]: bit 5:2  - RX source port
> + *
> + * From-CPU (TX) tag format, 8 bytes:
> + *
> + *   tag[0]: TPID (default: 0x9988)
> + *   tag[1]: bit 8:0 - Dst port mask
> + *   tag[2]: bit 15  - Dst port 0
> + *
> + */

[ ... ]

> +	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);
> +	tag[1] = htons(ctrl);

[Severity: Low]
This isn't a bug, but does the tag layout comment match what
yt922x_tag_xmit() writes? The commit message says:

    The new driver documents both the to-CPU and from-CPU tag layouts.

The from-CPU part of the comment describes tag[1] bits 8:0 as the
destination port mask. yt922x_tag_xmit() puts ports >> 1 into that field,
though, so bit 0 there is port 1, not port 0.

tag[1] also always carries YT922X_TAG_FORCE_DST (bit 9), YT922X_TAG_PRIO_M
(bits 12:10) and YT922X_TAG_PRIO_EN (bit 13), and tag[3] is written as 0.
The comment doesn't mention any of these.

Separately, the comment block opens with "To define the from cpu tag format
8 bytes." right above the To-CPU (RX) description. Is that line a leftover?

[ ... ]

> +	/* Remove tag and update checksum */
> +	skb_pull_rcsum(skb, YT922X_TAG_LEN);
> +	dsa_strip_etype_header(skb, YT922X_TAG_LEN);
> +
> +	return skb;
> +}

[Severity: Low]
Should yt922x_tag_rcv() call dsa_default_offload_fwd_mark() before it
returns? tag_yt921x.c and most of the other tag drivers do.

As far as I can tell, leaving it out has no effect with the switch driver
later in the series. yt922x_dsa_switch_ops has no .port_bridge_join, so
dp->bridge stays NULL and the bridge falls back to software bridging. In
that case the helper would set the mark to 0 anyway:

net/dsa/tag.h:dsa_default_offload_fwd_mark() {
    ...
	skb->offload_fwd_mark = !!(dp->bridge);
}

The port isolation and trap-to-CPU setup in the switch driver also stop the
hardware from forwarding between user ports.

If bridge offload is added later, would the software bridge forward frames
again that the switch has already forwarded, unless the mark is set here?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261013011122.1889766-1-kyle.switch%40motor-comm.com

  reply	other threads:[~2026-10-14  1:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  1:11 [PATCH net-next v14 0/5] net: dsa: motorcomm: add support yt922x driver Kyle Switch
2026-10-13  1:11 ` [PATCH net-next v14 1/5] net: dsa: motorcomm: initialize dsa_switch based on chipid Kyle Switch
2026-10-14  1:59   ` netdev-bot+sashiko
2026-10-13  1:11 ` [PATCH net-next v14 2/5] net: dsa: motorcomm: use max_ports in series for port bounds checking Kyle Switch
2026-10-13  1:11 ` [PATCH net-next v14 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers Kyle Switch
2026-10-14  1:59   ` netdev-bot+sashiko
2026-10-13  1:11 ` [PATCH net-next v14 4/5] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags Kyle Switch
2026-10-14  1:59   ` netdev-bot+sashiko [this message]
2026-10-13  1:11 ` [PATCH net-next v14 5/5] net: dsa: motorcomm: Add support for Motorcomm YT922x Kyle Switch
2026-10-13  1:51   ` Andrew Lunn
2026-10-14  1:59   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179194316648.434549.16755403758005812605@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jianmin.wang@motor-comm.com \
    --cc=kuba@kernel.org \
    --cc=kyle.switch@motor-comm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ming.xu@motor-comm.com \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sijia.huang@gl-inet.com \
    --cc=wei.zhang@gl-inet.com \
    --cc=xiaolin.xu@motor-comm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox