Article View: linux.kernel.netdev
Article #22656Re: [PATCH net-next v5 5/9] net: dsa: Add tag handling for SoC-e switches
From: Vasilij Strassheim
Date: Wed, 25 Nov 2026 16:06
Date: Wed, 25 Nov 2026 16:06
54 lines
11395 bytes
11395 bytes
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
Technical Details
Message-ID:
<bd31f8cd5121429a3b181ba70ffd53475aec8704.camel@linutronix.de>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371512-linux-kernel-netdev=dewy.ruReferences:
<20261120-devel-vstrassheim-soce-dsa-ml-v5-0-5de9225715e6@linutronix.de> <20261120-devel-vstrassheim-soce-dsa-ml-v5-5-5de9225715e6@linutronix.de> <sashiko-outbox-227109@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371512-linux-kernel-netdev=dewy.ru From: v.strassheim@linutronix.de (Vasilij Strassheim) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <bd31f8cd5121429a3b181ba70ffd53475aec8704.camel@linutronix.de> References: <20261120-devel-vstrassheim-soce-dsa-ml-v5-0-5de9225715e6@linutronix.de> <20261120-devel-vstrassheim-soce-dsa-ml-v5-5-5de9225715e6@linutronix.de> <sashiko-outbox-227109@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="250159"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:/mjPaZ6qJqj6jKw8qA/imX9te/8= sha256:s0A2qbWjZDtYNB0TcAV0CbQj773Bo5zRL38LVJz+jl4= sha1:51N9+xZC3Kcj6MIkWr9DbaNdDtI= sha256:258lE16vdyBNR5aU3ISGHGj21xiHWy5wp1cL1yLuVcs= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id D2EEE125E81; Wed, 25 Nov 2026 19:07:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=linutronix.de header.b=ppI+mJfi; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=linutronix.de header.b=kI7IykWa X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l9mJdGVKDkDh; Wed, 25 Nov 2026 19:07:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371512-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 8D196125E82; Wed, 25 Nov 2026 19:07:14 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 42849397F9; Wed, 25 Nov 2026 16:07:01 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795622818; b=hbcbrHmx6RAy9D5jJtJnOftCmMxBRHUPg3GPCVMQ/mDZ1a6b5TDlU9+IVk9mO8RthVlq FMLRZm7WNCU3rOH+OFWbhmihffVtE/PK9xdnbes/3Xnsry7CEPWvHmaDCcOyspQDB+m5M lRWkgprfiDuMcuD/YeQoJFxL8/lbQ3nAtIMqeXAtCpxTmrgo5uTMYfITGAt5xl1VYdl6w yN0Sw82xent7bI8fPuHot7Cf6hkhOdXoVxi4prXc+KeneOGQ8snygoiFdmQ0gdMKo+mRa bdxo/QM2prXGpB+L4VnQlZHYcKYU6+J9gPcS3PDoBcT6Co4wvQ0PRNSR1iZZAgvJ0Uw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795622818; h=X-Original-To:Received:DMARC-Filter:Message-ID:DKIM-Signature: DKIM-Signature:Subject:From:To:Cc:Date:In-Reply-To:References: Disposition-Notification-To:Organization:Content-Type: Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version; bh=S3FuZwbrAhjaM6kTBlafii6bM4GnE5BBZTC//slK6X0=; b=UPmoZVxVBWS9jrOIhPU+Qjrm1UqxPmEByWl+adI9Gdu3wZhZxyVEdH94If6J/mavv+yu mAY7lnRHY+ZK8ofoQWdVU+4J9IKxCPYaRhbCvMzpbzIqT3M7v0SMbU+51pIuawn0QylMN 5BB3lKCglwlpzdiKi7WpMAzqdZMRtZV3vTd6FCMbhSx+D4k5PdrKdKIrRwMiZX5gmhSgK 6eTLTUh2BV/WY3VbHOH2bY22LPSW6xWA/be12lhfNzS1Hn5TRGShtkm7RQ9obAckdy3+0 tnK/+fL5ySwVn714d0DjmyEAsVa8g1vmgwmTwtC2ArO/hCgt/7gC4o4Bx0soT4Um+9A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=ppI+mJfi; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=kI7IykWa; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D964A606A69E; Wed, 25 Nov 2026 16:06:58 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=ppI+mJfi; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=kI7IykWa X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795622818; b=RBsNTbFZno10/uxQWDZfnGA3jRAujWU9mNi3xfqBkXWiDf3aZcjnVyiFb9G79RuivYqM qKRopsKNlU+n+UBRQ/hydmK6e4YhrwTf866xlCmhdpufhYfryqr9xYs7Bj8UvFl1iT41Z MZmTSj//xFGiCmiAeeQR42rBnte1KCjE2MwmbhglMawOEZ1IYzXHqRVxO7fZb6O0TXwM4 dt72E0QU+VbzS3Ol1ipTdVfh6UJ5qYquHLWyAL1O2xNtHwB8Xo0dAouEim6QLvEIu9v5d vp1yUFhi2XVXBheIR88S9I/0pAHM0R6DcO8m/N8FB4vuFnni1fkhwZJ3tnqvi1okLWw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795622818; h=DMARC-Filter:Message-ID:DKIM-Signature:DKIM-Signature:Subject:From: To:Cc:Date:In-Reply-To:References:Disposition-Notification-To: Organization:Content-Type:Content-Transfer-Encoding:MIME-Version; bh=S3FuZwbrAhjaM6kTBlafii6bM4GnE5BBZTC//slK6X0=; b=zpimc9MF8rGjnAxvzcoooY30/+Jnf+66c8tgGyY+og4VvODhLgFCPZO/MX+tAsvyH5va Oyvwhuzp0oAA97GPWzm71oZobWontEmDtRWfb5N5DNwNkzXSLoSfXuDy0Ijoe5PrXBpRB qpEAt5a+Hh0lRdJXj76qtIMvNQCXuotoobwEzrSFndoV8fg87dkIeiiTS9sT94q/uPjcE 9jv669/Lvmw85da5Udw1x8Bsva87uXLHisSJb1Dp5ZNlfoUxPSUmuXdMdNCjExxQWRZcH 9smJPWs9Pn791xqQXQGq0T+kfs+HWW0xXortRAQtQqegL20W31QBfDVm93s/dy2OqTw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=ppI+mJfi; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=kI7IykWa; arc=none smtp.remote-ip=193.142.43.55 X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A78B5606A682; Wed, 25 Nov 2026 16:06:56 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A78B5606A682 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1795622813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S3FuZwbrAhjaM6kTBlafii6bM4GnE5BBZTC//slK6X0=; b=ppI+mJfiNu64lB4cP9r+efKp90B6RxvjvO1EYM2GYO0XNKA7U4fuZH9+bdhujgZewVnKML epcRVSZwW8Cdn7NUW9lcwfaOIssIN+xJOGJ8rq1ZBi2y/311PMwAxaTuJ+oHdIQxNjvjsR 0MzVEv+feRxWpAlRE4FgEWjj7uVwqmb6WekA2M/8re6hO3HIfrqt6nqANGUc1IjmBbBEjd shz24YD5tIt3+1tHW1Y1z+UIa/INyEi0DJ353aP5q8kJh3rExQhFjDgLWYDI3sbBGSsJLA clT34JhJxOFBR/bpf9e+L/bActooeqdlNiD9wy57A3vx4+OgZ1HeVg0PDe6/3w== X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1795622813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S3FuZwbrAhjaM6kTBlafii6bM4GnE5BBZTC//slK6X0=; b=kI7IykWaiatQvtUYlHM+qgl3ONjmikyiQQiOdaoshgxC4hg2CF3o731Q9pqk8WCy2oVo7e tHgmexuzGmJ3pfDw== X-Cc: devicetree@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org, lee@kernel.org, netdev@vger.kernel.org X-In-Reply-To: <sashiko-outbox-227109@kernel.org> X-Disposition-Notification-To: v.strassheim@linutronix.de X-Organization: Linutronix GmbH X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list