From: Vladimir Oltean Date: Sun, 28 Apr 2019 18:45:51 +0000 (+0300) Subject: net: dsa: Skip calling .port_vlan_filtering on no change X-Git-Tag: v5.2-rc1~133^2~75^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec9121e7d2871618b8c297a4fe6250714411f61d;p=thirdparty%2Flinux.git 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 Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/net/dsa/port.c b/net/dsa/port.c index c27c16b69ab68..aa7ec043d5ba4 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)