Netdev List
 help / color / mirror / Atom feed
From: Vasilij Strassheim <v.strassheim@linutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	 Martin Kaistra <martin.kaistra@linutronix.de>
Subject: Re: [PATCH 3/4] net: dsa: Add support for SoC-e SDSA tags
Date: Mon, 03 Aug 2026 17:37:26 +0200	[thread overview]
Message-ID: <723a256eb9d5aa64e7037f98eabeeb99257f03f2.camel@linutronix.de> (raw)
In-Reply-To: <df7e7e04-80fc-4b80-9afd-0e9bc14a759f@lunn.ch>

On Wed, 2026-07-29 at 19:22 +0200, Andrew Lunn wrote:
> > @@ -98,6 +98,12 @@ config NET_DSA_TAG_EDSA
> >  	  Say Y or M if you want to enable support for tagging frames for the
> >  	  Marvell switches which use EtherType DSA headers.
> >  
> > +config NET_DSA_TAG_SDSA
> > +	tristate "Tag driver for SoC-e switches using EtherType SDSA headers"
> > +	help
> > +	  Say Y or M if you want to enable support for tagging frames for the
> > +	  SoC-e switches.
> > +
> 
> These entries are sorted, so it probably should be between
> NET_DSA_TAG_RZN1_A5PSW and NET_DSA_TAG_LAN9303.

I will insert it as suggested. To better understand, what is the sort order?
To me, it seems like there's also a good spot between
NET_DSA_TAG_LAN9303 and NET_DSA_TAG_SJA1105.

> 
> > @@ -23,6 +23,7 @@ dsa_core-y += \
> >  obj-$(CONFIG_NET_DSA_TAG_AR9331) += tag_ar9331.o
> >  obj-$(CONFIG_NET_DSA_TAG_BRCM_COMMON) += tag_brcm.o
> >  obj-$(CONFIG_NET_DSA_TAG_DSA_COMMON) += tag_dsa.o
> > +obj-$(CONFIG_NET_DSA_TAG_SDSA) += tag_sdsa.o
> >  obj-$(CONFIG_NET_DSA_TAG_GSWIP) += tag_gswip.o
> 
> Also sorted, and this is the wrong spot.

Oh yes, I'll place it between tag_rzn1_a5psw and tag_sja1105.

> 
> > +#define SDSA_HLEN	8
> > +
> > +#define SDSA_NAME	"sdsa"
> 
> Does SDSA mean anything? Or have you taken net/dsa/tag_dsa.c, and just
> changed edsa to sdsa?

The "S" stands for Soc-e. I don't have any preferences and just took it
from the original code.

