public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Joris Vaisvila <joey@tinyisr.com>,
	netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"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>
Subject: Re: [RFC 0/2 net-next] net: dsa: MT7628 embedded switch initial support
Date: Sun, 1 Mar 2026 14:36:19 +0200	[thread overview]
Message-ID: <20260301123619.skschp4ioxnevh3u@skbuf> (raw)
In-Reply-To: <aaQqdwNsuwzRb7Xu@makrotopia.org>

On Sun, Mar 01, 2026 at 12:00:55PM +0000, Daniel Golle wrote:
> On Sun, Mar 01, 2026 at 01:40:31AM +0200, Vladimir Oltean wrote:
> > [...]
> > I looked at arch/mips/boot/dts/ralink/mt7628a.dtsi and found nothing
> > Ethernet-related. So it's a bit hard to comment from me whether this is
> > an instance of mtk_eth_soc.c or something, that is being used as a DSA
> > conduit. Case in which your architectural choice is fine.
> 
> Yes, the SoC Ethernet is supported by mtk_eth_soc.c, the reason why it
> is still missing in mt7628a.dtsi is preceisely because there is no way to
> actually use without a DSA/switch driver.

OK.

In that case I would like to know more about how is VLAN unawareness achieved,
with a concrete example.

In the code, this is attributed to:

	/* set up switch for double tagging to simulate vlan unawareness */
	regmap_set_bits(esw->regmap, MT7628_ESW_REG_POC2,
			MT7628_ESW_POC2_PER_VLAN_UNTAG_EN);

which sets bit 15 (PER_VLAN_UNTAG_EN) of Port Control 2 (POC2),
documented as:

VLAN tag removal option.
0: Use per port UNTAG_EN
1: Use untag enable bitmap in VLAN table

I see a slight discrepancy between what the documentation claims the
hardware does, and what the driver claims it does. The documentation
seems to say that setting this bit is what allows the vlan->untag bits
to take effect.

There does exist a DOUBLE_TAG_EN field in SGC2, which this driver
documents as MT7628_ESW_SGC2_DOUBLE_TAG_EN, but doesn't use. Then it
SGC2 to 0, as part of that "undocumented" stuff.

Assuming that was the intended field to be written, here is how it is
documented:

6:0 DOUBLE_TAG_EN Insert double tag field
When this bit is set, the incoming packet is allowed to insert outer or
double tag.
1: enable double tag field
0: disable the double tag field.
(Note: Port5 funciton is only valid when port 5 Giga MAC is implemented)

The documentation is not specific enough for me to understand what it
does, so I'll give an example.

A VLAN-unaware port means that when an ingress packet comes with 802.1Q
TPID 0x8100 and VID X from the wire, this VLAN header will be ignored by
the switch, and the PVID of the port will be pushed as an outer tag, for
any value of X, regardless of whether it is in the VLAN table or not.
Does it do that?

  reply	other threads:[~2026-03-01 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 18:52 [RFC 0/2 net-next] net: dsa: MT7628 embedded switch initial support Joris Vaisvila
2026-02-28 18:52 ` [RFC PATCH 1/2 net-next] net: dsa: initial MT7628 special tag driver Joris Vaisvila
2026-02-28 20:12   ` Andrew Lunn
2026-03-04 22:16   ` Vladimir Oltean
2026-02-28 18:52 ` [RFC PATCH 2/2 net-next] net: dsa: initial support for MT7628 embedded switch Joris Vaisvila
2026-02-28 20:16   ` Andrew Lunn
2026-02-28 20:31   ` Andrew Lunn
2026-03-01 17:23     ` Joris Vaišvila
2026-02-28 23:40 ` [RFC 0/2 net-next] net: dsa: MT7628 embedded switch initial support Vladimir Oltean
2026-03-01 12:00   ` Daniel Golle
2026-03-01 12:36     ` Vladimir Oltean [this message]
2026-03-01 13:13       ` Joris Vaišvila

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=20260301123619.skschp4ioxnevh3u@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=joey@tinyisr.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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