Netdev List
 help / color / mirror / Atom feed
From: Vasilij Strassheim <v.strassheim@linutronix.de>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org,
	 conor+dt@kernel.org, lee@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5 5/9] net: dsa: Add tag handling for SoC-e switches
Date: Wed, 25 Nov 2026 17:06:51 +0100	[thread overview]
Message-ID: <bd31f8cd5121429a3b181ba70ffd53475aec8704.camel@linutronix.de> (raw)
In-Reply-To: <sashiko-outbox-227109@kernel.org>

On Sat, 2026-11-21 at 14:53 +0000, sashiko-bot@kernel.org wrote:
> 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.
> 

Yes, there is a problem. I will fix that with an SDSA-specific
.flow_dissect() callback

  parent reply	other threads:[~2026-11-25 16:06 UTC|newest]

Thread overview: 17+ 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
     [not found]   ` <sashiko-outbox-227106@kernel.org>
2026-11-24 12:04     ` Vasilij Strassheim
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-22 14:54   ` Krzysztof Kozlowski
2026-11-24 10:40     ` Vasilij Strassheim
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-23 17:59     ` Vasilij Strassheim
2026-12-01 22:48       ` Rob Herring
2026-11-20 14:52 ` [PATCH net-next v5 5/9] net: dsa: Add tag handling for SoC-e switches Vasilij Strassheim
     [not found]   ` <sashiko-outbox-227109@kernel.org>
2026-11-25 16:06     ` Vasilij Strassheim [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=bd31f8cd5121429a3b181ba70ffd53475aec8704.camel@linutronix.de \
    --to=v.strassheim@linutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=netdev@vger.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