> 
> > +static struct sk_buff *sdsa_xmit(struct sk_buff *skb, struct net_device *dev)
> > +{
> > +	struct dsa_port *dp = dsa_user_to_port(dev);
> > +	u8 *sdsa_header;
> > +
> > +	if (skb_cow_head(skb, SDSA_HLEN) < 0)
> > +		return NULL;
> > +
> > +	skb_push(skb, SDSA_HLEN);
> > +	dsa_alloc_etype_header(skb, SDSA_HLEN);
> > +
> > +	/* Construct the FROM_CPU DSA tag. */
> 
> Is FROM_CPU a concept for this device? Are there other types of tag?

Yes, the documentation describes two types of tagging headers for frames from
the switch to the CPU and from the CPU to the switch. The tags differ in some
bits.

> 
> > +	sdsa_header = dsa_etype_header_pos_tx(skb);
> > +	sdsa_header[0] = (ETH_P_SDSA >> 8) & 0xff;
> > +	sdsa_header[1] = ETH_P_SDSA & 0xff;
> > +	sdsa_header[2] = 0x00; /* reserved */
> > +	sdsa_header[3] = 0x00; /* reserved */
> > +	sdsa_header[4] = FIELD_PREP(SDSA_TAG_FRAME_TYPE_MASK, 1) |
> > +			 FIELD_PREP(SDSA_TAG_PORT_HI_MASK, dp->index >> 5);
> > +	sdsa_header[5] = FIELD_PREP(SDSA_TAG_PORT_MASK, dp->index);
> > +	sdsa_header[6] = 0x00; /* VLAN not supported */
> > +	sdsa_header[7] = 0x00; /* VLAN not supported */
> > +
> > +	return skb;
> > +}
> > +
> > +static struct sk_buff *sdsa_rcv(struct sk_buff *skb, struct net_device *dev)
> > +{
> > +	u8 *sdsa_header;
> > +	int source_port;
> > +	u8 frame_type;
> > +
> > +	if (unlikely(!pskb_may_pull(skb, SDSA_HLEN)))
> > +		return NULL;
> > +
> > +	sdsa_header = dsa_etype_header_pos_rx(skb);
> > +
> > +	/* Check that the frame type is TO_CPU. */
> > +	frame_type = FIELD_GET(SDSA_TAG_FRAME_TYPE_MASK, sdsa_header[4]);
> > +	if (frame_type != 0)
> 
> #define for TO_CPU?

I will add definitions for both TO_CPU and FROM_CPU.

> 
> 	Andrew

Thanks,
Vasilij


  reply	other threads:[~2026-08-03 15:37 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 16:36 [PATCH 0/4] net: dsa: Add SoC-e DSA driver Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 1/4] dt-bindings: vendor-prefixes: Add soce Vasilij Strassheim
2026-07-30  8:50   ` Krzysztof Kozlowski
2026-08-03 16:03     ` Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 2/4] dt-bindings: net: dsa: Add SoC-e switch IP and DSA bindings Vasilij Strassheim
2026-07-29 17:11   ` Andrew Lunn
2026-08-03 15:29     ` Vasilij Strassheim
2026-08-03 16:35       ` Andrew Lunn
2026-08-05 12:33         ` Vasilij Strassheim
2026-07-29 18:07   ` Rob Herring (Arm)
2026-08-03 15:47     ` Vasilij Strassheim
2026-07-30  8:56   ` Krzysztof Kozlowski
2026-08-03 16:15     ` Vasilij Strassheim
2026-08-03 16:43       ` Andrew Lunn
2026-08-05 12:40         ` Vasilij Strassheim
2026-08-05 12:53           ` Andrew Lunn
2026-08-05 13:17             ` Vasilij Strassheim
2026-08-05 13:32         ` Benedikt Spranger
2026-08-05 13:53           ` Andrew Lunn
2026-08-05 14:27             ` Benedikt Spranger
2026-08-06 13:35               ` Andrew Lunn
2026-08-06 15:25                 ` Benedikt Spranger
2026-08-04  6:25       ` Krzysztof Kozlowski
2026-08-05 13:03         ` Vasilij Strassheim
2026-07-30  8:56   ` Krzysztof Kozlowski
2026-08-03 16:16     ` Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 3/4] net: dsa: Add support for SoC-e SDSA tags Vasilij Strassheim
2026-07-29 17:22   ` Andrew Lunn
2026-08-03 15:37     ` Vasilij Strassheim [this message]
2026-08-03 16:46       ` Andrew Lunn
2026-08-05 12:47         ` Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 4/4] net: dsa: soce: Add initial driver support for MRS switches Vasilij Strassheim
2026-07-29 17:31   ` Andrew Lunn
2026-08-03 15:40     ` Vasilij Strassheim
2026-07-29 20:05   ` Andrew Lunn
2026-08-03 16:01     ` Vasilij Strassheim
2026-08-03 16:49       ` Andrew Lunn
2026-08-05 12:48         ` Vasilij Strassheim
2026-07-30  9:01   ` Krzysztof Kozlowski
2026-08-03 16:23     ` Vasilij Strassheim
2026-07-29 16:56 ` [PATCH 0/4] net: dsa: Add SoC-e DSA driver Andrew Lunn
2026-08-03 15:22   ` Vasilij Strassheim
2026-08-03 16:32     ` Andrew Lunn
2026-08-05 12:28       ` 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=723a256eb9d5aa64e7037f98eabeeb99257f03f2.camel@linutronix.de \
    --to=v.strassheim@linutronix.de \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=martin.kaistra@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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