[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190428184554.9968-11-olteanv@gmail.com>
Date: Sun, 28 Apr 2019 21:45:51 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: f.fainelli@...il.com, vivien.didelot@...il.com, andrew@...n.ch,
davem@...emloft.net
Cc: netdev@...r.kernel.org, Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH net-next 10/13] 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@...il.com>
---
net/dsa/port.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 555fdbf0a3f4..da5922ba7d33 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)
--
2.17.1
Powered by blists - more mailing lists