Re: [RFC 0/2 net-next] net: dsa: MT7628 embedded switch initial support
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2026-03-01 12:36:24
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:quoted
[...] 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?