Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linus Walleij" <linusw@kernel.org>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v7 3/5] net: dsa: tag_ks8995: Add the KS8995 tag handling
Date: Sun, 05 Jul 2026 19:40:12 +0000	[thread overview]
Message-ID: <20260705194012.6FBB31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260704-ks8995-to-ksz8-v7-3-2af0eaa545a8@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardware-accelerated non-802.1Q VLAN tags (e.g., 802.1ad) are improperly retained in the SKB, resulting in outer hardware insertion that breaks KS8995 tag offset requirements.
--

commit e468dc8fd143415f68c52754f1aefda21e1be71b
Author: Linus Walleij <linusw@kernel.org>

net: dsa: tag_ks8995: Add the KS8995 tag handling

This commit adds the ingress and egress KS8995 tag handling code for the
KS8995 100Mbit switch. The tag uses a modified 0x8100 ethertype to encode
the target ports.

> diff --git a/net/dsa/tag_ks8995.c b/net/dsa/tag_ks8995.c
> new file mode 100644
> --- /dev/null
> +++ b/net/dsa/tag_ks8995.c
[ ... ]
> +static struct sk_buff *ks8995_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
> +	struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
> +	bool have_hwaccel_tag = false;
> +	u16 tci = 0, portmask;
> +
> +	/* Prepare the special KS8995 tags */
> +	portmask = dsa_xmit_port_mask(skb, dev);
> +
> +	if (skb_vlan_tag_present(skb) && skb->vlan_proto == htons(ETH_P_8021Q)) {

[Severity: High]
Will this drop or misroute packets with non-802.1Q hardware-accelerated VLAN
tags (such as 802.1ad)?

By strictly checking for ETH_P_8021Q, other hardware-accelerated tags are
left in the SKB metadata. When the master network interface transmits the
packet, it might insert this hardware VLAN tag outside the payload.

This insertion would shift the KS8995 DSA tag away from offset 12, which
is where the switch hardware strictly expects it to be. Should the driver
push all hardware-accelerated tags into the payload (for example, by using
__vlan_hwaccel_push_inside()) before inserting the DSA switch tag?

> +		tci = skb_vlan_tag_get(skb);
> +		__vlan_hwaccel_clear_tag(skb);
> +		have_hwaccel_tag = true;
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260704-ks8995-to-ksz8-v7-0-2af0eaa545a8@kernel.org?part=3

  reply	other threads:[~2026-07-05 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-04 19:39 [PATCH net-next v7 0/5] net: dsa: microchip: Add support for KSZ8995XA/KS8995XA Linus Walleij
2026-07-04 19:39 ` [PATCH net-next v7 1/5] net: dsa: microchip: Add fallback Micrel compatibles Linus Walleij
2026-07-05 19:40   ` sashiko-bot
2026-07-04 19:39 ` [PATCH net-next v7 2/5] dt-bindings: net: dsa: microchip: Add KSZ8995XA Linus Walleij
2026-07-04 19:39 ` [PATCH net-next v7 3/5] net: dsa: tag_ks8995: Add the KS8995 tag handling Linus Walleij
2026-07-05 19:40   ` sashiko-bot [this message]
2026-07-04 19:39 ` [PATCH net-next v7 4/5] net: dsa: microchip: Support Microchip KSZ8995XA / KS8995XA Linus Walleij
2026-07-05 19:40   ` sashiko-bot
2026-07-04 19:39 ` [PATCH net-next v7 5/5] net: dsa: ks8995: Delete surplus driver Linus Walleij
2026-07-05 19:40   ` sashiko-bot

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=20260705194012.6FBB31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linusw@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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