summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2019-04-28 21:45:51 +0300
committerDavid S. Miller <davem@davemloft.net>2019-04-30 23:05:29 -0400
commitec9121e7d2871618b8c297a4fe6250714411f61d (patch)
tree39e08f355cc23f18d682ea176c5bdd37d432be63 /net/dsa
parent2a1305515bf4387bb21e2624c473fc26d846dcbd (diff)
net: dsa: Skip calling .port_vlan_filtering on no change
Even if VLAN filtering is global, DSA will call this callback once per each port. Drivers should not have to compare the global state with the requested change. So let DSA do it. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/port.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c
index c27c16b69ab6..aa7ec043d5ba 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -203,6 +203,9 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
if (!dsa_port_can_apply_vlan_filtering(dp, vlan_filtering))
return -EINVAL;
+ if (dsa_port_is_vlan_filtering(dp) == vlan_filtering)
+ return 0;
+
err = ds->ops->port_vlan_filtering(ds, dp->index,
vlan_filtering);
if (err)