Commit 14574676 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: Keep the vlan_filtering setting in dsa_switch if it's global

The current behavior is not as obvious as one would assume (which is
that, if the driver set vlan_filtering_is_global = 1, then checking any
dp->vlan_filtering would yield the same result). Only the ports which
are actively enslaved into a bridge would have vlan_filtering set.

This makes it tricky for drivers to check what the global state is.
So fix this and make the struct dsa_switch hold this global setting.
Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3ee07d1
...@@ -233,6 +233,11 @@ struct dsa_switch { ...@@ -233,6 +233,11 @@ struct dsa_switch {
*/ */
bool vlan_filtering_is_global; bool vlan_filtering_is_global;
/* In case vlan_filtering_is_global is set, the VLAN awareness state
* should be retrieved from here and not from the per-port settings.
*/
bool vlan_filtering;
unsigned long *bitmap; unsigned long *bitmap;
unsigned long _bitmap; unsigned long _bitmap;
......
...@@ -208,6 +208,9 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering, ...@@ -208,6 +208,9 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
if (err) if (err)
return err; return err;
if (ds->vlan_filtering_is_global)
ds->vlan_filtering = vlan_filtering;
else
dp->vlan_filtering = vlan_filtering; dp->vlan_filtering = vlan_filtering;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment