[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+h21hpStYyyg=BD4n=RppQx-4a1y03k45qKrJnAeF8xuj3ruQ@mail.gmail.com>
Date: Sun, 14 Apr 2019 00:39:55 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: Florian Fainelli <f.fainelli@...il.com>, vivien.didelot@...il.com,
Andrew Lunn <andrew@...n.ch>, davem@...emloft.net,
netdev <netdev@...r.kernel.org>, linux-kernel@...r.kernel.org,
Georg Waibel <georg.waibel@...sor-technik.de>
Subject: Re: [PATCH v3 net-next 16/24] net: dsa: sja1105: Add support for VLAN operations
On Sat, 13 Apr 2019 at 23:56, Jiri Pirko <jiri@...nulli.us> wrote:
>
> Sat, Apr 13, 2019 at 03:28:14AM CEST, olteanv@...il.com wrote:
> >VLAN filtering cannot be properly disabled in SJA1105. So in order to
> >emulate the "no VLAN awareness" behavior (not dropping traffic that is
> >tagged with a VID that isn't configured on the port), we need to hack
> >another switch feature: programmable TPID (which is 0x8100 for 802.1Q).
> >We are reprogramming the TPID to a bogus value (ETH_P_EDSA) which leaves
> >the switch thinking that all traffic is untagged, and therefore accepts
> >it.
> >
> >Under a vlan_filtering bridge, the proper TPID of ETH_P_8021Q is
> >installed again, and the switch starts identifying 802.1Q-tagged
> >traffic.
> >
> >Signed-off-by: Vladimir Oltean <olteanv@...il.com>
> >Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
> >---
> >Changes from v3:
> >Changed back to ETH_P_EDSA.
> >
> >Changes from v2:
> >Changed the TPID from ETH_P_EDSA (0xDADA) to a newly introduced one:
> >ETH_P_DSA_8021Q (0xDADB).
> >
> > drivers/net/dsa/sja1105/sja1105_main.c | 254 +++++++++++++++++-
> > .../net/dsa/sja1105/sja1105_static_config.c | 38 +++
> > .../net/dsa/sja1105/sja1105_static_config.h | 3 +
> > 3 files changed, 293 insertions(+), 2 deletions(-)
> >
>
> [...]
>
>
> >+#define sja1105_vlan_filtering_enabled(priv) \
> >+ (((struct sja1105_general_params_entry *) \
> >+ ((struct sja1105_private *)priv)->static_config. \
> >+ tables[BLK_IDX_GENERAL_PARAMS].entries)->tpid == ETH_P_8021Q)
>
> This is unreadable. Please have it as function.
>
I admit to that. If I reach to a consensus with Andrew on 12/24
ideally I could just say cpu_dp->vlan_filtering.
Thanks,
-Vladimir
Powered by blists - more mailing lists