Re: [RFC net-next 2/2] net: dsa: tag_mtk: handle VLAN tag insertion on TX

From: Florian Fainelli
Date: Thu Aug 26 2021 - 07:37:34 EST

On 8/26/2021 7:29 AM, DENG Qingfang wrote:
On Thu, Aug 26, 2021 at 03:03:49AM +0300, Vladimir Oltean wrote:

You cannot just remove the old code. Only things like 8021q uppers will
send packets with the VLAN in the hwaccel area.

If you have an application that puts the VLAN in the actual AF_PACKET
payload, like:

then you need to handle the VLAN being in the skb payload.

I've actually tested this (only apply patch 2 without .features) and it
still worked.

OK and this works because now you always push a MTK_HDR_LEN tag which you were not doing before for VLAN-tagged frames, right?

You don't seem to be clearing mtk_tag[2] and mtk_tag[3] anymore, is that intended?

The comment says the VLAN tag need to be combined with the special tag in
order to perform VLAN table lookup, so we can set its destination port
vector to all zeroes and the switch will forward it like a data frame
(TX forward offload), but as we allow multiple bridges which are either
VLAN-unaware or VLAN-aware with the same VID, there is no way to determine
the destination bridge unless we maintain some VLAN translation mapping.

There is no "bridge" on the other side from the CPU port's perspective on egress, only physical ports, so how does that comment apply?