Skip to content

Commit

Permalink
net: dsa: sja1105: exit sja1105_vlan_filtering when called multiple t…
Browse files Browse the repository at this point in the history
…imes

VLAN filtering is a global property for sja1105, and that means that we
rely on the DSA core to not call us more than once.

But we need to introduce some per-port state for the tagger, namely the
xmit_tpid, and the best place to do that is where the xmit_tpid changes,
namely in sja1105_vlan_filtering. So at the moment, exit early from the
function to avoid unnecessarily resetting the switch for each port call.
Then we'll change the xmit_tpid prior to the early exit in the next
patch.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed May 12, 2020
1 parent fa83e5d commit cfa36b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/dsa/sja1105/sja1105_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,9 @@ static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)
else
state = SJA1105_VLAN_FILTERING_FULL;

if (priv->vlan_state == state)
return 0;

priv->vlan_state = state;

table = &priv->static_config.tables[BLK_IDX_GENERAL_PARAMS];
Expand Down

0 comments on commit cfa36b1

Please sign in to comment.