lkml.org 
[lkml]   [2019]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 net-next 16/24] net: dsa: sja1105: Add support for VLAN operations
Sat, Apr 13, 2019 at 03:28:14AM CEST, olteanv@gmail.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@gmail.com>
>Reviewed-by: Florian Fainelli <f.fainelli@gmail.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.

\
 
 \ /
  Last update: 2019-04-13 22:56    [W:0.271 / U:1.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site