All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vasilij Strassheim" <v.strassheim@linutronix.de>
Cc: devicetree@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH net-next v5 5/9] net: dsa: Add tag handling for SoC-e switches
Date: Sat, 21 Nov 2026 14:53:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-227109@kernel.org> (raw)
In-Reply-To: <20261120-devel-vstrassheim-soce-dsa-ml-v5-5-5de9225715e6@linutronix.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: dsa: broken flow dissection in sdsa due to inflated
  needed_headroom
--

commit ff03e408d05d4a91db8a81df7f6cead0f9e1dc6f
Author: Vasilij Strassheim <v.strassheim@linutronix.de>

net: dsa: Add tag handling for SoC-e switches

This commit adds a DSA tag driver for SoC-e switches using the 8-byte
EtherType SDSA header.

> diff --git a/net/dsa/tag_sdsa.c b/net/dsa/tag_sdsa.c
> new file mode 100644
> index 0000000000000..c5a9f61edf405
> --- /dev/null
> +++ b/net/dsa/tag_sdsa.c
[ ... ]
> +static const struct dsa_device_ops sdsa_netdev_ops = {
> +	.name = SDSA_NAME,
> +	.proto = DSA_TAG_PROTO_SDSA,
> +	.xmit = sdsa_xmit,
> +	.rcv = sdsa_rcv,
> +	/* Include room for an accelerated non-802.1Q tag pushed in-band. */
> +	.needed_headroom = SDSA_HLEN + VLAN_HLEN,
> +};

[Severity: Medium]
Does setting .needed_headroom to SDSA_HLEN + VLAN_HLEN without a
.flow_dissect callback break flow dissection on the conduit?

When ops->flow_dissect is NULL, __skb_flow_dissect() falls back to
dsa_tag_generic_flow_dissect(), which uses ops->needed_headroom as the RX
tag length:

include/net/dsa.h:dsa_tag_generic_flow_dissect() {
	const struct dsa_device_ops *ops = skb->dev->dsa_ptr->tag_ops;
	int tag_len = ops->needed_headroom;

	*offset = tag_len;
	*proto = ((__be16 *)skb->data)[(tag_len / 2) - 1];
}

Because received frames only carry an 8-byte SDSA header (SDSA_HLEN),
dsa_tag_generic_flow_dissect() reads the encapsulated EtherType 4 bytes
past its actual offset and advances nhoff by 12 bytes instead of 8.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-devel-vstrassheim-soce-dsa-ml-v5-0-5de9225715e6@linutronix.de?part=5

  reply	other threads:[~2026-11-21 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 14:52 [PATCH net-next v5 0/9] net: dsa: Add support for SoC-e Ethernet switch IP cores Vasilij Strassheim
2026-11-20 14:52 ` [PATCH net-next v5 1/9] dt-bindings: vendor-prefixes: Add soce Vasilij Strassheim
2026-11-20 14:52 ` [PATCH net-next v5 2/9] dt-bindings: net: Add SoC-e SWIP MDIO controller Vasilij Strassheim
2026-11-21 14:53   ` sashiko-bot
2026-11-20 14:52 ` [PATCH net-next v5 3/9] dt-bindings: net: dsa: Add SoC-e SWIP switch function Vasilij Strassheim
2026-11-21 14:53   ` sashiko-bot
2026-11-20 14:52 ` [PATCH net-next v5 4/9] dt-bindings: mfd: Add SoC-e SWIP parent Vasilij Strassheim
2026-11-21 10:19   ` Krzysztof Kozlowski
2026-11-21 14:53   ` sashiko-bot
2026-11-20 14:52 ` [PATCH net-next v5 5/9] net: dsa: Add tag handling for SoC-e switches Vasilij Strassheim
2026-11-21 14:53   ` sashiko-bot [this message]
2026-11-20 14:52 ` [PATCH net-next v5 6/9] net: mdio: Add SoC-e SWIP MDIO controller driver Vasilij Strassheim
2026-11-20 14:52 ` [PATCH net-next v5 7/9] mfd: soce: Add SWIP core driver Vasilij Strassheim
2026-11-20 14:52 ` [PATCH net-next v5 8/9] net: dsa: soce: Add basic support for SoC-e SWIP switch Vasilij Strassheim
2026-11-20 14:52 ` [PATCH net-next v5 9/9] net: dsa: soce: Add VLAN membership table support Vasilij Strassheim

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=sashiko-outbox-227109@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=v.strassheim@linutronix.de \
    /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.