All of lore.kernel.org
 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 v13 2/4] net: dsa: tag_ks8995: Add the KS8995 tag handling
Date: Mon, 14 Sep 2026 19:57:24 +0000	[thread overview]
Message-ID: <20260914195724.C15A71F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260913-ks8995-to-ksz8-v13-2-327b16d309eb@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The ks8995 tagger omits the `.flow_dissect` callback, causing the generic flow dissector to use an incorrect 8-byte offset for RX packets instead of 4 bytes, which breaks flow dissection on the conduit device.
--

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

net: dsa: tag_ks8995: Add the KS8995 tag handling

This commit adds DSA tagging support for the Micrel KS8995 switch family.
It implements custom ingress and egress tagging using a modified 802.1Q
tag format and registers the protocol operations.

> diff --git a/net/dsa/tag_ks8995.c b/net/dsa/tag_ks8995.c
> new file mode 100644
> index 0000000000000..435665013a864
> --- /dev/null
> +++ b/net/dsa/tag_ks8995.c
[ ... ]
> +
> +#define KS8995_NAME "ks8995"
> +
> +#define KS8995_TAG_LEN		VLAN_HLEN
> +/* Reserve room for the switch tag and a hardware-accelerated VLAN tag. */
> +#define KS8995_NEEDED_HEADROOM	(KS8995_TAG_LEN + VLAN_HLEN)

[Severity: High]
Does setting this headroom to 8 bytes cause issues during RX flow dissection?
Because the needed_headroom is 8 bytes, dsa_tag_generic_flow_dissect() will
erroneously assume the RX tag is also 8 bytes long.

[ ... ]
> +static const struct dsa_device_ops ks8995_netdev_ops = {
> +	.name = KS8995_NAME,
> +	.proto	= DSA_TAG_PROTO_KS8995,
> +	.xmit = ks8995_xmit,
> +	.rcv = ks8995_rcv,
> +	.needed_headroom = KS8995_NEEDED_HEADROOM,
> +};

[Severity: High]
Because there is no custom .flow_dissect override here, the DSA core falls
back to the generic flow dissector, which will use the 8-byte needed_headroom
as the RX tag length instead of 4 bytes.

Will this corrupt protocol extraction by skipping 8 bytes into the packet
instead of 4? This could cause the network core to read an invalid
encapsulated EtherType and break Receive Packet Steering (RPS), Transmit
Packet Steering (XPS), and Traffic Control (TC) rules on the conduit
interface.

Should a custom .flow_dissect callback be provided to correctly return a
4-byte offset (or 0 if the tag was stripped into hardware metadata)?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260913-ks8995-to-ksz8-v13-0-327b16d309eb@kernel.org?part=2

  reply	other threads:[~2026-09-14 19:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 19:56 [PATCH net-next v13 0/4] net: dsa: microchip: Add support for KSZ8995XA/KS8995XA Linus Walleij
2026-09-13 19:56 ` [PATCH net-next v13 1/4] dt-bindings: net: dsa: microchip: Add KSZ8995XA Linus Walleij
2026-09-14 20:46   ` netdev-bot+sashiko
2026-09-13 19:56 ` [PATCH net-next v13 2/4] net: dsa: tag_ks8995: Add the KS8995 tag handling Linus Walleij
2026-09-14 19:57   ` sashiko-bot [this message]
2026-09-14 20:41     ` Linus Walleij
2026-09-14 20:46   ` netdev-bot+sashiko
2026-09-13 19:56 ` [PATCH net-next v13 3/4] net: dsa: microchip: Support Microchip KSZ8995XA / KS8995XA Linus Walleij
2026-09-13 20:10   ` Nicolai Buchwitz
2026-09-14 19:57   ` sashiko-bot
2026-09-14 20:46   ` netdev-bot+sashiko
2026-09-13 19:56 ` [PATCH net-next v13 4/4] net: dsa: ks8995: Delete surplus driver Linus Walleij

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=20260914195724.C15A71F000FF@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.