Re: [PATCH net 3/6] net: dsa: ksz: insert tag on ks8795 ingress packets

From: Florian Fainelli
Date: Wed Jan 13 2021 - 18:49:57 EST


On 1/13/21 4:45 AM, Gilles DOFFE wrote:
> If 802.1q VLAN tag is removed from egress traffic, ingress
> traffic should by logic be tagged.

Which logic do you refer to? Software or hardware? What an user
configures with the "bridge vlan add ..." commands is the egress
tagging, but this also affects what egresses the CPU port, and therefore
what your Ethernet MAC used as a DSA master "sees", so I am not sure why
this is doing?

>
> Signed-off-by: Gilles DOFFE <gilles.doffe@xxxxxxxxxxxxxxxxxxxx>
> ---
> drivers/net/dsa/microchip/ksz8795.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
> index 4b060503b2e8..193f03ef9160 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -874,6 +874,7 @@ static void ksz8795_port_vlan_add(struct dsa_switch *ds, int port,
> }
>
> ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged);
> + ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_INSERT_TAG, !untagged);
> }
>
> static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
>


--
Florian